* [PATCH] completion: fix PS1 display during a merge on detached HEAD
@ 2009-05-16 18:46 Junio C Hamano
2009-05-16 19:59 ` Shawn O. Pearce
0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2009-05-16 18:46 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
If your merge stops in a conflict while on a detached HEAD, recent
completion code fails to show anything. This was because various cases
added to support the operation-in-progress markers (e.g. REBASE, MERGING)
forgot that they need to set the variable "b" to something for the result
they computed to be displayed at all.
Probably not many people make trial merges on a detached HEAD (which is
tremendously useful feature of git, by the way), and that may be why this
was not noticed for a long time.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
contrib/completion/git-completion.bash | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ad26b7c..4462ef0 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -99,10 +99,10 @@ __git_ps1 ()
elif [ -d "$g/rebase-merge" ]; then
r="|REBASE-m"
b="$(cat "$g/rebase-merge/head-name")"
- elif [ -f "$g/MERGE_HEAD" ]; then
- r="|MERGING"
- b="$(git symbolic-ref HEAD 2>/dev/null)"
else
+ if [ -f "$g/MERGE_HEAD" ]; then
+ r="|MERGING"
+ fi
if [ -f "$g/BISECT_LOG" ]; then
r="|BISECTING"
fi
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] completion: fix PS1 display during a merge on detached HEAD
2009-05-16 18:46 [PATCH] completion: fix PS1 display during a merge on detached HEAD Junio C Hamano
@ 2009-05-16 19:59 ` Shawn O. Pearce
0 siblings, 0 replies; 2+ messages in thread
From: Shawn O. Pearce @ 2009-05-16 19:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano <gitster@pobox.com> wrote:
> If your merge stops in a conflict while on a detached HEAD, recent
> completion code fails to show anything. This was because various cases
> added to support the operation-in-progress markers (e.g. REBASE, MERGING)
> forgot that they need to set the variable "b" to something for the result
> they computed to be displayed at all.
>
> Probably not many people make trial merges on a detached HEAD (which is
> tremendously useful feature of git, by the way), and that may be why this
> was not noticed for a long time.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Yay, thanks Junio.
Trivially-Acked-By: Shawn O. Pearce <spearce@spearce.org>
:-)
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index ad26b7c..4462ef0 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -99,10 +99,10 @@ __git_ps1 ()
> elif [ -d "$g/rebase-merge" ]; then
> r="|REBASE-m"
> b="$(cat "$g/rebase-merge/head-name")"
> - elif [ -f "$g/MERGE_HEAD" ]; then
> - r="|MERGING"
> - b="$(git symbolic-ref HEAD 2>/dev/null)"
> else
> + if [ -f "$g/MERGE_HEAD" ]; then
> + r="|MERGING"
> + fi
> if [ -f "$g/BISECT_LOG" ]; then
> r="|BISECTING"
> fi
--
Shawn.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-16 19:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-16 18:46 [PATCH] completion: fix PS1 display during a merge on detached HEAD Junio C Hamano
2009-05-16 19:59 ` Shawn O. Pearce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).