Re: [PATCH v7 13/17] ref-filter: add `:dir` and `:base` options for ref printing atoms
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 14, 2016, 19:51 UTC
- Message-ID
- <xmqqy40lx2k8.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAOLa=ZSFuq2+6xsrJ=CcXuOVbTnbDirbRtu7Fonfk+9EdRpbxg@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 16 quoted lines
>> - 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. > > $ ./git for-each-ref --format "%(refname)%(end) %(refname:dir)" > refs/heads/master refs/heads > refs/heads/ref-filter refs/heads > refs/remotes/junio/va/i18n refs/remotes/junio/va > > $ ./git for-each-ref refs/heads --format > "%(align:left,30)%(refname)%(end) %(refname:base)" > refs/heads/master heads > refs/heads/ref-filter heads > refs/remotes/junio/va/i18n remotes > > I guess this should clear it up.
Hmph.
I would guess from these examples that :dir is an equivalent to dirname(). But it is unclear how :base is defined. Is it the path component that comes immediately after "refs/" that appears at the beginning?