git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Vincent van RavesteijnNext: Vincent van Ravesteijn
Message 5 of 6 in “Documentation update for 'git branch --list'”
  1. Documentation update for 'git branch --list'Vincent van Ravesteijn, Nov 21, 2011
  2. Vincent van RavesteijnNov 21, 2011
  3. Junio C HamanoNov 21, 2011
  4. Vincent van RavesteijnNov 22, 2011
  5. Junio C HamanoNov 22, 2011
  6. Vincent van RavesteijnNov 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.