gitsh: Autocompletion doesn't work anymore after upgrading git to version 2.20.0

Hello, starting from today autocompletion is not working anymore for basic git commands (e.g. push, checkout, pull, etc.), I’m running the latest stable release of gitsh. The only possible reason I see for this behaviour is that today I upgraded git from 2.19.2-1 to 2.20.0-1 through regular system updates (Archlinux). Except from that I can’t find or remember any other relevant change related to git since yesterday. Let me know if there is any additional information I can provide

EDIT: I downgraded git back to version 2.19.2 and I can confirm that the autocompletion issue is happening only with git 2.20.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

I talked this through with some folk at thoughtbot who had various Git versions installed, and we discovered that git help -a --no-verbose outputs the old help -a format on recent Git versions, but is an error on older Git versions.

Seems like the right approach is:

  1. Try git --list-cmds
  2. Fall back to git help -a --no-verbose expecting the old format
  3. Fall back to git help -a expecting the old format

https://github.com/git/git/commit/26c7d0678324d99b56d3044acfdfab57ee670af4 is where --no-verbose is introduced.

Thanks @edwardloveall, @iwz, @mike-burns, and @sharplet !

@joshukraine Thanks for the additional detail.

I think the issue you’re seeing (arguments not completing for aliases) is different for the one reported here (commands not completing with Git 2.20), so I’m going to open a new issue.

@georgebrock Poked around a bit more and realized that my problem is more specific. Tab completion of git commands does seem to be working. What appears broken for me is the completion of file paths when using git aliases. So for example, I have a aliased to add in my gitconfig file. With previous versions of gitsh, if I wanted to add a modified file to the staging area, I would do something like a source/asset<tab> and that would complete the path. Same with co aliased to checkout. To tab complete checking out a feature branch I could do co new-feat<tab> and it would try to complete the branch. These work if I use the full git command (e.g. checkout ...) but not with aliases.

Sorry for the long explanation. Any suggestions? Thanks! 🙂

I’ve merged #337, this will be in the next release which I’ll try to get out as soon as possible.

@iwz But now gitsh won’t work! 😱