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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 7, 2025, 20:57 UTC
Message-ID
<xmqqtt84d0dz.fsf@gitster.g>
In-Reply-To
<05bf397e-4bc2-4255-87b5-925c80667f4c@mandelberg.org>
David Mandelberg <david@mandelberg.org> writes:
> I'm not sure if I'm remembering right, but I think I got the idea from
> seeing slashes in branch names to organize a hierarchy of branches,
> and realizing I could do the same with remotes. Was it intentional to
> allow slash in branch names, or is that a similar situation?
Reference names were hierarchical pretty much from the beginning.
Show 10 quoted lines
>> Anyway, this is not something we'd do lightly, but we may want to
>> see if we should tighten the naming rules for remote nicknames and
>> the mapping from nicknames to remote-tracking hiearchy, at Git 3.0
>> version boundary.
>
> What does that mean for this patch now? Do you want to fix the
> completion for the currently (unintentionally) supported remote names,
> or leave it broken to discourage their use? Fixing the completion
> might also give anybody reading the completion script the idea that
> slashes in remote names are somewhat sanctioned.

It probably would not mean much either way, and certainly not something we should worry about during pre-release feature freeze.

The "fix" may take quite different shapes. Remote nick/name may still be allowed but the default fetch refspec left by "git clone" would start using the refs/remotes/nick-name/ hierarchy instead of the refs/remotes/nick/name hierarchy, for example, but as long as this round of completion fixes properly read the configuration to learn the remote-tracking hierarchy by reading the configured value of "remote.nick/name.fetch", such a change would not break the code in the completion script at all. Or remote nick/name may outright banned and people are encouraged to use nick-name instead, in which case even if the completion code is prepared to accept remote names with slashes in it, as long as it still works correctly with remote names with no slashes in it, it will keep working in such a future.

Or the "fix" may be to declare "there is nothing to fix, if people want to use

    [remote "nick/name"] fetch = +refs/heads/*:refs/remotes/nickname/*
    [remote "nocknyme"] fetch = +refs/heads/*:refs/remotes/nock/nyme/*

that's their choice, and the completion code would do the right thing anyway".

I didn't read your patches, so the situation may be different and with any shape of "fix", or without any "fix", there might still be need for further polishing. But hopefully you got the idea. For this particular patch, there is nothing urgently needed. Well, we are right now in the pre-release feature freeze anyway ;-).

Thanks.
Previous: David MandelbergNext: David Mandelberg
Message 22 of 44 in “completion: fix bugs with slashes in remote names”
  1. 0/3 completion: fix bugs with slashes in remote namesDavid Mandelberg via GitGitGadget, Mar 2, 2025
  2. 1/3 completion: add helper to escape strings for fnmatchDavid Mandelberg via GitGitGadget, Mar 2, 2025
  3. 2/3 completion: add helper to count path componentsDavid Mandelberg via GitGitGadget, Mar 2, 2025
  4. 3/3 completion: fix bugs with slashes in remote namesDavid Mandelberg via GitGitGadget, Mar 2, 2025
  5. Phillip WoodMar 2, 2025
  6. David MandelbergMar 2, 2025
  7. phillip.wood123@gmail.comMar 3, 2025
  8. David MandelbergMar 3, 2025
  9. Todd ZullingerMar 3, 2025
  10. D. Ben KnobleMar 6, 2025
  11. D. Ben KnobleMar 6, 2025
  12. Junio C HamanoMar 6, 2025
  13. phillip.wood123@gmail.comMar 7, 2025
  14. David MandelbergMar 7, 2025
  15. D. Ben KnobleMar 13, 2025
  16. David MandelbergMar 13, 2025
  17. Junio C HamanoMar 3, 2025
  18. SZEDER GáborMar 3, 2025
  19. David MandelbergMar 3, 2025
  20. Junio C HamanoMar 6, 2025
  21. David MandelbergMar 7, 2025
  22. Junio C HamanoMar 7, 2025
  23. David MandelbergMar 7, 2025
  24. Junio C HamanoMar 7, 2025
  25. 0/2 completion: fix bugs with slashes in remote namesDavid Mandelberg, Mar 5, 2025
  26. 1/2 completion: add helper to count path componentsDavid Mandelberg, Mar 5, 2025
  27. 2/2 completion: fix bugs with slashes in remote namesDavid Mandelberg, Mar 5, 2025
  28. David MandelbergMar 5, 2025
  29. Phillip WoodMar 6, 2025
  30. David MandelbergMar 6, 2025
  31. Phillip WoodMar 6, 2025
  32. 0/2 completion: fix bugs with slashes in remote namesDavid Mandelberg, Mar 14, 2025
  33. 1/2 completion: add helper to count path componentsDavid Mandelberg, Mar 14, 2025
  34. 2/2 completion: fix bugs with slashes in remote namesDavid Mandelberg, Mar 14, 2025
  35. Junio C HamanoMar 14, 2025
  36. David MandelbergMar 14, 2025
  37. Junio C HamanoMar 14, 2025
  38. Phillip WoodMar 18, 2025
  39. Junio C HamanoMar 18, 2025
  40. 0/2 completion: fix bugs with slashes in remote namesDavid Mandelberg, Mar 23, 2025
  41. 1/2 completion: add helper to count path componentsDavid Mandelberg, Mar 23, 2025
  42. 2/2 completion: fix bugs with slashes in remote namesDavid Mandelberg, Mar 23, 2025
  43. Phillip WoodApr 8, 2025
  44. David MandelbergApr 8, 2025

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.