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

Re: [PATCH] completion: zsh: support completion after "git -C <path>"

From
Lutz Lengemann <lutz@lengemann.net>
Date
Aug 18, 2026, 12:40 UTC
Message-ID
<43bc34ae-451d-4270-84a6-bbbf8de80115@app.fastmail.com>
In-Reply-To
<CALnO6CCWADaQycF7XcCFLDgCVtkTAsndKykAWzNhPqVAKWYGzA@mail.gmail.com>
Hi
On Tue, Aug 18, 2026, at 14:13, D. Ben Knoble wrote:
> No worries! Hope you enjoyed. (I didn't see v2 come in anywhere, but
> I'll keep my eye out.)

I pushed the new change to my github repo, and then the PullRequest here was updated: https://github.com/gitgitgadget/git/pull/2155/changes

Show 8 quoted lines
> > and --git-dir and friends are spelled "--git-dir=-", which
> > accepts only "--git-dir=<path>", not the "--git-dir <path>" form.  I can
> > send patches for those separately.
> 
> We were discussing this recently in some threads about Bash
> completion, and I think we landed on "gitcli(1) really prefers the
> stuck form, and so do completion helpers, so let's stick with that for
> now" ?
Ok, sound good.
Show 8 quoted lines
> > I tried that and it works, but it changes what -C offers, which is more
> > than fixing the completion after -C, so I left it out; happy to send it
> > on top.  Two things to watch out for there: the accumulated path has to
> > be made absolute, as -W with ".." gave me the directories of "/", and
> > the accumulation has to stop before the word that is being completed.
> 
> A follow-up is fine with me if you decide to send it (and if not,
> that's fine, too).
Lets see if Ican find the time for that ;)

Would really love to see the change in git, makes me a bit proud that I added something to the one application almost all developers use.

Regards
Lutz
Previous: D. Ben KnobleNext: D. Ben Knoble
Message 8 of 15 in “completion: zsh: support completion after "git -C <path>"”
  1. completion: zsh: support completion after "git -C <path>"Lutz Lengemann via GitGitGadget, Jun 17, 2026
  2. Ben KnobleJun 17, 2026
  3. Junio C HamanoJun 17, 2026
  4. D. Ben KnobleJun 18, 2026
  5. D. Ben KnobleJul 14, 2026
  6. Lutz LengemannAug 17, 2026
  7. D. Ben KnobleAug 18, 2026
  8. Lutz LengemannAug 18, 2026
  9. D. Ben KnobleAug 18, 2026
  10. completion: zsh: support completion after "git -C <path>"Lutz Lengemann via GitGitGadget, Aug 19, 2026
  11. D. Ben KnobleAug 20, 2026
  12. Junio C HamanoAug 20, 2026
  13. D. Ben KnobleAug 21, 2026
  14. Junio C HamanoAug 21, 2026
  15. Junio C HamanoAug 26, 2026

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.