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

Details

Description:
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)
2.32.0-1
* 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 https://git.kernel.org/pub/scm/git/git.git/commit?id=59d85a2a0528c3db2552b0786caac7bf0610c552 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.

Loading...