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

Adding more namespace support to git

From
Richard <richard.maw@gmail.com>
Date
Aug 20, 2016, 19:07 UTC
Message-ID
<CAB2VqoZh6zZV3Lk2B7dBPVE5h6H1LCwyxWrUo4yJFhqB=hAjig@mail.gmail.com>

I work on a git server called gitano. We've been using and recommending cgit for the web UI.

I've been working on adding git namespace support to both, so that we can separate administrative branches from code branches.

Because git is not namespace aware for anything but git-upload-pack and git-receive-pack, I've had to implement namespace parsing in cgit for listing branches, showing logs, displaying notes and commit decorations. It might be more useful if this support was added to git itself, so other git servers could make use of it so there's less duplicated code.

I think the way to do this would be to make the low-level ref reading functions, read_raw_ref, for_each_reflog_ent*, reflog_exists etc., interpret the ref they are passed as being relative to the current git namespace.

Since when upload-pack and receive-pack run hooks they leave GIT_NAMESPACE set there are hook scripts that expect that the current namespace is ignored, so commands that now want to be namespace aware would have to opt-in.

I tried adding a flag to the functions with the intention of changing everything to conditionally set the flag and adding wrapper functions to provide the old ABIs, but quickly abandoned that after seeing how much change would be required.

Is anyone more familiar with the codebase able to recommend how I might make it work, and would there any interest in accepting such patches if I got it to work?

Please reply-all in response, I am not subscribed to the mailing list.
Next: Josh Triplett
Message 1 of 7 in “Adding more namespace support to git”
  1. RichardAug 20, 2016
  2. Josh TriplettAug 21, 2016
  3. RichardAug 21, 2016
  4. Josh TriplettAug 21, 2016
  5. Jeff KingAug 24, 2016
  6. Josh TriplettAug 22, 2016
  7. RichardAug 22, 2016

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.