b74a15a80e24ae12e533a38e580cd0a939dece31

Author
Felipe Contreras <felipe.contreras@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(gitfast): update to git-completion 1.3.7 (#11114)

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash
  2index 2603ba7bb4b9fb8081a2b68aa19089279f21b637..dd06b50480bab4b6053dc6295c44a46759c5d582 100644
  3--- a/plugins/gitfast/git-completion.bash
  4+++ b/plugins/gitfast/git-completion.bash
  5@@ -49,6 +49,11 @@
  6 #     and git-switch completion (e.g., completing "foo" when "origin/foo"
  7 #     exists).
  8 #
  9+#   GIT_COMPLETION_SHOW_ALL_COMMANDS
 10+#
 11+#     When set to "1" suggest all commands, including plumbing commands
 12+#     which are hidden by default (e.g. "cat-file" on "git ca<TAB>").
 13+#
 14 #   GIT_COMPLETION_SHOW_ALL
 15 #
 16 #     When set to "1" suggest all options, including options which are
 17@@ -321,19 +326,19 @@ __gitcomp_builtin_apply_default=" --exclude= --include= --no-add --stat --numsta
 18 __gitcomp_builtin_archive_default=" --output= --remote= --exec= --no-output -- --no-remote --no-exec"
 19 __gitcomp_builtin_bisect__helper_default=" --bisect-reset --bisect-next-check --bisect-terms --bisect-start --bisect-next --bisect-state --bisect-log --bisect-replay --bisect-skip --bisect-visualize --bisect-run --no-log --log"
 20diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh
 21index db7c0068fb55d9a520478e0b46ba952dc650f816..1435548e004687fcc21a9e1b8922aa3bd39b8515 100644
 22--- a/plugins/gitfast/git-prompt.sh
 23+++ b/plugins/gitfast/git-prompt.sh
 24@@ -66,6 +66,11 @@
 25 #     git           always compare HEAD to @{upstream}
 26 #     svn           always compare HEAD to your SVN upstream
 27 #
 28+# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
 29+# find one, or @{upstream} otherwise.  Once you have set
 30+# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
 31+# setting the bash.showUpstream config variable.
 32+#
 33 # You can change the separator between the branch name and the above
 34 # state symbols by setting GIT_PS1_STATESEPARATOR. The default separator
 35 # is SP.
 36@@ -79,11 +84,6 @@
 37 # single '?' character by setting GIT_PS1_COMPRESSSPARSESTATE, or omitted
 38 # by setting GIT_PS1_OMITSPARSESTATE.
 39 #
 40-# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
 41-# find one, or @{upstream} otherwise.  Once you have set
 42-# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
 43-# setting the bash.showUpstream config variable.
 44-#
 45 # If you would like to see more information about the identity of
 46 # commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
 47 # to one of these values:
 48@@ -115,7 +115,7 @@ __git_ps1_show_upstream ()
 49 {
 50 	local key value
 51 	local svn_remote svn_url_pattern count n
 52-	local upstream=git legacy="" verbose="" name=""
 53+	local upstream_type=git legacy="" verbose="" name=""
 54 
 55 	svn_remote=()
 56 	# get some config options from git-config
 57@@ -132,7 +132,7 @@ __git_ps1_show_upstream ()
 58 		svn-remote.*.url)
 59 			svn_remote[$((${#svn_remote[@]} + 1))]="$value"
 60 			svn_url_pattern="$svn_url_pattern\\|$value"
 61-			upstream=svn+git # default upstream is SVN if available, else git
 62+			upstream_type=svn+git # default upstream type is SVN if available, else git
 63 			;;
 64 		esac
 65 	done <<< "$output"
 66@@ -141,16 +141,16 @@ __git_ps1_show_upstream ()
 67 	local option
 68 	for option in ${GIT_PS1_SHOWUPSTREAM}; do
 69 		case "$option" in
 70-		git|svn) upstream="$option" ;;
 71+		git|svn) upstream_type="$option" ;;
 72 		verbose) verbose=1 ;;
 73 		legacy)  legacy=1  ;;
 74 		name)    name=1 ;;
 75 		esac
 76 	done
 77 
 78-	# Find our upstream
 79-	case "$upstream" in
 80-	git)    upstream="@{upstream}" ;;
 81+	# Find our upstream type
 82+	case "$upstream_type" in
 83+	git)    upstream_type="@{upstream}" ;;
 84 	svn*)
 85 		# get the upstream from the "git-svn-id: ..." in a commit message
 86 		# (git-svn uses essentially the same procedure internally)
 87@@ -167,12 +167,12 @@ __git_ps1_show_upstream ()
 88 
 89 			if [[ -z "$svn_upstream" ]]; then
 90 				# default branch name for checkouts with no layout:
 91-				upstream=${GIT_SVN_ID:-git-svn}
 92+				upstream_type=${GIT_SVN_ID:-git-svn}
 93 			else
 94-				upstream=${svn_upstream#/}
 95+				upstream_type=${svn_upstream#/}
 96 			fi
 97-		elif [[ "svn+git" = "$upstream" ]]; then
 98-			upstream="@{upstream}"
 99+		elif [[ "svn+git" = "$upstream_type" ]]; then
100+			upstream_type="@{upstream}"
101 		fi
102 		;;
103 	esac
104@@ -180,11 +180,11 @@ __git_ps1_show_upstream ()
105 	# Find how many commits we are ahead/behind our upstream
106 	if [[ -z "$legacy" ]]; then
107 		count="$(git rev-list --count --left-right \
108-				"$upstream"...HEAD 2>/dev/null)"
109+				"$upstream_type"...HEAD 2>/dev/null)"
110 	else
111 		# produce equivalent output to --count for older versions of git
112 		local commits
113-		if commits="$(git rev-list --left-right "$upstream"...HEAD 2>/dev/null)"
114+		if commits="$(git rev-list --left-right "$upstream_type"...HEAD 2>/dev/null)"
115 		then
116 			local commit behind=0 ahead=0
117 			for commit in $commits
118@@ -214,26 +214,26 @@ __git_ps1_show_upstream ()
119 		*)	    # diverged from upstream
120 			p="<>" ;;
121 		esac
122-	else
123+	else # verbose, set upstream instead of p
124diff --git a/plugins/gitfast/update b/plugins/gitfast/update
125index 5ebaaef3d4bea3bc8574a4c0885e4b262d983e17..feb13ff7ed2858ff75dbc6d50eebb38287df9a8a 100755
126--- a/plugins/gitfast/update
127+++ b/plugins/gitfast/update
128@@ -1,7 +1,7 @@
129 #!/bin/sh
130 
131 url="https://raw.githubusercontent.com/felipec/git-completion"
132-version="1.3.6"
133+version="1.3.7"
134 
135 curl -s -o _git "${url}/v${version}/git-completion.zsh" &&
136 curl -s -o git-completion.bash "${url}/v${version}/git-completion.bash" &&