From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] completion: fix PS1 display during a merge on detached HEAD
Date: Sat, 16 May 2009 12:59:47 -0700 [thread overview]
Message-ID: <20090516195947.GI30527@spearce.org> (raw)
In-Reply-To: <7vzldcnawx.fsf@alter.siamese.dyndns.org>
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.
prev parent reply other threads:[~2009-05-16 19:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=20090516195947.GI30527@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).