Thread (32 messages) 32 messages, 6 authors, 2025-04-08

Re: [PATCH 3/3] completion: fix bugs with slashes in remote names

From: D. Ben Knoble <hidden>
Date: 2025-03-13 17:40:59

On Fri, Mar 7, 2025 at 4:46 PM David Mandelberg [off-list ref] wrote:
Op 2025-03-06 om 15:24 schreef D. Ben Knoble:
quoted
I'm willing to manually test the patch if I can understand how to
reproduce the issue—it sounds like having a remote name with a slash
is sufficient?
Yup. I was able to reproduce it with these commands:

/tmp/tmp.zOjfmdMx1i$ git init foo
Initialized empty Git repository in /tmp/tmp.zOjfmdMx1i/foo/.git/
/tmp/tmp.zOjfmdMx1i$ cd foo
/tmp/tmp.zOjfmdMx1i/foo$ git remote add with/slash /path/does/not/matter
/tmp/tmp.zOjfmdMx1i/foo$ git commit -m 'test' --allow-empty
[main (root-commit) 4b95a99] test
/tmp/tmp.zOjfmdMx1i/foo$ git update-ref refs/remotes/with/slash/main 4b95a99

Then type:

git push with/slash :ma<Tab>
Thanks; in Zsh the results after :<Tab> are HEAD and main. After
:ma<Tab>, just main. The results with _no_ colon are HEAD, main,
with/slash/main. I think that's all the expected results?

My test procedure was to

git fetch <your PR tip>
mv /usr/local/share/zsh/site-functions/git-completion.bash{,.bak}
git show FETCH_HEAD:contrib/completion/git-completion.bash  >
/usr/local/share/zsh/site-functions/git-completion.bash
# adjust startup files to use `compinit -D` to avoid caches
<your test procedure>

-- 
D. Ben Knoble
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help