Skip to content

GitLens constructs git commands with a trailing ^ unquoted, which is a zsh EXTENDED_GLOB special char #1901

@ferdnyc

Description

@ferdnyc
  • GitLens Version: v12.0.4
  • Git Version: git version 2.35.1
  • VSCode Version:
    1.65.2
    c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
    x64
    
  • OS Version: Linux, Fedora 35

In zsh with the EXTENDED_GLOB shell option enabled, ^ is a globbing character. (Globs of the form dir/^path will list everything under dir/ except dir/path, and ^*.yml will match everything not matching *.yml.) foo^ is recognized as a (useless) glob that matches nothing. So, a command containing $SHA1^ needs to be quoted, or...

$ git reset 0086994d34ba17b25138a526446faad1e6d11e3d^
zsh: no matches found: 0086994d34ba17b25138a526446faad1e6d11e3d^

Steps to Reproduce:

  1. chsh /bin/zsh
  2. code
  3. Navigate to a commit in GitLens and choose "Reset current branch to previous commit..."
  4. Select "Reset" from the popup
  5. See "no matches found" message in Terminal pane
  6. Run git reset 0086994d34ba17b25138a526446faad1e6d11e3d\^ by hand, successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds to be looked at

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions