git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] completion: fix bugs with slashes in remote names
@ 2025-03-02  7:45 David Mandelberg via GitGitGadget
  2025-03-02  7:45 ` [PATCH 1/3] completion: add helper to escape strings for fnmatch David Mandelberg via GitGitGadget
                   ` (5 more replies)
  0 siblings, 6 replies; 44+ messages in thread
From: David Mandelberg via GitGitGadget @ 2025-03-02  7:45 UTC (permalink / raw)
  To: git; +Cc: Jacob Keller, Junio C Hamano, David Mandelberg

Previously, some calls to for-each-ref passed fixed numbers of path
components to strip from refs, assuming that remote names had no slashes in
them. This made completions like:

git push github/dseomn :com

Result in:

git push github/dseomn :dseomn/completion-remote-slash

With this patch, it instead results in:

git push github/dseomn :completion-remote-slash

In addition, the change to __git_dwim_remote_heads() restricts it to only
list remote branches, not HEAD. I think that actually improves the
completion where it's used though, since HEAD doesn't seem to be valid
anyway:

$ git switch HEAD fatal: a branch is expected, got 'HEAD'

David Mandelberg (3):
  completion: add helper to escape strings for fnmatch
  completion: add helper to count path components
  completion: fix bugs with slashes in remote names

 contrib/completion/git-completion.bash |  40 ++++-
 t/t9902-completion.sh                  | 213 ++++++++++++++++++++++---
 2 files changed, 225 insertions(+), 28 deletions(-)


base-commit: cb0ae672aeabefca9704477ea8018ac94f523970
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1901%2Fdseomn%2Fcompletion-remote-slash-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1901/dseomn/completion-remote-slash-v1
Pull-Request: https://github.com/git/git/pull/1901
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2025-04-08 18:55 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-02  7:45 [PATCH 0/3] completion: fix bugs with slashes in remote names David Mandelberg via GitGitGadget
2025-03-02  7:45 ` [PATCH 1/3] completion: add helper to escape strings for fnmatch David Mandelberg via GitGitGadget
2025-03-02  7:45 ` [PATCH 2/3] completion: add helper to count path components David Mandelberg via GitGitGadget
2025-03-02  7:45 ` [PATCH 3/3] completion: fix bugs with slashes in remote names David Mandelberg via GitGitGadget
2025-03-02 14:17   ` Phillip Wood
2025-03-02 20:34     ` David Mandelberg
2025-03-03 16:36       ` phillip.wood123
2025-03-03 19:19         ` David Mandelberg
2025-03-03 19:43           ` Todd Zullinger
2025-03-06 20:26             ` D. Ben Knoble
2025-03-06 20:24           ` D. Ben Knoble
2025-03-06 20:38             ` Junio C Hamano
2025-03-07 10:34             ` phillip.wood123
2025-03-07 21:46             ` David Mandelberg
2025-03-13 17:40               ` D. Ben Knoble
2025-03-13 20:19                 ` David Mandelberg
2025-03-03 20:29         ` Junio C Hamano
2025-03-03 19:33       ` SZEDER Gábor
2025-03-03 19:49         ` David Mandelberg
2025-03-06 20:46   ` Junio C Hamano
2025-03-07 20:11     ` David Mandelberg
2025-03-07 20:57       ` Junio C Hamano
2025-03-07 21:38         ` David Mandelberg
2025-03-07 21:45           ` Junio C Hamano
2025-03-05  0:07 ` [PATCH v2 0/2] " David Mandelberg
2025-03-05  0:08   ` [PATCH v2 1/2] completion: add helper to count path components David Mandelberg
2025-03-05  0:09   ` [PATCH v2 2/2] completion: fix bugs with slashes in remote names David Mandelberg
2025-03-05 20:50     ` David Mandelberg
2025-03-06 16:35       ` Phillip Wood
2025-03-06 17:12         ` David Mandelberg
2025-03-06 17:39           ` Phillip Wood
2025-03-14 19:40 ` [PATCH v3 0/2] " David Mandelberg
2025-03-14 19:41   ` [PATCH v3 1/2] completion: add helper to count path components David Mandelberg
2025-03-14 19:43   ` [PATCH v3 2/2] completion: fix bugs with slashes in remote names David Mandelberg
2025-03-14 22:18     ` Junio C Hamano
2025-03-14 22:37       ` David Mandelberg
2025-03-14 23:23         ` Junio C Hamano
2025-03-18 17:02           ` Phillip Wood
2025-03-18 17:27             ` Junio C Hamano
2025-03-23 21:04 ` [PATCH v4 0/2] " David Mandelberg
2025-03-23 21:05   ` [PATCH v4 1/2] completion: add helper to count path components David Mandelberg
2025-03-23 21:06   ` [PATCH v4 2/2] completion: fix bugs with slashes in remote names David Mandelberg
2025-04-08 14:18   ` [PATCH v4 0/2] " Phillip Wood
2025-04-08 18:55     ` David Mandelberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).