# [PATCH] completion: --list option for git-branch

3 messages from 2012-02-15 to 2012-02-16. Participants: Ralf Thielow, Zbigniew Jędrzejewski-Szmek, Junio C Hamano.
Thread: https://gitlist.dev/t/29637

## Ralf Thielow, 2012-02-15 20:36

Subject: [PATCH] completion: --list option for git-branch
Message-ID: <1329338218-9822-1-git-send-email-ralf.thielow@googlemail.com>
URL: https://gitlist.dev/e/1329338218-9822-1-git-send-email-ralf.thielow%40googlemail.com

```
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d7367e9..1505cff 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1137,7 +1137,7 @@ _git_branch ()
 		__gitcomp "
 			--color --no-color --verbose --abbrev= --no-abbrev
 			--track --no-track --contains --merged --no-merged
-			--set-upstream --edit-description
+			--set-upstream --edit-description --list
 			"
 		;;
 	*)
-- 
1.7.9.1

```

## Zbigniew Jędrzejewski-Szmek, 2012-02-16 09:28

Subject: Re: [PATCH] completion: --list option for git-branch
Message-ID: <4F3CCC4A.5010100@in.waw.pl>
URL: https://gitlist.dev/e/4F3CCC4A.5010100%40in.waw.pl
In-Reply-To: <1329338218-9822-1-git-send-email-ralf.thielow@googlemail.com>

```
On 02/15/2012 09:36 PM, Ralf Thielow wrote:
> Signed-off-by: Ralf Thielow<ralf.thielow@googlemail.com>
> ---
>   contrib/completion/git-completion.bash |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index d7367e9..1505cff 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1137,7 +1137,7 @@ _git_branch ()
>   		__gitcomp "
>   			--color --no-color --verbose --abbrev= --no-abbrev
>   			--track --no-track --contains --merged --no-merged
> -			--set-upstream --edit-description
> +			--set-upstream --edit-description --list
>   			"
>   		;;
>   	*)
Normally one would use just a bare 'git branch' to list branches.
Why would you want to use --list in an interactive environment (as 
opposed to a script)? Isn't it better not to clutter the completion
options with something that the user actually has not need for?

Zbyszek

```

## Junio C Hamano, 2012-02-16 18:07

Subject: Re: [PATCH] completion: --list option for git-branch
Message-ID: <7vpqdezm6u.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vpqdezm6u.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4F3CCC4A.5010100@in.waw.pl>

```
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:

> Normally one would use just a bare 'git branch' to list branches.
> Why would you want to use --list in an interactive environment (as
> opposed to a script)? Isn't it better not to clutter the completion
> options with something that the user actually has not need for?

        $ git branch jc/\*
        fatal: 'jc/*' is not a valid branch name.
        $ git branch --list jc/\*
          jc/advise-i18n
          jc/advise-push-default
          ...

```
