{"thread":{"id":"19510","subject":"[PATCH] completion: fix PS1 display during an AM on detached HEAD","startedAt":"2009-05-26T05:56:03Z","lastAt":"2009-05-26T05:56:03Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"114731","messageId":"7vy6skqufg.fsf@alter.siamese.dyndns.org","threadId":"19510","inReplyTo":null,"subject":"[PATCH] completion: fix PS1 display during an AM on detached HEAD","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-26T05:56:03Z","receivedAt":"2009-05-26T05:56:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is a companion patch to previous 8763dbb (completion: fix PS1 display\nduring a merge on detached HEAD, 2009-05-16).  While rebasing or running am\non a detached HEAD, the code failed to set $b (branch description) that\nenables the whole status display business.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n The original incorrectly indents the \"rebase-apply\" case, which gives\n the patch some \"Huh?\" effect, which this patch also fixes.\n\n contrib/completion/git-completion.bash |   24 +++++++++++-------------\n 1 files changed, 11 insertions(+), 13 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 0c8bb53..c84d765 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -84,26 +84,24 @@ __git_ps1 ()\n \tif [ -n \"$g\" ]; then\n \t\tlocal r\n \t\tlocal b\n-\t\tif [ -d \"$g/rebase-apply\" ]; then\n-\t\t\tif [ -f \"$g/rebase-apply/rebasing\" ]; then\n-\t\t\t\tr=\"|REBASE\"\n-\t\telif [ -f \"$g/rebase-apply/applying\" ]; then\n-\t\t\t\tr=\"|AM\"\n-\t\t\telse\n-\t\t\t\tr=\"|AM/REBASE\"\n-\t\t\tfi\n-\t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\t\telif [ -f \"$g/rebase-merge/interactive\" ]; then\n+\t\tif [ -f \"$g/rebase-merge/interactive\" ]; then\n \t\t\tr=\"|REBASE-i\"\n \t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\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\telse\n-\t\t\tif [ -f \"$g/MERGE_HEAD\" ]; then\n+\t\t\tif [ -d \"$g/rebase-apply\" ]; then\n+\t\t\t\tif [ -f \"$g/rebase-apply/rebasing\" ]; then\n+\t\t\t\t\tr=\"|REBASE\"\n+\t\t\t\telif [ -f \"$g/rebase-apply/applying\" ]; then\n+\t\t\t\t\tr=\"|AM\"\n+\t\t\t\telse\n+\t\t\t\t\tr=\"|AM/REBASE\"\n+\t\t\t\tfi\n+\t\t\telif [ -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\telif [ -f \"$g/BISECT_LOG\" ]; then\n \t\t\t\tr=\"|BISECTING\"\n \t\t\tfi\n \n-- \n1.6.3.1.169.g33fd7\n"}]}