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

ref-in-want does not consider namespace

From
Kim Altintop <kim@eagain.st>
Date
Jul 26, 2021, 08:36 UTC
Message-ID
<CD2XNXHACAXS.13J6JTWZPO1JA@schmidt>
Hello,

I am experimenting with the ref-in-want feature using a custom client and plain `git-upload-pack` on the server end. To my suprise, it turned out that fetching from a namespaced repository requires the `want-ref` lines to specify the refs in namespaced form. That is:

Say I have the ref `refs/namespaces/foo/refs/heads/main`. I launch upload-pack with `--namespace=foo`. Running `ls-refs` with a namespace-relative

  `ref-prefix refs/heads/*`
will work as expected, but sendingr
  `want-ref refs/heads/main`
will result in
  `ERR unknown ref refs/heads/main`
Sending
  `want-ref refs/namespaces/foo/refs/heads/main`

works, and the corresponding `wanted-refs` section will contain the ref as given (ie. including the namespace path).

Since my understanding of git namespaces is that they should be transparent to the client, I find this surprising.

I dug up an early version of a patch introducing the feature, which did handle namespaces [0], but what eventually landed (authored by Brandon Williams) didn't.

Was this an oversight, or is there a specific reason for the behaviour?

Thanks, Kim

[0]: https://lore.kernel.org/git/d0d42b3bb4cf755f122591e191354c53848f197d.1485381677.git.jonathantanmy@google.com/
Next: Kim Altintop
Message 1 of 4 in “ref-in-want does not consider namespace”
  1. Kim AltintopJul 26, 2021
  2. Kim AltintopJul 26, 2021
  3. Jonathan TanJul 26, 2021
  4. Kim AltintopJul 27, 2021

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.