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

Re: [PATCH 0/4] In PS1 prompt, make upstream state indicators consistent with other state indicators

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 25, 2022, 12:22 UTC
Message-ID
<220225.86czjb874f.gmgdl@evledraar.gmail.com>
In-Reply-To
<pull.1162.git.1645789446.gitgitgadget@gmail.com>
On Fri, Feb 25 2022, Justin Donnelly via GitGitGadget wrote:
I couldn't find any glaring issues here on a quick review, just a note.
Show 7 quoted lines
> These patches are about the characters and words that can be configured to
> display in the PS1 prompt after the branch name. I've been unable to find a
> consistent terminology. I refer to them as follows: [short | long] [type]
> state indicator where short is for characters (e.g. ?), long is for words
> (e.g. |SPARSE), and type is the type of indicator (e.g. sparse or upstream).
> I'd be happy to change the commit messages to a different terminology if
> that's preferred.

I think that terminology is correct, in case you haven't seen it git-for-each-ref(1) talks about the "short" here as "short", "trackshort" etc.

Show 12 quoted lines
> There are a few inconsistencies with the PS1 prompt upstream state indicator
> (GIT_PS1_SHOWUPSTREAM).
>
>  * With GIT_PS1_SHOWUPSTREAM="auto", if there are no other short state
>    indicators (e.g. + for staged changes, $ for stashed changes, etc.), the
>    upstream state indicator appears adjacent to the branch name (e.g.
>    (main=)) instead of being separated by SP or GIT_PS1_STATESEPARATOR (e.g.
>    (main =)).
>  * If there are long state indicators (e.g. |SPARSE), a short upstream state
>    indicator (i.e. GIT_PS1_SHOWUPSTREAM="auto") is to the right of the long
>    state indicator (e.g. (main +|SPARSE=)) instead of with the other short
>    state indicators (e.g. (main +=|SPARSE)).

I think it would really help to in each commit message have a before/after comparison of the relevant PS1 output that's being changed.

I'm not sure how to readthis example. So before we said "main +=|SPARSE" but now we'll say "main +|SPARSE=", but without sparse we'll say "main="?

Aren't both of those harder to read than they need to be, shouldn't it be closer to:

    main= |SPARSE
Or:
    main= |+SPARSE
Or:
    main= +|SPARSE
I can't recall what the "+" there is (if any).

I.e. the "=" refers to the ahead/behind state of "main, it seems odd in both versions of your example that we're splitting it off from "main" because we have "SPARSE" too.

But maybe I'm missing something...
Previous: Justin Donnelly via GitGitGadgetNext: Justin Donnelly
Message 6 of 15 in “In PS1 prompt, make upstream state indicators consistent with other state indicators”
  1. 0/4 In PS1 prompt, make upstream state indicators consistent with other state indicatorsJustin Donnelly via GitGitGadget, Feb 25, 2022
  2. 1/4 git-prompt: rename `upstream` to `upstream_type`Justin Donnelly via GitGitGadget, Feb 25, 2022
  3. 3/4 git-prompt: make long upstream state indicator consistentJustin Donnelly via GitGitGadget, Feb 25, 2022
  4. 2/4 git-prompt: make upstream state indicator location consistentJustin Donnelly via GitGitGadget, Feb 25, 2022
  5. 4/4 git-prompt: put upstream comments togetherJustin Donnelly via GitGitGadget, Feb 25, 2022
  6. Ævar Arnfjörð BjarmasonFeb 25, 2022
  7. Justin DonnellyFeb 27, 2022
  8. Ævar Arnfjörð BjarmasonFeb 27, 2022
  9. 0/4 In PS1 prompt, make upstream state indicators consistent with other state indicatorsJustin Donnelly via GitGitGadget, Feb 27, 2022
  10. 1/4 git-prompt: rename `upstream` to `upstream_type`Justin Donnelly via GitGitGadget, Feb 27, 2022
  11. 2/4 git-prompt: make upstream state indicator location consistentJustin Donnelly via GitGitGadget, Feb 27, 2022
  12. 3/4 git-prompt: make long upstream state indicator consistentJustin Donnelly via GitGitGadget, Feb 27, 2022
  13. 4/4 git-prompt: put upstream comments togetherJustin Donnelly via GitGitGadget, Feb 27, 2022
  14. Ævar Arnfjörð BjarmasonMar 22, 2022
  15. Junio C HamanoMar 23, 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.