{"thread":{"id":"27162","subject":"[PATCH] contrib/completion: remove parentheses from prompt","startedAt":"2011-04-22T19:32:48Z","lastAt":"2011-04-22T23:43:34Z","messageCount":3,"participants":["Kim Phillips","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"166228","messageId":"20110422143248.1f4f84c0.kim.phillips@freescale.com","threadId":"27162","inReplyTo":null,"subject":"[PATCH] contrib/completion: remove parentheses from prompt","fromName":"Kim Phillips","fromEmail":"kim.phillips@freescale.com","sentAt":"2011-04-22T19:32:48Z","receivedAt":"2011-04-22T19:32:48Z","isPatch":true,"sender":{"key":"kim.phillips@freescale.com","avatar":null},"body":"Save horizontal terminal line real estate by removing\nparentheses from the prompt branch display.  The branch\nis already sufficiently visually delimited by the preceding\nspace character.\n\nSigned-off-by: Kim Phillips <kim.phillips@freescale.com>\n---\n contrib/completion/git-completion.bash |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 840ae38..1373fd4 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -268,7 +268,6 @@ __git_ps1 ()\n \n \t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\" 2>/dev/null)...\" ||\n \t\t\t\tb=\"unknown\"\n-\t\t\t\tb=\"($b)\"\n \t\t\t}\n \t\tfi\n \n@@ -312,7 +311,7 @@ __git_ps1 ()\n \t\tfi\n \n \t\tlocal f=\"$w$i$s$u\"\n-\t\tprintf \"${1:- (%s)}\" \"$c${b##refs/heads/}${f:+ $f}$r$p\"\n+\t\tprintf \"${1:- %s}\" \"$c${b##refs/heads/}${f:+ $f}$r$p\"\n \tfi\n }\n \n-- \n1.7.4.5.2.g95442\n"},{"id":"166231","messageId":"7vk4elnchw.fsf@alter.siamese.dyndns.org","threadId":"27162","inReplyTo":"20110422143248.1f4f84c0.kim.phillips@freescale.com","subject":"Re: [PATCH] contrib/completion: remove parentheses from prompt","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-22T22:32:27Z","receivedAt":"2011-04-22T22:32:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kim Phillips <kim.phillips@freescale.com> writes:\n\n> Save horizontal terminal line real estate by removing parentheses from\n> the prompt branch display.  The branch is already sufficiently visually\n> delimited by the preceding space character.\n\nThat changes behaviour and makes people who like the current output\nunhappy, no?  For example, I have\n\n\tPS1=': \\h \\W$(__git_ps1 \"/%s\"); '\n\nand from it I get these output:\n\n\t: host git.git/master;\n\t: host git.git/(v1.7.5-rc3);\n        : host git.git/(63e4ee5...);\n\nI do like the fact that the tagname v1.7.5-rc3 is parenthesized---it makes\nit very clear that I am not on any branch while being detached.\n\nOf course that is _my_ personal taste, but I wonder if you can remove the\nparentheses by changing the way you use __git_ps1 in your PS1 definition.\n"},{"id":"166232","messageId":"20110422184334.98ce52a6.kim.phillips@freescale.com","threadId":"27162","inReplyTo":"7vk4elnchw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] contrib/completion: remove parentheses from prompt","fromName":"Kim Phillips","fromEmail":"kim.phillips@freescale.com","sentAt":"2011-04-22T23:43:34Z","receivedAt":"2011-04-22T23:43:34Z","isPatch":true,"sender":{"key":"kim.phillips@freescale.com","avatar":null},"body":"On Fri, 22 Apr 2011 15:32:27 -0700\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Kim Phillips <kim.phillips@freescale.com> writes:\n> \n> > Save horizontal terminal line real estate by removing parentheses from\n> > the prompt branch display.  The branch is already sufficiently visually\n> > delimited by the preceding space character.\n> \n> That changes behaviour and makes people who like the current output\n> unhappy, no?  For example, I have\n> \n> \tPS1=': \\h \\W$(__git_ps1 \"/%s\"); '\n> \n> and from it I get these output:\n> \n> \t: host git.git/master;\n> \t: host git.git/(v1.7.5-rc3);\n>         : host git.git/(63e4ee5...);\n> \n> I do like the fact that the tagname v1.7.5-rc3 is parenthesized---it makes\n> it very clear that I am not on any branch while being detached.\n> \n> Of course that is _my_ personal taste, but I wonder if you can remove the\n> parentheses by changing the way you use __git_ps1 in your PS1 definition.\n\nOh I see what happened.  A long time ago I had changed the recommended\nPS1 from the top of git-completion.bash to a version without the\nparentheses, but I must've started working in detached states more\nrecently until finally _my_ personal distaste for parens kicked in\nagain.\n\nFwiw, especially on properly managed projects, the content of the name\nitself is enough to distinguish a branch name from a tag name (which\nusually contains a version value), from a raw sha followed by three\ndots.  But I'd understand if people want it to be more deterministic.\n\nThanks,\n\nKim\n"}]}