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

Re: [PATCH] branch: description for non-existent branch errors

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 28, 2022, 17:50 UTC
Message-ID
<xmqqzgejtmkd.fsf@gitster.g>
In-Reply-To
<xmqqedvw1mmu.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Rubén Justo <rjusto@gmail.com> writes:
>
>> I pointed out in the first mail of this thread, there is already a patch in
>> 'seen' that touches builtin/branch.c [1].  I would like to keep the patches
>> separated, but I don't know how to proceed: make the change from 'seen', keep
>> it from 'master'... Maybe you can give me some guidance in this.
>
> I do not see much problem in keeping them separated.  My trial merge
> of the result of applying this patch on top of 'master', with the
> other topic that has the "branch description for nth prior checkout"
> patch does show a minor textual conflict, but the resolution does
> not look too bad.
>
> Check near the topic branch of 'seen' after I push out today's
> integration result in a few hours and see if they look reasonable.
>
> Thanks.

Ah, I forgot to mention. As to the error messages that begin with a capital letter, to be consistent with violating messages that are already there in builtin/branch.c, let's keep them as they are in your patch. We can and should clean them up later, perhaps soon after the patch under discussion matures, but I agree with you that it can be left outside the scope of this patch.

But stepping back a bit, in the longer term, we might want to change the behaviour of "git branch --edit-description", at least when no branch is specified on the command line and we are on an unborn branch. It is merely the matter of setting a variable in the configuration file, so there may not be a strong reason to forbid

    $ git init trash
    $ cd trash
    $ git branch --edit-description
    $ git commit --allow-empty -m initial
while allowing the same sequence with the last two commands reversed.

After all, renaming a branch with "branch -m" does not to require an existing ref that points at a commit, i.e.

    $ git init -b master trash
    $ cd trash
    $ git config branch.master.description "describes master"
    $ git branch -m master main

does work fine and you end up with branch.main.description at the end.

Previous: Junio C HamanoNext: Rubén Justo
Message 7 of 16 in “branch: description for non-existent branch errors”
  1. branch: description for non-existent branch errorsRubén Justo, Sep 22, 2022
  2. branch: description for non-existent branch errorsRubén Justo, Sep 24, 2022
  3. Junio C HamanoSep 26, 2022
  4. Rubén JustoSep 26, 2022
  5. Junio C HamanoSep 27, 2022
  6. Junio C HamanoSep 28, 2022
  7. Junio C HamanoSep 28, 2022
  8. Rubén JustoSep 28, 2022
  9. Junio C HamanoSep 29, 2022
  10. branch: description for non-existent branch errorsRubén Justo, Sep 30, 2022
  11. Bagas SanjayaOct 1, 2022
  12. Rubén JustoOct 2, 2022
  13. branch: description for non-existent branch errorsRubén Justo, Oct 8, 2022
  14. Eric SunshineOct 8, 2022
  15. Rubén JustoOct 8, 2022
  16. Junio C HamanoOct 9, 2022

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.