{"thread":{"id":"19385","subject":"[PATCH] completion: fix PS1 display during a merge on detached HEAD","startedAt":"2009-05-16T18:46:22Z","lastAt":"2009-05-16T19:59:47Z","messageCount":2,"participants":["Junio C Hamano","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"114111","messageId":"7vzldcnawx.fsf@alter.siamese.dyndns.org","threadId":"19385","inReplyTo":null,"subject":"[PATCH] completion: fix PS1 display during a merge on detached HEAD","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-16T18:46:22Z","receivedAt":"2009-05-16T18:46:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"If your merge stops in a conflict while on a detached HEAD, recent\ncompletion code fails to show anything.  This was because various cases\nadded to support the operation-in-progress markers (e.g. REBASE, MERGING)\nforgot that they need to set the variable \"b\" to something for the result\nthey computed to be displayed at all.\n\nProbably not many people make trial merges on a detached HEAD (which is\ntremendously useful feature of git, by the way), and that may be why this\nwas not noticed for a long time.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n contrib/completion/git-completion.bash |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex ad26b7c..4462ef0 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -99,10 +99,10 @@ __git_ps1 ()\n \t\telif [ -d \"$g/rebase-merge\" ]; then\n \t\t\tr=\"|REBASE-m\"\n \t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n-\t\telif [ -f \"$g/MERGE_HEAD\" ]; then\n-\t\t\tr=\"|MERGING\"\n-\t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n \t\telse\n+\t\t\tif [ -f \"$g/MERGE_HEAD\" ]; then\n+\t\t\t\tr=\"|MERGING\"\n+\t\t\tfi\n \t\t\tif [ -f \"$g/BISECT_LOG\" ]; then\n \t\t\t\tr=\"|BISECTING\"\n \t\t\tfi\n"},{"id":"114119","messageId":"20090516195947.GI30527@spearce.org","threadId":"19385","inReplyTo":"7vzldcnawx.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] completion: fix PS1 display during a merge on detached HEAD","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-16T19:59:47Z","receivedAt":"2009-05-16T19:59:47Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> If your merge stops in a conflict while on a detached HEAD, recent\n> completion code fails to show anything.  This was because various cases\n> added to support the operation-in-progress markers (e.g. REBASE, MERGING)\n> forgot that they need to set the variable \"b\" to something for the result\n> they computed to be displayed at all.\n> \n> Probably not many people make trial merges on a detached HEAD (which is\n> tremendously useful feature of git, by the way), and that may be why this\n> was not noticed for a long time.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nYay, thanks Junio.\n\nTrivially-Acked-By: Shawn O. Pearce <spearce@spearce.org>\n\n\n:-)\n\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index ad26b7c..4462ef0 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -99,10 +99,10 @@ __git_ps1 ()\n>  \t\telif [ -d \"$g/rebase-merge\" ]; then\n>  \t\t\tr=\"|REBASE-m\"\n>  \t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n> -\t\telif [ -f \"$g/MERGE_HEAD\" ]; then\n> -\t\t\tr=\"|MERGING\"\n> -\t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n>  \t\telse\n> +\t\t\tif [ -f \"$g/MERGE_HEAD\" ]; then\n> +\t\t\t\tr=\"|MERGING\"\n> +\t\t\tfi\n>  \t\t\tif [ -f \"$g/BISECT_LOG\" ]; then\n>  \t\t\t\tr=\"|BISECTING\"\n>  \t\t\tfi\n\n-- \nShawn.\n"}]}