Karthik Nayak <karthik....@gmail.com> writes:

>>> diff --git a/Documentation/git-for-each-ref.txt 
>>> b/Documentation/git-for-each-ref.txt
>>> index 600b703..f4ad297 100644
>>> --- a/Documentation/git-for-each-ref.txt
>>> +++ b/Documentation/git-for-each-ref.txt
>>> @@ -96,7 +96,9 @@ refname::
>>>         slash-separated path components from the front of the refname
>>>         (e.g., `%(refname:strip=2)` turns `refs/tags/foo` into `foo`.
>>>         `<N>` must be a positive integer.  If a displayed ref has fewer
>>> -       components than `<N>`, the command aborts with an error.
>>> +       components than `<N>`, the command aborts with an error. For the 
>>> base
>>> +       directory of the ref (i.e. foo in refs/foo/bar/boz) append
>>> +       `:base`. For the entire directory path append `:dir`.

Sorry that I missed this so far and I do not know how many recent
rerolls had them like this, but I am not sure about these :base and
:dir suffixes.  From their names I think readers would expect that
they do rough equivalents to basename() and dirname() applied to the
refname, but the example contradicts with that intuition.  The
result of applying basename() to 'refs/boo/bar/boz' would be 'boz'
and not 'foo' as the example says.

So assuming that :base and :dir are unrelated to basename() and
dirname():

 - I think calling these :base and :dir may be misleading

 - More importantly, what do these do?  I do not think of a good
   description that generalizes "base of refs/foo/bar/boz is foo" to
   explain your :base.

 - A :dir that corresponds to the :base that picks 'foo' from
   'refs/foo/bar/boz' needs an example, too.

Or is the above example simply a typo?  Is refs/foo/bar/boz:base
'boz', not 'foo'?



Reply via email to