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

4 messages from 2012-09-11 to 2012-09-12. Participants: Michael J Gruber, Junio C Hamano.
Thread: https://gitlist.dev/t/31500

## Michael J Gruber, 2012-09-11 11:58

Subject: [PATCH] completion: git branch --set-upstream-to=
Message-ID: <bd9d638e84e7e142e94b71213bed2126ea1f1951.1347364675.git.git@drmicha.warpmail.net>
URL: https://gitlist.dev/e/bd9d638e84e7e142e94b71213bed2126ea1f1951.1347364675.git.git%40drmicha.warpmail.net

```
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(-)

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, 2012-09-11 17:13

Subject: Re: [PATCH] completion: git branch --set-upstream-to=
Message-ID: <7v627kiitq.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v627kiitq.fsf%40alter.siamese.dyndns.org
In-Reply-To: <bd9d638e84e7e142e94b71213bed2126ea1f1951.1347364675.git.git@drmicha.warpmail.net>

```
Thanks; I picked up $gmane/204633 but forgot to queue.

```

## Junio C Hamano, 2012-09-11 17:46

Subject: Re: [PATCH] completion: git branch --set-upstream-to=
Message-ID: <7vliggh2qk.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vliggh2qk.fsf%40alter.siamese.dyndns.org
In-Reply-To: <7v627kiitq.fsf@alter.siamese.dyndns.org>

```
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(+)

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, 2012-09-12 10:44

Subject: Re: [PATCH] completion: git branch --set-upstream-to=
Message-ID: <50506792.4070906@drmicha.warpmail.net>
URL: https://gitlist.dev/e/50506792.4070906%40drmicha.warpmail.net
In-Reply-To: <7v627kiitq.fsf@alter.siamese.dyndns.org>

```
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

```
