git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git bash completion modifies COMP_WORDBREAKS breaking other autocompletion

From
TDTim Dufala <contact@timdufala.com>
Date
May 24, 2022, 02:45 UTC
Message-ID
<b89da76a-465c-9398-bf3d-3b091d74de89@timdufala.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue) I used bash autocompletion. So: git <tab>

What did you expect to happen? (Expected behavior) The bash environment variable ${COMP_WORDBREAKS} remains unmodified.

What happened instead? (Actual behavior) COMP_WORDBREAKS is modified. Specifically, a colon is appended.

What's different between what you expected and what actually happened? COMP_WORDBREAKS being modified.

Anything else you want to add:
This breaks auto-completion of programs that rely on completing 
arguments that
include colons. For example, autocompleting arguments like: "file://abc" 
- hitting
tab gives something like "file:file://abc". As far as I'm aware, modifying
COMP_WORDBREAKS is no longer considered good practice.

Doing some research, I see the following patch, which I'd be in favor of using: https://patchwork.kernel.org/project/git/patch/20201104174716.783348-6-felipe.contreras@gmail.com/

Not sure if this will just get lost in the noise, but I figured I'd send this at least as a 'bump' towards this issue.

[System Info] git version: git version 2.36.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 compiler info: gnuc: 9.4 libc info: glibc: 2.31 $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks] not run from a git repository - no hooks to show

Message 1 of 1 in “git bash completion modifies COMP_WORDBREAKS breaking other autocompletion”
  1. Tim DufalaMay 24, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.