Re: [RFC/PATCH 1/2] for-each-ref: add new format 'refbasename'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 29, 2008 at 12:37, SZEDER Gábor <szeder@xxxxxxxxxx> wrote:> fot-each-ref's refname format outputs each ref in its full format, e.g.> 'refs/heads/foo' and 'refs/tags/bar'.  However, there are tools that> need only the last part of the refname, e.g. only 'foo' and 'bar'.  Such> a tool is git's bash completion script, which spends considerable amount> of time removing the unneeded parts from for-each-ref's output.>> Therefore, we introduce a new for-each-ref format called 'refbasename',> which strips everything before and including the second '/' in the ref's> name from the output.
Why not strip the pattern (given on the command line) from therefname? I.e. with a new format 'refshort' a 'git for-each-ref--format=%(refshort) refs/heads/' would strip off the refs/heads/ fromeach ref.
This should also work for multiple patterns (refs/heads/ refs/tags/)and for patterns which needs a fnmatch call (which has theFNM_PATHNAME option).
The bash completion script calls for-each-ref always with patterns.
Bert��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�m


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux