public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Thomas Rast <tr@thomasrast•ch>
To: Heikki Hokkanen <hoxu@users•sf.net>
Cc: Johannes Sixt <j6t@kdbg•org>, git@vger•kernel.org, szeder@ira•uka.de
Subject: Re: [PATCH] bash prompt: add option to disable for a repository
Date: Tue, 26 Nov 2013 09:40:42 +0100	[thread overview]
Message-ID: <87li0b1rp1.fsf@thomasrast.ch> (raw)
In-Reply-To: <CAOpY_XvN9GJw592MpbcZZ2hzUvSvTHNLebwMmQBK+N-Ez4xM_Q@mail.gmail.com> (Heikki Hokkanen's message of "Sat, 23 Nov 2013 18:31:52 +0200")

Heikki Hokkanen <hoxu@users•sf.net> writes:

> 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

  parent reply	other threads:[~2013-11-26  8:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-23 13:18 [PATCH] bash prompt: add option to disable for a repository Heikki Hokkanen
2013-11-23 14:42 ` Johannes Sixt
2013-11-23 16:31   ` Heikki Hokkanen
2013-11-25 23:43     ` Jonathan Nieder
2013-11-26  0:26       ` SZEDER Gábor
2013-11-26  7:01       ` Johannes Sixt
2013-11-26  8:40     ` Thomas Rast [this message]
2013-11-23 16:35 ` SZEDER Gábor
2013-11-25 16:38   ` Heikki Hokkanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87li0b1rp1.fsf@thomasrast.ch \
    --to=tr@thomasrast$(echo .)ch \
    --cc=git@vger$(echo .)kernel.org \
    --cc=hoxu@users$(echo .)sf.net \
    --cc=j6t@kdbg$(echo .)org \
    --cc=szeder@ira$(echo .)uka.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox