List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 00/17] Add support for namespaced repositories
@ 2016-07-02 19:28 richard.maw
  2016-07-02 19:28 ` [PATCH 01/17] Fix qry.head leak on error richard.maw
                   ` (17 more replies)
  0 siblings, 18 replies; 23+ messages in thread
From: richard.maw @ 2016-07-02 19:28 UTC (permalink / raw)


These patches are to support viewing the namespaces of a git repository
as independent git repositories.

You might want to do this for projects that share a lot of history
(e.g. systemd, udev and eudev), or to permit a user to "fork" a repository
so users on the same server can cheaply copy a large repository
to follow a GitHub-like pull-request process.

Namespace support in git isn't perfect,
only supporting enough operations for the recieve-pack and upload-pack commands.

This is enough to push to and pull from,
but not for viewing a namespaced repository's contents,
so this requires more work than just setting GIT_NAMESPACE.

This has been tested with browsing repositores,
cloning them over the dumb-http protocol
and downloading a snapshot of a namespaced tag.

As well as adding "repo.namespace",
this patch series adds "repo.agefile"
so that namespaced repositories can have their own age files,
and modifications to the contributed agefile post-receive hook.

Some ideas of other potentially useful changes related to namespaces include:

1.  Being able to set a default namespace globally.

    You might decide to put eveything in a namespace by default
    so that you can have additional namespaces alongside
    rather than inside the default namespace.

2.  Displaying git notes for all subnamespaces

    I had to make some changes to avoid displaying notes of the root namespace
    in other namespaces.

    I made it only display the commit notes for the current namespace,
    but since you can see all commits in subnamespaces,
    it might make sense to include those notes as well.

3.  Automatic discovery of namespaces with scan-path

    For a namespace to be useful it needs a HEAD symbolic ref.

    From what I can tell this is always unpacked on-disk,
    so it would be possible to extend the scan-path logic to look for HEADs.

4.  Smarter handling of README files.

    The repo.readme option lets you specify a readme as ref:file/path,
    so you could show the readme by prepending the namespace's base ref,
    but it might be better to have CGit do the prepending.

Richard Maw (17):
  Fix qry.head leak on error
  Fix archive generation
  Add a wrapper for get_sha1 called cgit_get_sha1
  Parse repo.namespace
  Print out parsed namespace on request
  Set GIT_NAMESPACE when repo.namespace is provided
  Look up refs in namespace with cgit_get_sha1
  Guess the default branch based on current namespace
  Add cgit_for_each_namespaced_ref_in helper
  Find the default branch based on the contents of the namespace
  Only display refs in current namespace
  Add namespace support to dumb-clone
  Display notes from namespace
  Add documentation for repo.namespace
  Allow agefile to be set per-repository
  Update contrib script to update agefiles per namespace
  Add documentation for repo.agefile

 cgit.c                             | 71 ++++++++++++++++++++++++++++++++------
 cgit.h                             |  6 ++++
 cgitrc.5.txt                       | 46 ++++++++++++++++++++++++
 contrib/hooks/post-receive.agefile | 15 +++++++-
 shared.c                           | 60 ++++++++++++++++++++++++++++++++
 ui-blob.c                          |  6 ++--
 ui-clone.c                         | 23 +++++++++++-
 ui-commit.c                        |  2 +-
 ui-diff.c                          |  4 +--
 ui-log.c                           |  2 +-
 ui-patch.c                         |  4 +--
 ui-plain.c                         |  2 +-
 ui-refs.c                          |  6 ++--
 ui-repolist.c                      |  3 +-
 ui-shared.c                        |  2 +-
 ui-snapshot.c                      | 14 ++++----
 ui-tag.c                           |  2 +-
 ui-tree.c                          |  2 +-
 18 files changed, 233 insertions(+), 37 deletions(-)

-- 
2.9.0



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-07-12  9:38 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-02 19:28 [PATCH 00/17] Add support for namespaced repositories richard.maw
2016-07-02 19:28 ` [PATCH 01/17] Fix qry.head leak on error richard.maw
2016-07-11 23:05   ` Jason
2016-07-02 19:28 ` [PATCH 02/17] Fix archive generation richard.maw
2016-07-02 19:28 ` [PATCH 03/17] Add a wrapper for get_sha1 called cgit_get_sha1 richard.maw
2016-07-11 23:12   ` Jason
2016-07-12  9:16     ` richard.maw
2016-07-12  9:38       ` Jason
2016-07-02 19:28 ` [PATCH 04/17] Parse repo.namespace richard.maw
2016-07-02 19:28 ` [PATCH 05/17] Print out parsed namespace on request richard.maw
2016-07-02 19:28 ` [PATCH 06/17] Set GIT_NAMESPACE when repo.namespace is provided richard.maw
2016-07-02 19:28 ` [PATCH 07/17] Look up refs in namespace with cgit_get_sha1 richard.maw
2016-07-02 19:28 ` [PATCH 08/17] Guess the default branch based on current namespace richard.maw
2016-07-02 19:28 ` [PATCH 09/17] Add cgit_for_each_namespaced_ref_in helper richard.maw
2016-07-02 19:28 ` [PATCH 10/17] Find the default branch based on the contents of the namespace richard.maw
2016-07-02 19:28 ` [PATCH 11/17] Only display refs in current namespace richard.maw
2016-07-02 19:28 ` [PATCH 12/17] Add namespace support to dumb-clone richard.maw
2016-07-02 19:28 ` [PATCH 13/17] Display notes from namespace richard.maw
2016-07-02 19:28 ` [PATCH 14/17] Add documentation for repo.namespace richard.maw
2016-07-02 19:28 ` [PATCH 15/17] Allow agefile to be set per-repository richard.maw
2016-07-02 19:28 ` [PATCH 16/17] Update contrib script to update agefiles per namespace richard.maw
2016-07-02 19:28 ` [PATCH 17/17] Add documentation for repo.agefile richard.maw
2016-07-02 20:02 ` [PATCH 00/17] Add support for namespaced repositories Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).