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

Re: [PATCH 3/3] git-prompt: add quiet upstream indicator option

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 20, 2025, 18:05 UTC
Message-ID
<CAPig+cTpDdTceBSYoVRBS7wKoSxURMeTA7TruiAmjgTX4B=m5w@mail.gmail.com>
In-Reply-To
<CALnO6CBzE-+51LfgjpEv665oG6kZG9_4YZTv8qgqtNrhh+a-Bw@mail.gmail.com>
On Thu, Nov 20, 2025 at 11:10 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
Show 12 quoted lines
> On Sat, Nov 15, 2025 at 1:55 PM Kiril Ivanov via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> > diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
> > @@ -275,6 +279,8 @@ __git_ps1_show_upstream ()
> >                 "0      0") # equal to upstream
> > +                       [ "$quiet" ] &&
> > +                       upstream="|u" ||
> >                         upstream="|u=" ;;
> >                 "0      "*) # ahead of upstream
> >                         upstream="|u+${count#0  }" ;;
>
> Our coding style also prefers "test" to "[".

In this bash-specific script, the normal project coding style is relaxed and `[` is used regularly, far more so than `test`, so use of `[` here is appropriate and consistent with surrounding code.

Previous: D. Ben KnobleNext: D. Ben Knoble
Message 6 of 10 in “git-prompt: add quiet upstream indicator option”
  1. 0/3 git-prompt: add quiet upstream indicator optionKiril Ivanov via GitGitGadget, Nov 15, 2025
  2. 1/3 t9903: shorten setup using test_commitKiril Ivanov via GitGitGadget, Nov 15, 2025
  3. 2/3 t9903: add upstream indicator testsKiril Ivanov via GitGitGadget, Nov 15, 2025
  4. 3/3 git-prompt: add quiet upstream indicator optionKiril Ivanov via GitGitGadget, Nov 15, 2025
  5. D. Ben KnobleNov 20, 2025
  6. Eric SunshineNov 20, 2025
  7. D. Ben KnobleNov 20, 2025
  8. Junio C HamanoNov 15, 2025
  9. Kiril IvanovNov 16, 2025
  10. Junio C HamanoNov 16, 2025

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.