Re: [PATCH] Avoid ambiguities when prettifying snapshot names

2016-07-02 Thread Lukas Fleischer
On Tue, 24 May 2016 at 18:15:18, Lukas Fleischer wrote: > When composing snapshot file names for a tag with a prefix of the form > v[0-9] (resp. V[0-9]), the leading "v" (resp. "V") is stripped. This > leads to conflicts if a tag with the stripped name already exists or if > there are tags only

[PATCH 11/17] Only display refs in current namespace

2016-07-02 Thread Richard Maw
Signed-off-by: Richard Maw --- ui-refs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui-refs.c b/ui-refs.c index 5b4530e..f21797b 100644 --- a/ui-refs.c +++ b/ui-refs.c @@ -189,9 +189,9 @@ void cgit_print_branches(int maxcount)

[PATCH 10/17] Find the default branch based on the contents of the namespace

2016-07-02 Thread Richard Maw
The find_current_ref callback does not need to be modified to strip off the namespace prefix, since the for_each_ref functions don't include the base ref prefix. Signed-off-by: Richard Maw --- cgit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 09/17] Add cgit_for_each_namespaced_ref_in helper

2016-07-02 Thread Richard Maw
libgit has a for_each_namespaced_ref, but lacks equivalents for just branches, tags or remotes. Rather than implementing all of those helpers, it's more convenient to implement just one that prepends the namespace to the provided ref base. Signed-off-by: Richard Maw ---

[PATCH 00/17] Add support for namespaced repositories

2016-07-02 Thread Richard Maw
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

[PATCH 08/17] Guess the default branch based on current namespace

2016-07-02 Thread Richard Maw
resolve_ref_unsafe() can't be told to be namespace aware, so we need to prepend the namespace beforehand. Additionally, we need to add the RESOLVE_REF_NO_RECURSE flag, since otherwise if the commit that is pointed to exists in the root namespace, it will opt to return that rather than the value

[PATCH 16/17] Update contrib script to update agefiles per namespace

2016-07-02 Thread Richard Maw
This uses the same age file as before if it's in the root namespace, but puts the agefile in info/web/namespaced/$GIT_NAMESPACE/last-modified. Signed-off-by: Richard Maw --- contrib/hooks/post-receive.agefile | 15 ++- 1 file changed, 14 insertions(+), 1

[PATCH 15/17] Allow agefile to be set per-repository

2016-07-02 Thread Richard Maw
This adds "repo.agefile", since namespaced repositories share the same files, and we'd like to be able to see the ages of the refs for each namespace. Whatever the git server uses for updating the age file must be namespace aware and must write the age file to a path consistent with

[PATCH 17/17] Add documentation for repo.agefile

2016-07-02 Thread Richard Maw
Signed-off-by: Richard Maw --- cgitrc.5.txt | 14 ++ 1 file changed, 14 insertions(+) diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 59127f8..b449338 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -468,6 +468,10 @@ repo.about-filter:: Override the

[PATCH 04/17] Parse repo.namespace

2016-07-02 Thread Richard Maw
This contains the unexpanded name of the namespace rather than the base ref of the namespace, since the git namespace mechanism works by setting GIT_NAMESPACE and on the first call to get_git_namespace() it gets expanded. We need to save this for a later call to prepare_repo_cmd, rather than

[PATCH 01/17] Fix qry.head leak on error

2016-07-02 Thread Richard Maw
This is run soon before exiting so it wasn't leaked for long. Signed-off-by: Richard Maw --- cgit.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cgit.c b/cgit.c index ab3fadb..9427c4a 100644 --- a/cgit.c +++ b/cgit.c @@ -616,11 +616,11 @@

[PATCH 07/17] Look up refs in namespace with cgit_get_sha1

2016-07-02 Thread Richard Maw
This causes all ref resolving to look for the requested branch inside the current namespace. Previously any form of git revision would be accepted, but ref resolving isn't namespace aware and it would be infeasible to replicate all its behaviour, so we stick to providing the most common cases of

[PATCH 12/17] Add namespace support to dumb-clone

2016-07-02 Thread Richard Maw
This requires namespacing the HEAD symbolic ref and the list of refs. Sending HEAD required some tweaking, since the file itself refers to a namespaced ref, but we want to provide the ref with its namespace stripped off. Signed-off-by: Richard Maw --- ui-clone.c | 23

[PATCH 14/17] Add documentation for repo.namespace

2016-07-02 Thread Richard Maw
Signed-off-by: Richard Maw --- cgitrc.5.txt | 32 1 file changed, 32 insertions(+) diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 2e1912d..59127f8 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -570,6 +570,10 @@ repo.max-stats::

[PATCH 02/17] Fix archive generation

2016-07-02 Thread Richard Maw
The get_ref_from_filename function is expected to return a sha1. It didn't actually do this, instead returning the ref that would under normal circumstances resolve to that. Since we're going to resolve refs in a way that is namespace aware we need to return the sha1 rather than the ref, since

[PATCH 05/17] Print out parsed namespace on request

2016-07-02 Thread Richard Maw
This is not strictly necessary, as we do not have any way to generate namespace entries from a scan-path, but I'd rather not leave this as a surprise to someone who comes up with a good namespace discovery mechanism. Signed-off-by: Richard Maw --- cgit.c | 2 ++ 1 file

Re: [PATCH 00/17] Add support for namespaced repositories

2016-07-02 Thread Jason A. Donenfeld
Hi Richard, This looks like really cool work. I'll review it this week and get back to you. Thanks for submitting. Jason ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit