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

Re: [PATCH 4/4] branch: add '--show-description' option

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jan 2, 2018, 10:39 UTC
Message-ID
<CAM0VKjm0WMDm_AETogX7ygMgeqY28YQLJLoM+dxtkfQfnT3aww@mail.gmail.com>
In-Reply-To
<CAPig+cQ=Fj-sWrxDH1RV=PnYT01LGapzJjrRT5QdqUTkyc0rfg@mail.gmail.com>
On Tue, Jan 2, 2018 at 6:17 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Mon, Jan 1, 2018 at 5:54 PM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
> s/exit/exist/
Thanks.
Show 20 quoted lines
>>     query does).
>>
>> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
>> ---
>> diff --git a/builtin/branch.c b/builtin/branch.c
>> @@ -737,6 +741,35 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
>> +       } else if (show_description) {
>> +               [...]
>> +               if (!argc) {
>> +                       if (filter.detached)
>> +                               die(_("cannot show description on detached HEAD"));
>> +                       branch_name = head;
>> +               } else if (argc == 1)
>> +                       branch_name = argv[0];
>> +               else
>> +                       die(_("cannot show description of more than one branch"));
>
> Aside from paralleling the single branch accepted by
> --edit-description, why this limitation? (Just curious; I don't feel
> strongly one way or the other.)

It's not just '--edit-description', most other options won't accept multiple branches either. As far as I can tell only deleting branches can deal with multiple branches in one go.

Furthermore, branch descriptions are likely more lines long, so we can't just dump them one after the other, but we we would have to separate the descriptions of different branches in the output. Considering that 'git branch' mostly works only with a single branch at a time, I didn't feel the need to do so.

Gábor
Previous: Eric SunshineNext: Johannes Sixt
Message 5 of 10 in “branch: add '--show-description' option”
  1. 0/4 branch: add '--show-description' optionSZEDER Gábor, Jan 1, 2018
  2. 2/4 t3200: fix a misindented lineSZEDER Gábor, Jan 1, 2018
  3. 4/4 branch: add '--show-description' optionSZEDER Gábor, Jan 1, 2018
  4. Eric SunshineJan 2, 2018
  5. SZEDER GáborJan 2, 2018
  6. Johannes SixtJan 2, 2018
  7. SZEDER GáborJan 2, 2018
  8. SZEDER GáborJan 2, 2018
  9. 3/4 t3200: restore branch after "unborn --edit-description" testSZEDER Gábor, Jan 1, 2018
  10. 1/4 branch: '--edit-description' is incompatible with other optionsSZEDER Gábor, Jan 1, 2018

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.