Hello!
In relation to the description of --used-refspec
in the docs https://git-annex.branchable.com/git-annex-unused/
I was wondering why it is possible to add a positive refspec without the full path of the ref e.g.
git annex unused --used-refspec +master
while for exclusions (negative refspec) it seems to be necessary to specify the full path, e.g.
git annex unused --used-refspec '+*:-refs/heads/master'
or globbing:
git annex unused --used-refspec '+*:-*master'
I guess the negative form of
Each + without a glob adds the literal value to the set. For example, "+HEAD^" adds "HEAD^".
is actually (intentionally) missing. If so, this might be worth noting in the docs.
It matches against the literal text of the ref that was added, so if you use "+*", it adds refs/heads/master, and then to remove that, you need "-refs/heads/master" not "-master". On the other hand, "+master:-master" results in "master" being added and then removed.
Clarified to mention that it matches by name; I suppose perhaps you were thinking it matches based on what sha1 the ref name resolves to. The reason it doesn't do that is that it would be surprising for "+foo:-master" to not include ref foo just because it happens to currently have the same sha1 as master does.