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

Re: [PATCH] bash prompt: add option to disable for a repository

From
Thomas Rast <tr@thomasrast.ch>
Date
Nov 26, 2013, 08:40 UTC
Message-ID
<87li0b1rp1.fsf@thomasrast.ch>
In-Reply-To
<CAOpY_XvN9GJw592MpbcZZ2hzUvSvTHNLebwMmQBK+N-Ez4xM_Q@mail.gmail.com>
Heikki Hokkanen <hoxu@users.sf.net> writes:
Show 17 quoted lines
> On Sat, Nov 23, 2013 at 4:42 PM, Johannes Sixt <j6t@kdbg.org> wrote:
>> Gah! This adds a fork+exec each time the prompt is shown. Not good,
>> particularly on Windows.
>>
>> Since your intent is to disable the prompt in the home directory,
>> wouldn't that mean that most of the time you *don't* want the prompt?
>> Wouldn't you be better served with a method that *turns on* the prompt?
>> For example, a shell function that sets PS1 and another one that unsets
>> it? Or a wrapper that inspects a shell variable and calls __git_ps1 only
>> when you want a prompt.
>
> Actually, I do want the prompt for all other git repositories. The
> problem with $HOME is that it's the default directory after logging in
> or opening a terminal, so if you have git prompt sourced and your
> $HOME under git, you get an unbearable delay every time you open a
> terminal, or type a command, anywhere, except for a separate git
> repository.

Umm... is __git_ps1 by itself so slow that you find it unbearable, or is it the worktree status discovery? Because the latter can already be controlled per repository via bash.showUntrackedFiles and bash.showUpstream.

-- 
Thomas Rast
tr@thomasrast.ch
Previous: Johannes SixtNext: SZEDER Gábor
Message 7 of 9 in “bash prompt: add option to disable for a repository”
  1. bash prompt: add option to disable for a repositoryHeikki Hokkanen, Nov 23, 2013
  2. Johannes SixtNov 23, 2013
  3. Heikki HokkanenNov 23, 2013
  4. Jonathan NiederNov 25, 2013
  5. SZEDER GáborNov 26, 2013
  6. Johannes SixtNov 26, 2013
  7. Thomas RastNov 26, 2013
  8. SZEDER GáborNov 23, 2013
  9. Heikki HokkanenNov 25, 2013

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.