threads / patch / 41999

patchThere was a little inconsistancy in git prompt

Subject: [PATCH] There was a little inconsistancy in git prompt

## tl;dr

2 messages between Apr 12, 2016 and Apr 12, 2016. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Rudy YAYON· Apr 12, 2016, 07:16 UTC · lore
---
 contrib/completion/git-prompt.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Show changes to contrib/completion/git-prompt.sh +4 −5
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 07b52be..18be99f 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -194,13 +194,13 @@ __git_ps1_show_upstream ()
 		"") # no upstream
 			p="" ;;
 		"0	0") # equal to upstream
-			p="=" ;;
+			p=" =" ;;
 		"0	"*) # ahead of upstream
-			p=">" ;;
+			p=" >" ;;
 		*"	0") # behind upstream
-			p="<" ;;
+			p=" <" ;;
 		*)	    # diverged from upstream
-			p="<>" ;;
+			p=" <>" ;;
 		esac
 	else
 		case "$count" in

--
https://github.com/git/git/pull/181
Todd Zullinger· Apr 12, 2016, 15:27 UTC · re: Rudy YAYON · lore

Re: [PATCH] There was a little inconsistancy in git prompt

Hi Rudy,

I think the commit subject should include a bit more detail. Ideally, the subject would start with 'bash prompt: ' to make it clear what area the commit involves. Then you would want to describe what inconsistency is being fixed (and why).

Rudy YAYON wrote:
Show 26 quoted lines
> ---
> contrib/completion/git-prompt.sh | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
> index 07b52be..18be99f 100644
> --- a/contrib/completion/git-prompt.sh
> +++ b/contrib/completion/git-prompt.sh
> @@ -194,13 +194,13 @@ __git_ps1_show_upstream ()
> 		"") # no upstream
> 			p="" ;;
> 		"0	0") # equal to upstream
> -			p="=" ;;
> +			p=" =" ;;
> 		"0	"*) # ahead of upstream
> -			p=">" ;;
> +			p=" >" ;;
> 		*"	0") # behind upstream
> -			p="<" ;;
> +			p=" <" ;;
> 		*)	    # diverged from upstream
> -			p="<>" ;;
> +			p=" <>" ;;
> 		esac
> 	else
> 		case "$count" in

I attempted to solve this a while back (longer than I realized, now that I found the previous thread):

http://thread.gmane.org/gmane.comp.version-control.git/169330

Junio had some comments and suggestions, which I lacked time to follow up on, it appears. (I thought there was more discussion but it must have all been in my head. ;)

-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When I think about all the crap I learned in high school ... it's a
wonder I can think at all.
    -- Paul Simon

← back to recent threads