Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#71215 - [git] Git alias completion bug

Attached to Project: Arch Linux
Opened by Vuk Mirovic (wooque) - Thursday, 10 June 2021, 22:27 GMT
Last edited by Eli Schwartz (eschwartz) - Thursday, 10 June 2021, 22:56 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Git alias is set in .bashrc with:

source "/usr/share/git/completion/git-completion.bash"
alias gco="git checkout"
__git_complete gco _git_checkout

Everything worked fine until 2.32 upgrade, after upgrade completion works but prints on every key press:

bash: [: -lt: unary operator expected
bash: [: : integer expression expected
bash: [: -lt: unary operator expected
bash: [: -lt: unary operator expected

Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Thursday, 10 June 2021, 22:56 GMT
Reason for closing:  Upstream
Comment by Eli Schwartz (eschwartz) - Thursday, 10 June 2021, 22:56 GMT
This doesn't have anything to do with Arch's packaging of git, it's an effect of the upstream completion file.

However, it does seem like your problem is so you may wish to talk to upstream about it.

Note that I'm not entirely sure they support you directly reusing their internal completion functions; you might be expected to wrap it as __git_complete gco _gco and define "_gco" to set up the env and then invoke _git_checkout.

Then again, they might want to support it. You'd have to ask the git developers to find out.