This uses the same age file as before if it's in the root namespace,
but puts the agefile in info/web/namespaces/$GIT_NAMESPACE/last-modified.
Signed-off-by: Richard Maw
---
contrib/hooks/post-receive.agefile | 15 ++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --
This replaces the previous behaviour of disambiguate_ref,
which would only prepend refs/heads to the branch name,
so would not disambiguate tags to their full refs.
Now when an abbreviated ref is provided
the namespace is prepended to it
as well as the disambiguating path.
Signed-off-by: Richard
This causes any namespace-aware code
to only handle refs under that namespace.
Currently this doesn't do much
as the only namespace aware code is in recieve-pack and upload-pack,
which are not handled by CGit.
Signed-off-by: Richard Maw
---
cgit.c | 5 +
1 file changed, 5 inser
resolving to libgit,
so this implements a subset of the ref parsing logic,
which we'll need to parse branches in links.
Signed-off-by: Richard Maw
---
cgit.h | 2 ++
shared.c | 45 +
2 files changed, 47 insertions(+)
diff --git a/cgit.h b/cgit.h
h "repo.agefile".
Signed-off-by: Richard Maw
---
cgit.c| 2 ++
cgit.h| 1 +
ui-repolist.c | 3 ++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/cgit.c b/cgit.c
index 321a00f..f7df288 100644
--- a/cgit.c
+++ b/cgit.c
@@ -88,6 +88,8 @@ static void rep
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 a/cgit.c b/cgit.c
-pack is not so tolerant, so try to avoid having such broken repos.
Signed-off-by: Richard Maw
---
cgit.c | 15 ++-
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/cgit.c b/cgit.c
index 5d55187..7b499ea 100644
--- a/cgit.c
+++ b/cgit.c
@@ -472,13 +472,18 @@ static char *find
trying to process it here,
since we can only do it once,
and we have other uses for the unexpanded name.
Signed-off-by: Richard Maw
---
cgit.c | 2 ++
cgit.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/cgit.c b/cgit.c
index 3763a30..304027c 100644
--- a/cgit.c
+++ b/cgit.c
@@ -45,6 +45,8
This will later be changed to include namespace resolution,
but the call sites are changed now to keep the changes small.
Signed-off-by: Richard Maw
---
cgit.c| 2 +-
cgit.h| 2 ++
shared.c | 5 +
ui-blob.c | 6 +++---
ui-commit.c | 2 +-
ui-diff.c | 4
es
of a sha1, an absolute ref, or a partial ref.
Signed-off-by: Richard Maw
---
shared.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/shared.c b/shared.c
index 77cb120..4c7bb9c 100644
--- a/shared.c
+++ b/shared.c
@@ -669,5 +669,19 @@ int cgit_namespaced_dwim_ref(const char
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
---
cgit.h
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 75f2789..3e4edad 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -183,9 +183,9 @@ void cgit_print_branches(int maxcount)
list.refs = NULL
.
The provided extra refs are globs rather than ref names,
but ref names may not contain glob characters so this is safe.
We get an annoying warning if the provided ref does not exist,
so we check whether the ref exists before attempting to provide it.
Signed-off-by: Richard Maw
---
cgit.c | 21
sification is not namespace aware,
so they need to be re-classified for HEAD and branches to be rendered.
Signed-off-by: Richard Maw
---
ui-log.c | 30 ++
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/ui-log.c b/ui-log.c
index 71ef3d4..fda2523 10064
Signed-off-by: Richard Maw
---
cgitrc.5.txt | 33 +
1 file changed, 33 insertions(+)
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 9fcf445..0de14a4 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -570,6 +570,11 @@ repo.max-stats::
repo.name::
The value
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 0de14a4..644e0ef 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -468,6 +468,10 @@ repo.about-filter::
Override the default about-filter
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 | 18 --
1 file
Unlike resolve_ref_unsafe, this does not return a substring or static buffer.
This is because the ref including the namespace can be longer.
Signed-off-by: Richard Maw
---
cgit.h | 2 ++
shared.c | 20
2 files changed, 22 insertions(+)
diff --git a/cgit.h b/cgit.h
index
ref,
since the archive is created by libgit code that is not namespace aware,
and it would try to resolve the ref again.
This previously worked fine
because it would resolve the ref the same way both times.
Signed-off-by: Richard Maw
---
ui-snapshot.c | 4 ++--
1 file changed, 2 insertions(+), 2
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 changed, 2 inser
tic because the string is not freed.
Signed-off-by: Richard Maw
---
cgit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cgit.c b/cgit.c
index 9427c4a..06c40ef 100644
--- a/cgit.c
+++ b/cgit.c
@@ -475,7 +475,7 @@ static char *guess_defbranch(void)
ref = resolve_ref_u
dding namespaced functions to libgit later in the week.
Richard Maw (21):
Return a copy of "master" when guessing defbranch fails
Fix archive generation
Add a wrapper for get_sha1 called cgit_get_sha1
Parse repo.na
:
git://git.gitano.org.uk/cgit.git
for you to fetch changes up to 2a20425f4e76e378c138094c79b78aa476c019b5:
Add documentation for repo.agefile (2016-07-13 20:09:37 +0100)
Richard Maw (16):
Fix archive generation
Add a wrapper for get_sha1 called cgit_get_sha1
Parse repo.namespace
trying to process it here,
since we can only do it once,
and we have other uses for the unexpanded name.
Signed-off-by: Richard Maw
---
cgit.c | 2 ++
cgit.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/cgit.c b/cgit.c
index 94d452c..e525264 100644
--- a/cgit.c
+++ b/cgit.c
@@ -45,6 +45,8
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 a/cgit.c b/cgit.c
ref,
since the archive is created by libgit code that is not namespace aware,
and it would try to resolve the ref again.
This previously worked fine
because it would resolve the ref the same way both times.
Signed-off-by: Richard Maw
---
ui-snapshot.c | 4 ++--
1 file changed, 2 insertions(+), 2
es
of a sha1, an absolute ref, or a partial ref.
Signed-off-by: Richard Maw
---
shared.c | 47 ++-
1 file changed, 46 insertions(+), 1 deletion(-)
diff --git a/shared.c b/shared.c
index d82c07b..81a5cd8 100644
--- a/shared.c
+++ b/shared.c
@@ -602,7 +6
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 changed, 2 inser
This causes any namespace-aware code
to only handle refs under that namespace.
Currently this doesn't do much
as the only namespace aware code is in recieve-pack and upload-pack,
which are not handled by CGit.
Signed-off-by: Richard Maw
---
cgit.c | 5 +
1 file changed, 5 inser
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
---
cgit.h
value in the namespace,
presumably preferring shorter ref names to longer ones.
Signed-off-by: Richard Maw
---
cgit.c | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/cgit.c b/cgit.c
index eae2f34..d9fe2b9 100644
--- a/cgit.c
+++ b/cgit.c
@@ -474,11 +474,17 @@ s
This will later be changed to include namespace resolution,
but the call sites are changed now to keep the changes small.
Signed-off-by: Richard Maw
---
cgit.c| 2 +-
cgit.h| 2 ++
shared.c | 5 +
ui-blob.c | 6 +++---
ui-commit.c | 2 +-
ui-diff.c | 4
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 6116d1b..db22269 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -468,6 +468,10 @@ repo.about-filter::
Override the default about-filter
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 deletion(-)
diff --
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 9fcf445..6116d1b 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -570,6 +570,10 @@ repo.max-stats::
repo.name::
The value
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 ++-
1
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 75f2789..3e4edad 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -183,9 +183,9 @@ void cgit_print_branches(int maxcount)
list.refs = NULL
h "repo.agefile".
Signed-off-by: Richard Maw
---
cgit.c| 2 ++
cgit.h| 1 +
ui-repolist.c | 3 ++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/cgit.c b/cgit.c
index d428019..a87f245 100644
--- a/cgit.c
+++ b/cgit.c
@@ -88,6 +88,8 @@ static void rep
.
The provided extra refs are globs rather than ref names,
so we should escape them to be sure.
We get an annoying warning if the provided ref does not exist,
so we check whether the ref exists before attempting to provide it.
Signed-off-by: Richard Maw
---
cgit.c | 34
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::
repo.name::
The value
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 deletion(-)
diff --
h "repo.agefile".
Signed-off-by: Richard Maw
---
cgit.c| 2 ++
cgit.h| 1 +
ui-repolist.c | 3 ++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/cgit.c b/cgit.c
index d428019..a87f245 100644
--- a/cgit.c
+++ b/cgit.c
@@ -88,6 +88,8 @@ static void rep
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 default about-filter
ref,
since the archive is created by libgit code that is not namespace aware,
and it would try to resolve the ref again.
This previously worked fine
because it would resolve the ref the same way both times.
Signed-off-by: Richard Maw
---
ui-snapshot.c | 4 ++--
1 file changed, 2 insertions(+), 2
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 @@ stati
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 ++-
1
.
The provided extra refs are globs rather than ref names,
so we should escape them to be sure.
We get an annoying warning if the provided ref does not exist,
so we check whether the ref exists before attempting to provide it.
Signed-off-by: Richard Maw
---
cgit.c | 34
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 a/cgit.c b/cgit.c
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
---
cgit.h
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
This causes any namespace-aware code
to only handle refs under that namespace.
Currently this doesn't do much
as the only namespace aware code is in recieve-pack and upload-pack,
which are not handled by CGit.
Signed-off-by: Richard Maw
---
cgit.c | 5 +
1 file changed, 5 inser
This will later be changed to include namespace resolution,
but the call sites are changed now to keep the changes small.
Signed-off-by: Richard Maw
---
cgit.c| 2 +-
cgit.h| 2 ++
shared.c | 5 +
ui-blob.c | 6 +++---
ui-commit.c | 2 +-
ui-diff.c | 4
trying to process it here,
since we can only do it once,
and we have other uses for the unexpanded name.
Signed-off-by: Richard Maw
---
cgit.c | 2 ++
cgit.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/cgit.c b/cgit.c
index 94d452c..e525264 100644
--- a/cgit.c
+++ b/cgit.c
@@ -45,6 +45,8
es
of a sha1, an absolute ref, or a partial ref.
Signed-off-by: Richard Maw
---
shared.c | 47 ++-
1 file changed, 46 insertions(+), 1 deletion(-)
diff --git a/shared.c b/shared.c
index d82c07b..81a5cd8 100644
--- a/shared.c
+++ b/shared.c
@@ -602,7 +6
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 changed, 2 inser
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)
list.refs = NULL
value in the namespace,
presumably preferring shorter ref names to longer ones.
Signed-off-by: Richard Maw
---
cgit.c | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/cgit.c b/cgit.c
index eae2f34..d9fe2b9 100644
--- a/cgit.c
+++ b/cgit.c
@@ -474,11 +474,17 @@ s
On Sat, Jun 25, 2016 at 04:46:26PM +0100, Richard Maw wrote:
> On Tue, May 10, 2016 at 02:21:36PM +0100, John Keeping wrote:
> > On Mon, May 09, 2016 at 10:54:44PM +0100, Daniel Silverstone wrote:
> > > On Mon, May 09, 2016 at 22:31:37 +0100, John Keeping wrote:
> > >
Hi all.
I thought I'd give an update,
since I managed to find time to make an attempt at this.
On Tue, May 10, 2016 at 02:21:36PM +0100, John Keeping wrote:
> On Mon, May 09, 2016 at 10:54:44PM +0100, Daniel Silverstone wrote:
> > On Mon, May 09, 2016 at 22:31:37 +0100, John Keeping wrote:
> > >
59 matches
Mail list logo