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

Re: [PATCH] branch doc: Change `git branch <pattern>` to use `<branchname>`

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 23, 2017, 21:07 UTC
Message-ID
<CACBZZX7vW0TkbrBvLvKWnY=UpHNHzzQ7wuwhEhNOjCCjzPVMjA@mail.gmail.com>
In-Reply-To
<xmqq1stoexmb.fsf@gitster.mtv.corp.google.com>
On Thu, Mar 23, 2017 at 6:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 32 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Change an example for `git branch <pattern>` to say `git branch
>> <branchname>` to be consistent with the synopsis. This changes
>> documentation added in d8d33736b5 ("branch: allow pattern arguments",
>> 2011-08-28).
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>>  Documentation/git-branch.txt | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
>> index 092f1bcf9f..e65e5c0dee 100644
>> --- a/Documentation/git-branch.txt
>> +++ b/Documentation/git-branch.txt
>> @@ -142,7 +142,7 @@ This option is only applicable in non-verbose mode.
>>       List both remote-tracking branches and local branches.
>>
>>  --list::
>> -     Activate the list mode. `git branch <pattern>` would try to create a branch,
>> +     Activate the list mode. `git branch <branchname>` would try to create a branch,
>>       use `git branch --list <pattern>` to list matching branches.
>
> This makes the description more correct.
>
> I am not sure if it makes that much sense to have that sentence here
> in the first place (after all, it is describing a behaviour of a
> mode that is *not* the list mode), but I guess that it may be a
> common mistake to forget to specify "-l" while asking for branches
> that match the pattern?  If we were writing this today from scratch,
> I would perhaps write something entirely different, e.g.

I'm just doing s/pattern/branchname/ on the existing documentation. If you'd like to entirely reword this to make that unnecessary that sounds good, but makes sense that you then submit that patch & just drop this one, rather than me copy/pasting your proposal, sending that as my own patch etc...

Show 7 quoted lines
>         --list::
>                 List branches.  With optional <pattern>... at the
>                 end of the command line, list only the branches that
>                 match any of the given patterns.  Do not forget '-l'
>                 and say "git branch <pattern>", as it will instead
>                 try to create a new branch whose name is <pattern>,
>                 which is a common mistake.

I like the old one better. It has 3 actual command examples you can readily see. This turns that into more prose that requires the reader to mentally parse most of it and mentally insert the mentioned command line switches into the equivalent of those 3 examples we just provided before.

> though.
>
> Thanks.
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 10 in “branch doc: Change `git branch <pattern>` to use `<branchname>`”
  1. branch doc: Change `git branch <pattern>` to use `<branchname>`Ævar Arnfjörð Bjarmason, Mar 23, 2017
  2. Junio C HamanoMar 23, 2017
  3. Ramsay JonesMar 23, 2017
  4. Junio C HamanoMar 23, 2017
  5. Ævar Arnfjörð BjarmasonMar 23, 2017
  6. Junio C HamanoMar 23, 2017
  7. Jonathan NiederMar 24, 2017
  8. branch doc: update description for `--list`Junio C Hamano, Mar 24, 2017
  9. Jonathan NiederMar 24, 2017
  10. Ævar Arnfjörð BjarmasonMar 24, 2017

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.