Re: [PATCH] Showing stash state in bash prompt
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- May 14, 2009, 18:24 UTC
- Message-ID
- <200905142025.02592.trast@student.ethz.ch>
- In-Reply-To
- <7v4ovo4xyt.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Daniel Trstenjak <Daniel.Trstenjak@science-computing.de> writes: > > > Showing stash state in bash prompt.
[...]
> Subject: [PATCH] completion: show presense of stashed changes > > Users often forget that there are stashed changes that want to be > unstashed. Add a '$' in the prompt string to remind them.
I'd hate to see this go in without any sort of configurability, since I would have to patch it out again for my own builds.
The way git-stash is currently documented teaches a stash/apply workflow, in which pop is not used at all. For example, in git-stash.txt itself, the description of 'apply' has all the meat while 'pop' just refers to 'apply'. In user-manual.txt, there is an example that teaches stash/apply.
This may historically be because 'git stash pop' was added later on:
bd56ff5 (git-stash: add new 'pop' subcommand, 2008-02-22) f2c66ed (Add git-stash script, 2007-06-30)
But IMHO it would not be a good idea to teach people stash/pop anyway: 'stash drop' is irreversible, because the stash is itself implemented through the reflog and thus not guarded by one.
And unfortunately, for people who use stash/apply instead of stash/pop (including me :-), the proposed indicator merely shows if they have ever used stash in the current repository.
--
Thomas Rast
trast@{inf,student}.ethz.ch