Please describe the problem.
Changing metadata while being in an active view will not update the view.
What steps will reproduce the problem?
(inside a repository)
Create a file
$ uuidgen >file
switch into a view
$ git annex view !blah $ ls file
changed the metadata the view is based upon
$ git annex metadata -t blah file $ ls file
It would be nice/expected that the view gets updated when the metadata changes, hiding 'file' now
What version of git-annex are you using? On what operating system?
git-annex version: 5.20141024~bpo70+1 on debian wheezy with backports
This might be worth adding. But, one of the ways views can be used is to use file operations to adjust the metadata that is being viewed.
So, when you delete a file from a view, and git commit, git-annex will remove the metadata that had made the file be in the view.
And, if you copy or move a file in a view to a different subdirectory, and add and git commit the change, the metadata will be updated to update the metadata to reflect the files new location.
As such, I see this as a wishlist todo item at best, and will move it from the bugs list to the todo list.
I'd also love to see the current view being updated to reflect the new metadata after committing. Workaround is currently to
git switch
back to the main branch and re-make the view withgit annex view bla='*'
.BTW views are really cool, what an awesome idea, joey!
Another time it would make sense to update the view is after git pull from elsewhere, which could change the metadata, or change the files present in the parent branch. I think it would make sense for
git-annex sync
run in a view to update the view after pulling.Updating the branch after
git-annex metadata
is run locally is of course also possible. There is a similarity to updating an adjusted branch after get/drop. Which has a config annex.adjustedbranchrefresh to tune how frequently to update the branch. Or the user could just rungit-annex sync --no-pull --no-push
themselves.There is probably a lot of scope for optimisation in updating the view branch, that might be able to get it reasonably quick. I have not fully thought through it, but basically diffing from the old parent branch to the new parent to find files that have changed, and adding/removing those from the view. And also diffing from the old git-annex branch tree to the new one to get changes to metadata logs, parsing those and using changes to metadata to also move/delete/add files to the view branch.
But it would be ok to start with a simple, slow implementation.
git-annex sync
when in a view branch will now update it.Leaving this open for optimising it.
Also because of this problem:
Looks like it should not be trying to merge the synced/master branch into the view branch. But, this makes me wonder, does the master branch get updated with new files pulled from remotes? If not, the view branch won't be updated to have them either.
Also, I think that it may try to import trees from importree special remotes, into the view branch. Perhaps those should also get imported but merged into the master branch...
thunar-plugins
. There I worked around it by having the Synchronize menu item dogit add -A;git commit -m ...;git annex sync --only-annex
, which works fine.I've now fixed
git-annex sync
's other behavior when ran in a view branch to be acceptable.I'm going to close this as fixed. But have opened faster incremental update of view branch by git-annex sync as the performance could be improved.
thunar-plugins
now detect git annex' support for this (checking ifview
appears ingit annex help sync
, which it didn't before) and doesgit annex sync
instead of thegit add -A;git commit;git annex sync --only-annex
workaround in that case. Very nice, joey!I'd recommend not relying on the
git-annex help sync
to detect this, since man pages may not be available. Look for '?=' ingit-annex view --help