forum/Locking and then unlocking a file results in file changed warninggit-annexhttp://git-annex.branchable.com/forum/Locking_and_then_unlocking_a_file_results_in_file_changed_warning/git-annexikiwiki2014-02-06T17:05:46ZHash is the samehttp://git-annex.branchable.com/forum/Locking_and_then_unlocking_a_file_results_in_file_changed_warning/comment_1_25a04c7345f5b626aa71524603c833ed/Daniel2014-02-05T11:13:12Z2014-02-05T11:13:12Z
I forgot to mention that I also checked the hash of the file to make sure that nothing changed the file and nothing changed. Just quick unlock/lock triggers it.
New git-annex package to blamehttp://git-annex.branchable.com/forum/Locking_and_then_unlocking_a_file_results_in_file_changed_warning/comment_2_7146a3c69749b9b1001fffc6e7a8bcda/Daniel2014-02-05T14:23:41Z2014-02-05T14:23:40Z
<p>I downgraded my git-annex version, rechecked out the repository and now everything works.
$ git annex version
git-annex version: 4.20130827
build flags: Assistant Inotify</p>
comment 3http://git-annex.branchable.com/forum/Locking_and_then_unlocking_a_file_results_in_file_changed_warning/comment_3_fd39e6ceffd9bf0709658c34945d8699/joeyh.name2014-02-06T17:05:46Z2014-02-06T17:05:45Z
<p>Recent versions of git-annex have tried to extend the --force option to be needed in any operation that can possibly cause data loss. This includes locking a file, since that throws away any changes.</p>
<p>Note that <code>git annex lock</code> does not check if the file is unmodified. For a few reasons including</p>
<ul>
<li>some backends don't include a checksum</li>
<li>it would be expensive to check a checksum</li>
<li>the file could get modified after or during a checksum check, and those modifications would be missed</li>
</ul>
<p>If you are sure you want to throw away any changes, use --force as suggested. If not, use <code>git annex add $file</code>, and assuming you're using a checksumming backend, it will notice the file has not changed and do what you want <code>git annex lock $file</code> to have done in this case.</p>