Re: [RFC/PATCH] shortstatus v1
- From
Sitaram Chamarty <sitaramc@gmail.com>
- Date
- Feb 10, 2009, 03:46 UTC
- Message-ID
- <slrngp1u4h.i22.sitaramc@sitaramc.homelinux.net>
- In-Reply-To
- <7vr627qd4p.fsf@gitster.siamese.dyndns.org>
On 2009-02-10, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Tuncer Ayaz <tuncer.ayaz@gmail.com> writes: > >> Adding git 'shortstatus --mini' to PS1 is not noticeable or 1sec >> maximum in my tree. As a worst case it takes 10secs in a clone >> of WebKit.git. > > Frankly, I think having to spend one second to add only one or two bits to > PS1 is simply spending one second too much.
[snip]
> Do you really need more than "diff-index --cached --exit-code" in your > $PS1 code, and so why? Does the added feature your "shortstatus --mini" > offers over "diff-index --cached --exit-code" justify the latency penalty > to the user?
I wonder if I could ask people opinions on a trick I pulled, which is basically maintain a state of the value of $SECONDS each time the user is shown a bash prompt. If the value is the same as last time (meaning he hit enter twice in a row very quickly), it runs the extra stuff.
It sounds like a dirty trick, but seems to work fine and give you the best of both worlds.