summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile6
-rw-r--r--README2
-rw-r--r--cgit.c2
-rw-r--r--cgit.h4
-rw-r--r--cgitrc.5.txt7
-rw-r--r--scan-tree.c4
-rw-r--r--shared.c4
-rw-r--r--ui-atom.c12
-rw-r--r--ui-log.c4
9 files changed, 35 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index ebf8f03..fe4b10e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,2 @@
-CGIT_VERSION = v0.8.3.3
+CGIT_VERSION = v0.8.3.4
CGIT_SCRIPT_NAME = cgit.cgi
@@ -81,3 +81,3 @@ endif
%.d: %.c
- $(QUIET_MM)$(CC) $(CFLAGS) -MM $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@
+ $(QUIET_MM)$(CC) $(CFLAGS) -MM -MP $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@
@@ -141,2 +141,4 @@ CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
+GIT_OPTIONS = prefix=/usr
+
ifdef NO_ICONV
diff --git a/README b/README
index 73ec332..050e21e 100644
--- a/README
+++ b/README
@@ -51,3 +51,3 @@ like this:
AllowOverride None
- Options ExecCGI
+ Options +ExecCGI
Order allow,deny
diff --git a/cgit.c b/cgit.c
index 96900bb..412fbf0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -123,2 +123,4 @@ void config_cb(const char *name, const char *value)
ctx.cfg.module_link = xstrdup(value);
+ else if (!strcmp(name, "strict-export"))
+ ctx.cfg.strict_export = xstrdup(value);
else if (!strcmp(name, "virtual-root")) {
diff --git a/cgit.h b/cgit.h
index 8f5dd2a..f5f68ac 100644
--- a/cgit.h
+++ b/cgit.h
@@ -178,2 +178,3 @@ struct cgit_config {
char *virtual_root;
+ char *strict_export;
int cache_size;
@@ -295,3 +296,4 @@ extern void cgit_diff_tree(const unsigned char *old_sha1,
-extern void cgit_diff_commit(struct commit *commit, filepair_fn fn);
+extern void cgit_diff_commit(struct commit *commit, filepair_fn fn,
+ const char *prefix);
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index ea1b18a..8e51ca5 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -319,2 +319,9 @@ summary-tags::
+strict-export::
+ Filename which, if specified, needs to be present within the repository
+ for cgit to allow access to that repository. This can be used to emulate
+ gitweb's EXPORT_OK and STRICT_EXPORT functionality and limit cgit's
+ repositories to match those exported by git-daemon. This option MUST come
+ before 'scan-path'.
+
virtual-root::
diff --git a/scan-tree.c b/scan-tree.c
index b5b50f3..a0e09ce 100644
--- a/scan-tree.c
+++ b/scan-tree.c
@@ -83,2 +83,6 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn)
}
+
+ if (ctx.cfg.strict_export && stat(fmt("%s/%s", path, ctx.cfg.strict_export), &st))
+ return;
+
if (!stat(fmt("%s/noweb", path), &st))
diff --git a/shared.c b/shared.c
index 72ac140..765cd27 100644
--- a/shared.c
+++ b/shared.c
@@ -340,3 +340,3 @@ void cgit_diff_tree(const unsigned char *old_sha1,
-void cgit_diff_commit(struct commit *commit, filepair_fn fn)
+void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
{
@@ -346,3 +346,3 @@ void cgit_diff_commit(struct commit *commit, filepair_fn fn)
old_sha1 = commit->parents->item->object.sha1;
- cgit_diff_tree(old_sha1, commit->object.sha1, fn, NULL,
+ cgit_diff_tree(old_sha1, commit->object.sha1, fn, prefix,
ctx.qry.ignorews);
diff --git a/ui-atom.c b/ui-atom.c
index 9f049ae..b218456 100644
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -26,3 +26,3 @@ void add_entry(struct commit *commit, char *host)
html("<updated>");
- cgit_print_date(info->author_date, FMT_ATOMDATE, ctx.cfg.local_time);
+ cgit_print_date(info->committer_date, FMT_ATOMDATE, 0);
html("</updated>\n");
@@ -51,3 +51,3 @@ void add_entry(struct commit *commit, char *host)
html("<published>");
- cgit_print_date(info->author_date, FMT_ATOMDATE, ctx.cfg.local_time);
+ cgit_print_date(info->author_date, FMT_ATOMDATE, 0);
html("</published>\n");
@@ -113,2 +113,10 @@ void cgit_print_atom(char *tip, char *path, int max_count)
html_txt(ctx.repo->name);
+ if (path) {
+ html("/");
+ html_txt(path);
+ }
+ if (tip && !ctx.qry.show_all) {
+ html(", branch ");
+ html_txt(tip);
+ }
html("</title>\n");
diff --git a/ui-log.c b/ui-log.c
index 41b5225..b9771fa 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -103,3 +103,3 @@ void print_commit(struct commit *commit)
rem_lines = 0;
- cgit_diff_commit(commit, inspect_files);
+ cgit_diff_commit(commit, inspect_files, ctx.qry.vpath);
html("</td><td>");
@@ -164,3 +164,3 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
- if (grep && pattern) {
+ if (grep && pattern && *pattern) {
if (!strcmp(grep, "grep") || !strcmp(grep, "author") ||