threads / patch / 29637

patchcompletion: --list option for git-branch

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

## tl;dr

3 messages between Feb 15, 2012 and Feb 16, 2012. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Ralf Thielow· Feb 15, 2012, 20:36 UTC · lore
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to contrib/completion/git-completion.bash +1 −1
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· Feb 16, 2012, 09:28 UTC · re: Ralf Thielow · lore

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

On 02/15/2012 09:36 PM, Ralf Thielow wrote:
Show 18 quoted lines
> 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· Feb 16, 2012, 18:07 UTC · re: Zbigniew Jędrzejewski-Szmek · lore

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

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

← back to recent threads