Re: [PATCH] Documentation update for 'git branch --list'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 22, 2011, 18:04 UTC
- Message-ID
- <7vobw4doey.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4ECB43E4.7030607@lyx.org>
Vincent van Ravesteijn <vfr@lyx.org> writes:
Show 10 quoted lines
> Op 21-11-2011 18:37, Junio C Hamano schreef: > ... >> 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?
We don't, as that is inviting mistakes. "git branch vr/*" if you have a vr/ directory in your working tree may create vr/a branch from where the tip of vr/b points at by mistake.
The "--merged" option is an explicit clue that the user is not interested in creating new branch, and the string being a pattern is additional clue. The "--list" option was recently added for the explicit purpose of giving such a clue as safety measure.