threads / patch / 45759

patchcompletion: optionally disable checkout DWIM

Subject: [PATCH] completion: optionally disable checkout DWIM

## tl;dr

10 messages between Apr 20, 2017 and Apr 24, 2017. Diffs are folded; open one to read it.

replies: 9people: 5as markdown or json

Jeff King· Apr 20, 2017, 20:12 UTC · lore

When we complete branch names for "git checkout", we also complete remote branch names that could trigger the DWIM behavior. Depending on your workflow and project, this can be either convenient or annoying.

For instance, my clone of gitster.git contains 74 local "jk/*" branches, but origin contains another 147. When I want to checkout a local branch but can't quite remember the name, tab completion shows me 251 entries. And worse, for a topic that has been picked up for pu, the upstream branch name is likely to be similar to mine, leading to a high probability that I pick the wrong one and accidentally create a new branch.

This patch adds a way for the user to tell the completion code not to include DWIM suggestions for checkout. This can already be done by typing:

  git checkout --no-guess jk/<TAB>

but that's rather cumbersome. The downside, of course, is that you no longer get completion support when you _do_ want to invoke the DWIM behavior. But depending on your workflow, that may not be a big loss (for instance, in git.git I am much more likely to want to detach, so I'd type "git checkout origin/jk/<TAB>" anyway).

Signed-off-by: Jeff King <peff@peff.net>
---
This is flexible enough for me, but it's possible somebody would want
this on a per-repo basis. I don't know that we want to read from `git
config`, though, because it's relatively expensive to do so. People who
want per-repo settings are probably better off with a hook that triggers
when they "cd" around, and sets up their preferences.
 contrib/completion/git-completion.bash | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Show changes to contrib/completion/git-completion.bash +10 −1
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 1150164d5..f53b18fae 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -28,6 +28,14 @@
 # completion style.  For example '!f() { : git commit ; ... }; f' will
 # tell the completion to use commit completion.  This also works with aliases
 # of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
+#
+# You can set the following environment variables to influence the behavior of
+# the completion routines:
+#
+#   GIT_COMPLETION_CHECKOUT_NO_GUESS
+#
+#     When non-empty, do not include "DWIM" suggestions in git-checkout
+#     completion (e.g., completing "foo" when "origin/foo" exists).
 
 case "$COMP_WORDBREAKS" in
 *:*) : great ;;
@@ -1248,7 +1256,8 @@ _git_checkout ()
 		# check if --track, --no-track, or --no-guess was specified
 		# if so, disable DWIM mode
 		local flags="--track --no-track --no-guess" track_opt="--track"
-		if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
+		if [ -n "$GIT_COMPLETION_CHECKOUT_NO_GUESS" -o \
+		     -n "$(__git_find_on_cmdline "$flags")" ]; then
 			track_opt=''
 		fi
 		__git_complete_refs $track_opt
-- 
2.13.0.rc0.363.g8726c260e
Junio C Hamano· Apr 21, 2017, 05:01 UTC · re: Jeff King · lore

Re: [PATCH] completion: optionally disable checkout DWIM

Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> When we complete branch names for "git checkout", we also
> complete remote branch names that could trigger the DWIM
> behavior. Depending on your workflow and project, this can
> be either convenient or annoying.
> ...
> This is flexible enough for me, but it's possible somebody would want
> this on a per-repo basis. I don't know that we want to read from `git
> config`, though, because it's relatively expensive to do so. People who
> want per-repo settings are probably better off with a hook that triggers
> when they "cd" around, and sets up their preferences.

Sounds OK. I am kind of surprised that --no-guess is the only way to turn off this dwimming (not in the completion side, but there does not seem to be a way to tell "git checkout" that you do not need that create-missing-branch-out-of-remote-tracking).

Show 32 quoted lines
>  contrib/completion/git-completion.bash | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 1150164d5..f53b18fae 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -28,6 +28,14 @@
>  # completion style.  For example '!f() { : git commit ; ... }; f' will
>  # tell the completion to use commit completion.  This also works with aliases
>  # of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
> +#
> +# You can set the following environment variables to influence the behavior of
> +# the completion routines:
> +#
> +#   GIT_COMPLETION_CHECKOUT_NO_GUESS
> +#
> +#     When non-empty, do not include "DWIM" suggestions in git-checkout
> +#     completion (e.g., completing "foo" when "origin/foo" exists).
>  
>  case "$COMP_WORDBREAKS" in
>  *:*) : great ;;
> @@ -1248,7 +1256,8 @@ _git_checkout ()
>  		# check if --track, --no-track, or --no-guess was specified
>  		# if so, disable DWIM mode
>  		local flags="--track --no-track --no-guess" track_opt="--track"
> -		if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
> +		if [ -n "$GIT_COMPLETION_CHECKOUT_NO_GUESS" -o \
> +		     -n "$(__git_find_on_cmdline "$flags")" ]; then
>  			track_opt=''
>  		fi
>  		__git_complete_refs $track_opt
Jeff King· Apr 21, 2017, 05:03 UTC · re: Junio C Hamano · lore

Re: [PATCH] completion: optionally disable checkout DWIM

On Thu, Apr 20, 2017 at 10:01:32PM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > When we complete branch names for "git checkout", we also
> > complete remote branch names that could trigger the DWIM
> > behavior. Depending on your workflow and project, this can
> > be either convenient or annoying.
> > ...
> > This is flexible enough for me, but it's possible somebody would want
> > this on a per-repo basis. I don't know that we want to read from `git
> > config`, though, because it's relatively expensive to do so. People who
> > want per-repo settings are probably better off with a hook that triggers
> > when they "cd" around, and sets up their preferences.
> 
> Sounds OK.  I am kind of surprised that --no-guess is the only way
> to turn off this dwimming (not in the completion side, but there
> does not seem to be a way to tell "git checkout" that you do not
> need that create-missing-branch-out-of-remote-tracking).

Yeah, I didn't even know about --no-guess until reading the completion script (it's intentionally undocumented). I did consider teaching checkout a config option for "do not DWIM". But I think it's really the completion that bugs me. The DWIM is easy to avoid triggering if you just don't feed it the remote branch names. It's the completion that routinely leads me to doing that. :)

-Peff
Junio C Hamano· Apr 21, 2017, 05:30 UTC · re: Jeff King · lore

Re: [PATCH] completion: optionally disable checkout DWIM

Jeff King <peff@peff.net> writes:
> ... But I think it's really the
> completion that bugs me. The DWIM is easy to avoid triggering if you
> just don't feed it the remote branch names. It's the completion that
> routinely leads me to doing that. :)
True.
SZEDER Gábor· Apr 21, 2017, 20:14 UTC · re: Junio C Hamano · lore

Re: [PATCH] completion: optionally disable checkout DWIM

On Fri, Apr 21, 2017 at 7:01 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> When we complete branch names for "git checkout", we also
>> complete remote branch names that could trigger the DWIM
>> behavior. Depending on your workflow and project, this can
>> be either convenient or annoying.
>> ...
>> This is flexible enough for me, but it's possible somebody would want
>> this on a per-repo basis. I don't know that we want to read from `git
>> config`, though, because it's relatively expensive to do so. People who
>> want per-repo settings are probably better off with a hook that triggers
>> when they "cd" around, and sets up their preferences.

We could discern between more than just empty vs. non-empty state of the environment variable, e.g.:

  - if empty/unset, then include "DWIM" suggestions.
  - if set to 'config', then query the 'completion.checkoutNoGuess'
    configuration variable, and omit "DWIM" suggestions if its true.
  - if set to something else, then omit "DWIM" suggestions.

Then users can themselves decide, whether the per-repo configurability is worth the overhead of running 'git config'.

Show 21 quoted lines
> Sounds OK.  I am kind of surprised that --no-guess is the only way
> to turn off this dwimming (not in the completion side, but there
> does not seem to be a way to tell "git checkout" that you do not
> need that create-missing-branch-out-of-remote-tracking).
>
>>  contrib/completion/git-completion.bash | 11 ++++++++++-
>>  1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>> index 1150164d5..f53b18fae 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -28,6 +28,14 @@
>>  # completion style.  For example '!f() { : git commit ; ... }; f' will
>>  # tell the completion to use commit completion.  This also works with aliases
>>  # of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
>> +#
>> +# You can set the following environment variables to influence the behavior of
>> +# the completion routines:
>> +#
>> +#   GIT_COMPLETION_CHECKOUT_NO_GUESS

That's one long variable name :) Of course it has to start with the 'GIT_COMPLETION_' prefix, and you can't win from there...

Show 12 quoted lines
>> +#     When non-empty, do not include "DWIM" suggestions in git-checkout
>> +#     completion (e.g., completing "foo" when "origin/foo" exists).
>>
>>  case "$COMP_WORDBREAKS" in
>>  *:*) : great ;;
>> @@ -1248,7 +1256,8 @@ _git_checkout ()
>>               # check if --track, --no-track, or --no-guess was specified
>>               # if so, disable DWIM mode
>>               local flags="--track --no-track --no-guess" track_opt="--track"
>> -             if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
>> +             if [ -n "$GIT_COMPLETION_CHECKOUT_NO_GUESS" -o \
>> +                  -n "$(__git_find_on_cmdline "$flags")" ]; then
|| would be better than '-o', because the former short-circuits when
the first condition is true, but the latter doesn't.
>>                       track_opt=''
>>               fi
>>               __git_complete_refs $track_opt
On Fri, Apr 21, 2017 at 7:01 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 50 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> When we complete branch names for "git checkout", we also
>> complete remote branch names that could trigger the DWIM
>> behavior. Depending on your workflow and project, this can
>> be either convenient or annoying.
>> ...
>> This is flexible enough for me, but it's possible somebody would want
>> this on a per-repo basis. I don't know that we want to read from `git
>> config`, though, because it's relatively expensive to do so. People who
>> want per-repo settings are probably better off with a hook that triggers
>> when they "cd" around, and sets up their preferences.
>
> Sounds OK.  I am kind of surprised that --no-guess is the only way
> to turn off this dwimming (not in the completion side, but there
> does not seem to be a way to tell "git checkout" that you do not
> need that create-missing-branch-out-of-remote-tracking).
>
>>  contrib/completion/git-completion.bash | 11 ++++++++++-
>>  1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>> index 1150164d5..f53b18fae 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -28,6 +28,14 @@
>>  # completion style.  For example '!f() { : git commit ; ... }; f' will
>>  # tell the completion to use commit completion.  This also works with aliases
>>  # of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
>> +#
>> +# You can set the following environment variables to influence the behavior of
>> +# the completion routines:
>> +#
>> +#   GIT_COMPLETION_CHECKOUT_NO_GUESS
>> +#
>> +#     When non-empty, do not include "DWIM" suggestions in git-checkout
>> +#     completion (e.g., completing "foo" when "origin/foo" exists).
>>
>>  case "$COMP_WORDBREAKS" in
>>  *:*) : great ;;
>> @@ -1248,7 +1256,8 @@ _git_checkout ()
>>               # check if --track, --no-track, or --no-guess was specified
>>               # if so, disable DWIM mode
>>               local flags="--track --no-track --no-guess" track_opt="--track"
>> -             if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
>> +             if [ -n "$GIT_COMPLETION_CHECKOUT_NO_GUESS" -o \
>> +                  -n "$(__git_find_on_cmdline "$flags")" ]; then
>>                       track_opt=''
>>               fi
>>               __git_complete_refs $track_opt
Jeff King· Apr 21, 2017, 20:19 UTC · re: SZEDER Gábor · lore

Re: [PATCH] completion: optionally disable checkout DWIM

On Fri, Apr 21, 2017 at 10:14:48PM +0200, SZEDER Gábor wrote:
Show 16 quoted lines
> >> This is flexible enough for me, but it's possible somebody would want
> >> this on a per-repo basis. I don't know that we want to read from `git
> >> config`, though, because it's relatively expensive to do so. People who
> >> want per-repo settings are probably better off with a hook that triggers
> >> when they "cd" around, and sets up their preferences.
> 
> We could discern between more than just empty vs. non-empty state of
> the environment variable, e.g.:
> 
>   - if empty/unset, then include "DWIM" suggestions.
>   - if set to 'config', then query the 'completion.checkoutNoGuess'
>     configuration variable, and omit "DWIM" suggestions if its true.
>   - if set to something else, then omit "DWIM" suggestions.
> 
> Then users can themselves decide, whether the per-repo configurability
> is worth the overhead of running 'git config'.

Yep, that would work. I wasn't going to bother with that complexity unless somebody really wanted it. The important thing is not to paint ourselves into a corner. By the rules you gave above, it would probably be fine to extend my patch later to match. But we could also be more specific (e.g., look for some positive value like "1").

Show 8 quoted lines
> >> +# You can set the following environment variables to influence the behavior of
> >> +# the completion routines:
> >> +#
> >> +#   GIT_COMPLETION_CHECKOUT_NO_GUESS
> 
> That's one long variable name :)
> Of course it has to start with the 'GIT_COMPLETION_' prefix, and you
> can't win from there...

Yeah, I had the same thought. I also considered using "DWIM", which is the name by which I know the feature. But since "--no-guess" is the matching option, I went with that.

Show 10 quoted lines
> >> @@ -1248,7 +1256,8 @@ _git_checkout ()
> >>               # check if --track, --no-track, or --no-guess was specified
> >>               # if so, disable DWIM mode
> >>               local flags="--track --no-track --no-guess" track_opt="--track"
> >> -             if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
> >> +             if [ -n "$GIT_COMPLETION_CHECKOUT_NO_GUESS" -o \
> >> +                  -n "$(__git_find_on_cmdline "$flags")" ]; then
> 
> || would be better than '-o', because the former short-circuits when
> the first condition is true, but the latter doesn't.

Ah, I didn't know that. Usually I use "||", but I thought "-o" was generally preferred in bash-specific scripts. We definitely want to short circuit here.

-Peff
SZEDER Gábor· Apr 22, 2017, 17:32 UTC · re: Jeff King · lore

Re: [PATCH] completion: optionally disable checkout DWIM

On Fri, Apr 21, 2017 at 10:19 PM, Jeff King <peff@peff.net> wrote:
Show 24 quoted lines
> On Fri, Apr 21, 2017 at 10:14:48PM +0200, SZEDER Gábor wrote:
>
>> >> This is flexible enough for me, but it's possible somebody would want
>> >> this on a per-repo basis. I don't know that we want to read from `git
>> >> config`, though, because it's relatively expensive to do so. People who
>> >> want per-repo settings are probably better off with a hook that triggers
>> >> when they "cd" around, and sets up their preferences.
>>
>> We could discern between more than just empty vs. non-empty state of
>> the environment variable, e.g.:
>>
>>   - if empty/unset, then include "DWIM" suggestions.
>>   - if set to 'config', then query the 'completion.checkoutNoGuess'
>>     configuration variable, and omit "DWIM" suggestions if its true.
>>   - if set to something else, then omit "DWIM" suggestions.
>>
>> Then users can themselves decide, whether the per-repo configurability
>> is worth the overhead of running 'git config'.
>
> Yep, that would work. I wasn't going to bother with that complexity
> unless somebody really wanted it. The important thing is not to paint
> ourselves into a corner. By the rules you gave above, it would probably
> be fine to extend my patch later to match. But we could also be more
> specific (e.g., look for some positive value like "1").
That's fine with me.

We should have done this when we introduced env variables controlling the prompt script, we could spare a 'git config' execution in a subshell or two.

Show 14 quoted lines
>> >> @@ -1248,7 +1256,8 @@ _git_checkout ()
>> >>               # check if --track, --no-track, or --no-guess was specified
>> >>               # if so, disable DWIM mode
>> >>               local flags="--track --no-track --no-guess" track_opt="--track"
>> >> -             if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
>> >> +             if [ -n "$GIT_COMPLETION_CHECKOUT_NO_GUESS" -o \
>> >> +                  -n "$(__git_find_on_cmdline "$flags")" ]; then
>>
>> || would be better than '-o', because the former short-circuits when
>> the first condition is true, but the latter doesn't.
>
> Ah, I didn't know that. Usually I use "||", but I thought "-o" was
> generally preferred in bash-specific scripts. We definitely want to
> short circuit here.

No, we use || and && fairly consistently in conditions in Bash scripts. There is no '-o' in the completion or prompt scripts, and there is only a single '-a' in the former, but it only checks two one-letter variables, so it doesn't matter. (Besides, it's from my second ever commit, so it has great sentimental value ;)

There are some inconsistencies using 'if [ ... ]' and 'if [[ ... ]]', but oh well.

Anyway, v2 looks good to me.
Jacob Keller· Apr 21, 2017, 07:25 UTC · re: Jeff King · lore

Re: [PATCH] completion: optionally disable checkout DWIM

On Thu, Apr 20, 2017 at 1:12 PM, Jeff King <peff@peff.net> wrote:
Show 35 quoted lines
> When we complete branch names for "git checkout", we also
> complete remote branch names that could trigger the DWIM
> behavior. Depending on your workflow and project, this can
> be either convenient or annoying.
>
> For instance, my clone of gitster.git contains 74 local
> "jk/*" branches, but origin contains another 147. When I
> want to checkout a local branch but can't quite remember the
> name, tab completion shows me 251 entries. And worse, for a
> topic that has been picked up for pu, the upstream branch
> name is likely to be similar to mine, leading to a high
> probability that I pick the wrong one and accidentally
> create a new branch.
>
> This patch adds a way for the user to tell the completion
> code not to include DWIM suggestions for checkout. This can
> already be done by typing:
>
>   git checkout --no-guess jk/<TAB>
>
> but that's rather cumbersome. The downside, of course, is
> that you no longer get completion support when you _do_ want
> to invoke the DWIM behavior. But depending on your workflow,
> that may not be a big loss (for instance, in git.git I am
> much more likely to want to detach, so I'd type "git
> checkout origin/jk/<TAB>" anyway).
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> This is flexible enough for me, but it's possible somebody would want
> this on a per-repo basis. I don't know that we want to read from `git
> config`, though, because it's relatively expensive to do so. People who
> want per-repo settings are probably better off with a hook that triggers
> when they "cd" around, and sets up their preferences.
>

I would use this. Completing these can get quite cumbersome to use when I have only a few local branches but many remote ones like in git.git

Thanks, Jake

Jeff King· Apr 21, 2017, 20:27 UTC · re: Jeff King · lore

[PATCH v2] completion: optionally disable checkout DWIM

When we complete branch names for "git checkout", we also complete remote branch names that could trigger the DWIM behavior. Depending on your workflow and project, this can be either convenient or annoying.

For instance, my clone of gitster.git contains 74 local "jk/*" branches, but origin contains another 147. When I want to checkout a local branch but can't quite remember the name, tab completion shows me 251 entries. And worse, for a topic that has been picked up for pu, the upstream branch name is likely to be similar to mine, leading to a high probability that I pick the wrong one and accidentally create a new branch.

This patch adds a way for the user to tell the completion code not to include DWIM suggestions for checkout. This can already be done by typing:

  git checkout --no-guess jk/<TAB>

but that's rather cumbersome. The downside, of course, is that you no longer get completion support when you _do_ want to invoke the DWIM behavior. But depending on your workflow, that may not be a big loss (for instance, in git.git I am much more likely to want to detach, so I'd type "git checkout origin/jk/<TAB>" anyway).

Signed-off-by: Jeff King <peff@peff.net>
---
Compared to v1, this version requires the new variable be set to "1" (to
leave more room for later extension), and uses short-circuiting || for
the logic.
 contrib/completion/git-completion.bash | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Show changes to contrib/completion/git-completion.bash +10 −1
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 1150164d5..f977b54d8 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -28,6 +28,14 @@
 # completion style.  For example '!f() { : git commit ; ... }; f' will
 # tell the completion to use commit completion.  This also works with aliases
 # of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
+#
+# You can set the following environment variables to influence the behavior of
+# the completion routines:
+#
+#   GIT_COMPLETION_CHECKOUT_NO_GUESS
+#
+#     When set to "1", do not include "DWIM" suggestions in git-checkout
+#     completion (e.g., completing "foo" when "origin/foo" exists).
 
 case "$COMP_WORDBREAKS" in
 *:*) : great ;;
@@ -1248,7 +1256,8 @@ _git_checkout ()
 		# check if --track, --no-track, or --no-guess was specified
 		# if so, disable DWIM mode
 		local flags="--track --no-track --no-guess" track_opt="--track"
-		if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
+		if [ "$GIT_COMPLETION_CHECKOUT_NO_GUESS" = "1" ] ||
+		   [ -n "$(__git_find_on_cmdline "$flags")" ]; then
 			track_opt=''
 		fi
 		__git_complete_refs $track_opt
-- 
2.13.0.rc0.364.g36b4d8031
Brandon Williams· Apr 24, 2017, 16:30 UTC · re: Jeff King · lore

Re: [PATCH v2] completion: optionally disable checkout DWIM

On 04/21, Jeff King wrote:
Show 29 quoted lines
> 
> When we complete branch names for "git checkout", we also
> complete remote branch names that could trigger the DWIM
> behavior. Depending on your workflow and project, this can
> be either convenient or annoying.
> 
> For instance, my clone of gitster.git contains 74 local
> "jk/*" branches, but origin contains another 147. When I
> want to checkout a local branch but can't quite remember the
> name, tab completion shows me 251 entries. And worse, for a
> topic that has been picked up for pu, the upstream branch
> name is likely to be similar to mine, leading to a high
> probability that I pick the wrong one and accidentally
> create a new branch.
> 
> This patch adds a way for the user to tell the completion
> code not to include DWIM suggestions for checkout. This can
> already be done by typing:
> 
>   git checkout --no-guess jk/<TAB>
> 
> but that's rather cumbersome. The downside, of course, is
> that you no longer get completion support when you _do_ want
> to invoke the DWIM behavior. But depending on your workflow,
> that may not be a big loss (for instance, in git.git I am
> much more likely to want to detach, so I'd type "git
> checkout origin/jk/<TAB>" anyway).
> 
> Signed-off-by: Jeff King <peff@peff.net>

May not be relevant to this patch per-say, but is there a way to have the completion for checkout only complete up to a part of remotes/branches? Say a forward-slash '/'. For example git.git has lots of branches which have the form: origin/<initials>/branch-name. It would be convenient if when I type:

git checkout <TAB> 

Instead of getting a long list of 2k or so branch names that instead I would get see the remote's name e.g. 'origin/' kind of like vanilla directory completion. This way, unless I'm actually interested in the remote, I don't see the thousands of branches related to it.

-- 
Brandon Williams

← back to recent threads