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

[PATCHv5 0/4] Support ref namespaces

From
Jamey Sharp <jamey@minilop.net>
Date
Jun 3, 2011, 21:29 UTC
Message-ID
<1307136593-16306-1-git-send-email-jamey@minilop.net>
From: Josh Triplett <josh@joshtriplett.org>

This series adds support for dividing the refs of a single repository into multiple namespaces, each of which can have its own branches, tags, and HEAD. Git can expose each namespace as an independent repository to pull from and push to, while sharing the object store, and exposing all the refs to operations such as git-gc.

Storing multiple repositories as namespaces of a single repository avoids storing duplicate copies of the same objects, such as when storing multiple branches of the same source. The alternates mechanism provides similar support for avoiding duplicates, but alternates do not prevent duplication between new objects added to the repositories without ongoing maintenance, while namespaces do.

The first patch is a bugfix; it's important regardless, but we need it to correctly implement for_each_namespaced_ref later. The next two patches implement and then use infrastructure for tracking the current namespace and iterating over the refs in that namespace. The last patch adds general documentation for namespaces, and specific references from the documentation on receive-pack, upload-pack, http-backend, and git.

v5 of this series incorporates some additional feedback from Junio: patch 1/4 now fixes the existing ref iteration functions to filter out refs that don't start with "refs/", rather than preserving the existing behavior of iterating over all refs and ignoring the prefix. Patch 3/4 now refactors the logic for handling "capabilities^{}" to make it less of a special case, and moves the call to strip_namespace into a wrapper function used only when *not* passing "capabilities^{}".

We've also taken Jakub Narebski's suggestion of including a cover letter. :-)

Jamey Sharp and Josh Triplett (4):
  Fix prefix handling in ref iteration functions
  Add infrastructure for ref namespaces
  Support ref namespaces for remote repositories via upload-pack and
    receive-pack
  Add documentation for ref namespaces
 Documentation/Makefile                 |    2 +-
 Documentation/git-http-backend.txt     |    8 ++++
 Documentation/git-receive-pack.txt     |    2 +-
 Documentation/git-upload-pack.txt      |    4 ++
 Documentation/git.txt                  |   13 +++++-
 Documentation/gitnamespaces.txt        |   71 ++++++++++++++++++++++++++++++++
 builtin/receive-pack.c                 |   34 ++++++++++++---
 cache.h                                |    3 +
 contrib/completion/git-completion.bash |    3 +-
 environment.c                          |   41 ++++++++++++++++++
 git.c                                  |   18 +++++++-
 refs.c                                 |   27 ++++++++++++-
 refs.h                                 |    3 +
 upload-pack.c                          |   15 ++++---
 14 files changed, 223 insertions(+), 21 deletions(-)
 create mode 100644 Documentation/gitnamespaces.txt
-- 
1.7.5.3
Next: Jamey Sharp
Message 1 of 9 in “[PATCHv5 0/4] Support ref namespaces”
  1. Jamey SharpJun 3, 2011
  2. 1/4 Fix prefix handling in ref iteration functionsJamey Sharp, Jun 3, 2011
  3. 2/4 Add infrastructure for ref namespacesJamey Sharp, Jun 3, 2011
  4. Junio C HamanoJun 3, 2011
  5. Josh TriplettJun 3, 2011
  6. 3/4 Support ref namespaces for remote repositories via upload-pack and receive-packJamey Sharp, Jun 3, 2011
  7. 4/4 Add documentation for ref namespacesJamey Sharp, Jun 3, 2011
  8. Junio C HamanoJun 3, 2011
  9. Josh TriplettJun 3, 2011

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.