From: Vincent van Ravesteijn Date: Tue, 22 Nov 2011 06:40:36 GMT Subject: Re: [PATCH] Documentation update for 'git branch --list' Message-ID: <4ECB43E4.7030607@lyx.org> In-Reply-To: <7v7h2tgyw6.fsf@alter.siamese.dyndns.org> Op 21-11-2011 18:37, Junio C Hamano schreef: > Vincent van Ravesteijn writes: > >> Indicate that the... argument is only valid when using --list. >> Otherwise a branch with the name 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 ' and 'git branch --list '. 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