threads / patch / 31500

patchcompletion: git branch --set-upstream-to=

Subject: [PATCH] completion: git branch --set-upstream-to=

## tl;dr

4 messages between Sep 11, 2012 and Sep 12, 2012. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Michael J Gruber· Sep 11, 2012, 11:58 UTC · lore

Remove the deprecated --set-upstream from completion suggestions and add the new --set-upstream-to=, offering all refs for completion like in similar cases.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 contrib/completion/git-completion.bash | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Show changes to contrib/completion/git-completion.bash +4 −1
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 222b804..625d767 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -875,11 +875,14 @@ _git_branch ()
 	done
 
 	case "$cur" in
+	--set-upstream-to=*)
+		__gitcomp "$(__git_refs)" "" "${cur##--set-upstream-to=}"
+		;;
 	--*)
 		__gitcomp "
 			--color --no-color --verbose --abbrev= --no-abbrev
 			--track --no-track --contains --merged --no-merged
-			--set-upstream --edit-description --list
+			--set-upstream-to= --edit-description --list
 			"
 		;;
 	*)
-- 
1.7.12.443.g84e0989
Junio C Hamano· Sep 11, 2012, 17:46 UTC · re: Junio C Hamano · lore

Re: [PATCH] completion: git branch --set-upstream-to=

Junio C Hamano <gitster@pobox.com> writes:
> Thanks; I picked up $gmane/204633 but forgot to queue.
... so this has been reduced to:
-- >8 --
From: Michael J Gruber <git@drmicha.warpmail.net>
Date: Tue, 11 Sep 2012 13:58:30 +0200
Subject: [PATCH] completion: complete branch name for "branch --set-upstream-to="
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/completion/git-completion.bash | 3 +++
 1 file changed, 3 insertions(+)
Show changes to contrib/completion/git-completion.bash +3 −0
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 4a4d30a..e48cf80 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -875,6 +875,9 @@ _git_branch ()
 	done
 
 	case "$cur" in
+	--set-upstream-to=*)
+		__gitcomp "$(__git_refs)" "" "${cur##--set-upstream-to=}"
+		;;
 	--*)
 		__gitcomp "
 			--color --no-color --verbose --abbrev= --no-abbrev
-- 
1.7.12
Michael J Gruber· Sep 12, 2012, 10:44 UTC · re: Junio C Hamano · lore

Re: [PATCH] completion: git branch --set-upstream-to=

Junio C Hamano venit, vidit, dixit 11.09.2012 19:13:
> Thanks; I picked up $gmane/204633 but forgot to queue.
I missed that one, thanks for reducing appropriately.
Michael

← back to recent threads