Hi,
I accidentally changed some metadata tags for all annexed files in a directory (by omitting the filename to the git annex metadata call). How can I revert that change?
I tried a git reset --hard on the git-annex branch, but after checking out master and adding a new file the changes magically reappeared.
git-annex version: 5.20141125
To reproduce do:
git init; git annex init
echo Hi > a.txt; git annex add a.txt
git commit -m 'Initial add'
git annex metadata --set name=bla
git annex metadata --set name=blu
git checkout git-annex
git reset --hard HEAD^
git checkout master
git annex metadata a.txt # name=bla
echo Huch > b.txt; git annex add b.txt
git annex metadata a.txt # name=blu again
Cheers,
Markus
git-annex metadata
used to affect all files under the current directory if you left off the files to update. That changed a while ago to prevent that fairly common mistake, pity your git-annex is too old to have that fixed.You're on sort of the right track with the git-annex branch, but there are some complications:
git revert
)So, you can easily deal with #1; it wouldn't be hard to do #2, but #3 will be a real sticking point, if the bad data has been pushed out to any other repos.
In that case, the only thing to do is to record new information on the git-annex branch, so git-annex knows that even if this metadata was set before, it's not set any longer. The way to do that is just use
git annex metadata --set name-=bla