All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent van Ravesteijn <vfr@lyx.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, git@drmicha.warpmail.net
Subject: Re: [PATCH] Documentation update for 'git branch --list'
Date: Tue, 22 Nov 2011 07:40:36 +0100	[thread overview]
Message-ID: <4ECB43E4.7030607@lyx.org> (raw)
In-Reply-To: <7v7h2tgyw6.fsf@alter.siamese.dyndns.org>

Op 21-11-2011 18:37, Junio C Hamano schreef:
> Vincent van Ravesteijn<vfr@lyx.org>  writes:
>
>> Indicate that the<pattern>... argument is only valid when using --list.
>> Otherwise a branch with the name<pattern>  will be created.
> I actually think there are some bugs in the implementation along that line
> and the way forward is to fix the implementation, instead of documenting
> the buggy behaviour.
>
> It is natural to expect "git branch --merged pu vr/\*" to list branches
> that are contained in 'pu' whose names match the given pattern, but it
> seems to try creating a branch called "vr/*" and fails, for example.

If this is what you naturally would expect, I would expect the following 
"git branch vr/*" to work as well.

What would you say if we try to interpret the argument as a pattern when 
the argument is not a valid ref name ? This includes all arguments 
containing '*'. In case of confusion we can demand the "--list" 
parameter to make clear what we mean.

Another thing is noticed is that the pattern use is different for 'git 
for-each-ref <pattern...>' and 'git branch --list <pattern...>'.

Two examples:

> c:\Users\Vincent\Documents\git\git>git for-each-ref refs/heads/
> f56ef114eeefee755f422e6cbef2d83974cb90f1 commit refs/heads/master
> c2ee0c73bcb4d1980e5d0bb0d20912b565d8ae38 commit refs/heads/next
> e341d009b2e0374520ac72973c6e98d315218624 commit refs/heads/pu
> 5fd37a7da3df644a85887051ae36117c732d1781 commit refs/heads/vr/fix-crashes
> cec815158934d82cdef815ea1342be2c3edbc5c8 commit 
> refs/heads/vr/msvc-compile-fix
> 777963bd4a9f41ac3eae8de2a7b7177917d127e6 commit 
> refs/heads/vr/msvc-compile-fix-poll
>
> c:\Users\Vincent\Documents\git\git>git branch --list refs/heads/
>
> c:\Users\Vincent\Documents\git\git>

and

> c:\Users\Vincent\Documents\git\git>git branch --list v*
>   vr/fix-crashes
>   vr/msvc-compile-fix
>   vr/msvc-compile-fix-poll
>
> c:\Users\Vincent\Documents\git\git>git for-each-ref v*
>
> c:\Users\Vincent\Documents\git\git>


Vincent

  reply	other threads:[~2011-11-22  6:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 14:33 [PATCH] Documentation update for 'git branch --list' Vincent van Ravesteijn
2011-11-21 15:00 ` Vincent van Ravesteijn
2011-11-21 17:37 ` Junio C Hamano
2011-11-22  6:40   ` Vincent van Ravesteijn [this message]
2011-11-22 18:04     ` Junio C Hamano
2011-11-30  5:54       ` Vincent van Ravesteijn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ECB43E4.7030607@lyx.org \
    --to=vfr@lyx.org \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.