On Mon, Sep 1, 2008 at 15:15, SZEDER Gábor <szeder@xxxxxxxxxx> wrote:> Hi,>> On Sun, Aug 31, 2008 at 02:41:07PM +0200, Bert Wesarg wrote:>> This strips from the refname the common directory prefix with the>> matched pattern.>>>> This is particular usefull for bash completion, to get refs without>> `refs/heads` or `refs/tags`.>>> refname::>> The name of the ref (the part after $GIT_DIR/).>> + For a short name of the ref append `:short`. This will strip>> + the common directory prefix with the pattern which matches this ref.>> + I.e. for a the pattern `refs/heads` you get `master`, or for>> + `refs/tags/v1.5.[01].*` you get `v1.5.[01].*`.>> + This is particular usefull for bash completion.> Should this last sentence really belong to the documentation?At least it is not the only example in the documentation. >> Furthermore, I think ':strip' better describes what this format> actually does. Even you have used the word 'strip' in the commit> message and in the documentation as well.True, I'm ok with this proposal. >>> As far as bash completion is concerned, I'm for it, as it does exactly> what the completion script needs to perform better, it doesn't have> those conceptual issues 'refbasename' has, and it's only a tad slower> than 'refbasename'.>> However, if we consider possible use cases other than bash completion,> I don't know which one is more useful. For example, if you have two> branches 'foo/bar' and 'foo/baz', then 'git merge $(git for-each-ref> --format=%(refbasename) refs/heads/foo)' will work as expected, but> 'refname:short' not, as it will output only 'bar' and 'baz' which 'git> merge' can not find.Yeah, thats an disadvantage and I thought about this, too. But I haveno particular opinion about it. Regards,Bert > Best,> Gábor��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�m