Skip to content

git checkout: no completion of remote branch shorthands #2937

@carlodri

Description

@carlodri

Current Behavior

I have a freshly cloned repo and if I type git checkout <tab> I get this:

❯ | git checkout
HEAD                                fix dep
main                                Merge pull request #3 from regro-cf-autotick-bot/noarch_python_min-migration-...
origin                              Merge pull request #3 from regro-cf-autotick-bot/noarch_python_min-migration-...
origin/main                         Merge pull request #3 from regro-cf-autotick-bot/noarch_python_min-migration-...
origin/replace_wget_with_requests   fix dep

and I can only autocomplete the origin/replace_wget_with_requests branch name leading to a detached HEAD.

Expected Behavior

I would expect git checkout r<tab> to offer me replace_wget_with_requests so that git automatically sets up branch tracking with origin.

Steps To Reproduce

Using nushell + starship on windows.
Try the above git checkout command.

Version

carapace-bin 1.4.1

OS

  • Darwin
  • Linux
  • Termux
  • Windows

Shell

  • Bash
  • Elvish
  • Fish
  • Nushell
  • Oil
  • Powershell
  • Xonsh
  • Zsh

env.nu

$env.CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense' # optional
mkdir ~/.cache/carapace
carapace _carapace nushell | save --force ~/.cache/carapace/init.nu

config.nu (extract)

let carapace_completer = {|spans|
    carapace $spans.0 nushell ...$spans | from json
}

source ~/.cache/carapace/init.nu

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfundFundable with polar.shnushellwindows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions