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

bash-completion now loads completions dynamically, so __git_ps1 is not defined when you open a shell

From
KSKerrick Staley <mail@kerrickstaley.com>
Date
Mar 28, 2012, 20:27 UTC
Message-ID
<CANaWP3wu3260uFNzCLJ=YSG1BWFr=ge_6CmMGrG6zLThvFnjcQ@mail.gmail.com>

The __git_ps1 function is defined in same script that defines Git's tab completions (contrib/completion/git-completion.bash). Since bash-completion loads completions on-the-fly in newer versions, the __git_ps1 function isn't immediately available in a new shell. How should this be handled? Should users just source git-completion.bash before they redefine $PS1?

-Kerrick Staley
Next: Junio C Hamano
Message 1 of 8 in “bash-completion now loads completions dynamically, so __git_ps1 is not defined when you open a shell”
  1. Kerrick StaleyMar 28, 2012
  2. Junio C HamanoMar 28, 2012
  3. Jeff KingMar 29, 2012
  4. Jonathan NiederMar 28, 2012
  5. Kerrick StaleyMar 29, 2012
  6. Jeff KingMar 29, 2012
  7. Felipe ContrerasApr 7, 2012
  8. Jonathan NiederApr 7, 2012

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.