I am running git-annex on Mac OS 10.9 and syncing to a Linux device that was attached to a Synology NAS. Both were running December versions of git-annex.
While working on an application in IntelliJ my workspace.xml file disappeared. It went from being a real file to being a symlink to a location that didn't exist.
The symlink looks like this: workspace.xml -> ../../../.git/annex/objects/M2/8W/SHA256E-s68106--90e9cc4f617c9034db1bf462d058b82c59ade0be58de1d3a3e2f8c02606631c2.xml/SHA256E-s68106--90e9cc4f617c9034db1bf462d058b82c59ade0be58de1d3a3e2f8c02606631c2.xml
I tried git-annex fsck and I get this message: ** No known copies exist of XXXXXXX/workspace.xml
"XXXXXXX" is a path I needed to obscure I can see it in the git-annex repo but it is a reference to a symlink that doesn't exist
It was mentioned in another thread ( http://git-annex.branchable.com/forum/git_annex_on_osx_only_creating_symlinks6363/ ) that this could happen if I did a forced drop but I do not use git-annex on the command line. I'm using the assistant and having it manage all of my files for me.
I tried looking at the log for it and it shows this:
timmattison$ /Applications/git-annex.app/Contents/MacOS/git-annex log XXXXXXX/.idea/workspace.xml - 2014-01-03 19:49:58 XXXXXXX/.idea/workspace.xml | d6747880-b355-4d41-b4e5-d1ad3afcb4a5 -- timmattison@MacBook-Pro.local:~/Desktop/annex + 2014-01-03 17:08:32 XXXXXXX/.idea/workspace.xml | d6747880-b355-4d41-b4e5-d1ad3afcb4a5 -- timmattison@MacBook-Pro.local:~/Desktop/annex (Recording state in git...)
So I can see that the git-annex thinks the file was deleted but what really happened is that IntelliJ just modified it. workspace.xml files are modified very often when working in IntelliJ.
Is this a known bug that has been fixed in the new version (2013-12-30 or later)?
Thanks, Tim
If the file was modified, git-annex should notice and add the new version. So the mere act of modifying the file does not explain how you ended up with a symlink to the old version of the file. Although it does explain why git-annex log would show that the old version of the file had been deleted.
What does
git log
say when run on the workspace.xml file?git log on the file gives a ton of output, is this what you need?
commit 93157022d8ee57097db29fcc669e99e218b54657 Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 17:08:03 2014 -0500
commit 04dab5520f33140a21882515b4036f71729a5f89 Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 17:06:54 2014 -0500
commit b75be90bf91c9f9314e567d5a28e4497070de9af Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:58:24 2014 -0500
commit 4045b2d7a71b9ab692c20eeab73bf196a280940d Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:58:05 2014 -0500
commit 25de8a1fcd5cce53b8077443dccba1591255431f Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:57:32 2014 -0500
commit dd118ae88cdccb5a7d68a7ae14033304865cfc4e Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:53:37 2014 -0500
commit eaa5f85b7feed8ba17e3874763b4d7aa6e05b5c1 Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:53:23 2014 -0500
commit 4d310d7d16234a1a6bcf0f14ebae232c57d904a7 Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:52:42 2014 -0500
commit 2487ae7f99c7b81c1648fdc88d0b39a1cf6e4d03 Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:52:21 2014 -0500
commit 9e0040311c43e6e1f04ff3b8fdd3ac5570c8f2d1 Author: Tim Mattison tim.mattison@email.com Date: Fri Jan 3 16:51:54 2014 -0500
This happened again and now I have this:
lrwxr-xr-x 1 timmattison staff 197 Jan 16 11:18 distribute-client-applications.sh -> ../../../.git/annex/objects/JV/91/SHA256E-s921--51fc6a6e2924ff6e2673971b5786fe0f204a5984a700a2241cc77383f04f544e.sh/SHA256E-s921--51fc6a6e2924ff6e2673971b5786fe0f204a5984a700a2241cc77383f04f544e.sh
This was on the machine that had the file, not a remote machine it was syncing to. I was editing the script, I ran it, the bash script segfaulted (expected), and then git-annex essentially deleted the file. Can you help me understand why this happens? It's obvious when it is a file I'm working on but I'm afraid it could be happening to other files and I don't know about it.
Do you edit this file in multiple places? This could be an occurance of this bug: ?direct mode merge can overwrite local, non-annexed files which is fixed in the latest release.
If the program that writes the workspace.xml file did so by first deleting it, and then writing the new version, this could result in the assistant committing the deletion, which makes the new version a local, non-annexed file, and then if a pull is received that modified the file, I think the above bug could happen.
You could tell if this was the case by looking at the git log of the directory containing the file, and see if it has been repeatedly deleted and added back to the repository. The git log snippet you pasted unfortunately does not let me tell this information.