summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show 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,3 +1,3 @@
1CGIT_VERSION = v0.8.3.3 1CGIT_VERSION = v0.8.3.4
2CGIT_SCRIPT_NAME = cgit.cgi 2CGIT_SCRIPT_NAME = cgit.cgi
3CGIT_SCRIPT_PATH = /var/www/htdocs/cgit 3CGIT_SCRIPT_PATH = /var/www/htdocs/cgit
@@ -80,5 +80,5 @@ endif
80# 80#
81%.d: %.c 81%.d: %.c
82 $(QUIET_MM)$(CC) $(CFLAGS) -MM $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@ 82 $(QUIET_MM)$(CC) $(CFLAGS) -MM -MP $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@
83 83
84# 84#
@@ -140,4 +140,6 @@ CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
140CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' 140CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
141 141
142GIT_OPTIONS = prefix=/usr
143
142ifdef NO_ICONV 144ifdef NO_ICONV
143 CFLAGS += -DNO_ICONV 145 CFLAGS += -DNO_ICONV
diff --git a/README b/README
index 73ec332..050e21e 100644
--- a/README
+++ b/README
@@ -50,5 +50,5 @@ like this:
50 <Directory "/var/www/htdocs/cgit/"> 50 <Directory "/var/www/htdocs/cgit/">
51 AllowOverride None 51 AllowOverride None
52 Options ExecCGI 52 Options +ExecCGI
53 Order allow,deny 53 Order allow,deny
54 Allow from all 54 Allow from all
diff --git a/cgit.c b/cgit.c
index 96900bb..412fbf0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -122,4 +122,6 @@ void config_cb(const char *name, const char *value)
122 else if (!strcmp(name, "module-link")) 122 else if (!strcmp(name, "module-link"))
123 ctx.cfg.module_link = xstrdup(value); 123 ctx.cfg.module_link = xstrdup(value);
124 else if (!strcmp(name, "strict-export"))
125 ctx.cfg.strict_export = xstrdup(value);
124 else if (!strcmp(name, "virtual-root")) { 126 else if (!strcmp(name, "virtual-root")) {
125 ctx.cfg.virtual_root = trim_end(value, '/'); 127 ctx.cfg.virtual_root = trim_end(value, '/');
diff --git a/cgit.h b/cgit.h
index 8f5dd2a..f5f68ac 100644
--- a/cgit.h
+++ b/cgit.h
@@ -177,4 +177,5 @@ struct cgit_config {
177 char *section; 177 char *section;
178 char *virtual_root; 178 char *virtual_root;
179 char *strict_export;
179 int cache_size; 180 int cache_size;
180 int cache_dynamic_ttl; 181 int cache_dynamic_ttl;
@@ -294,5 +295,6 @@ extern void cgit_diff_tree(const unsigned char *old_sha1,
294 filepair_fn fn, const char *prefix, int ignorews); 295 filepair_fn fn, const char *prefix, int ignorews);
295 296
296extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); 297extern void cgit_diff_commit(struct commit *commit, filepair_fn fn,
298 const char *prefix);
297 299
298__attribute__((format (printf,1,2))) 300__attribute__((format (printf,1,2)))
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index ea1b18a..8e51ca5 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -318,4 +318,11 @@ summary-tags::
318 view. Default value: "10". 318 view. Default value: "10".
319 319
320strict-export::
321 Filename which, if specified, needs to be present within the repository
322 for cgit to allow access to that repository. This can be used to emulate
323 gitweb's EXPORT_OK and STRICT_EXPORT functionality and limit cgit's
324 repositories to match those exported by git-daemon. This option MUST come
325 before 'scan-path'.
326
320virtual-root:: 327virtual-root::
321 Url which, if specified, will be used as root for all cgit links. It 328 Url which, if specified, will be used as root for all cgit links. It
diff --git a/scan-tree.c b/scan-tree.c
index b5b50f3..a0e09ce 100644
--- a/scan-tree.c
+++ b/scan-tree.c
@@ -82,4 +82,8 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn)
82 return; 82 return;
83 } 83 }
84
85 if (ctx.cfg.strict_export && stat(fmt("%s/%s", path, ctx.cfg.strict_export), &st))
86 return;
87
84 if (!stat(fmt("%s/noweb", path), &st)) 88 if (!stat(fmt("%s/noweb", path), &st))
85 return; 89 return;
diff --git a/shared.c b/shared.c
index 72ac140..765cd27 100644
--- a/shared.c
+++ b/shared.c
@@ -339,5 +339,5 @@ void cgit_diff_tree(const unsigned char *old_sha1,
339} 339}
340 340
341void cgit_diff_commit(struct commit *commit, filepair_fn fn) 341void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
342{ 342{
343 unsigned char *old_sha1 = NULL; 343 unsigned char *old_sha1 = NULL;
@@ -345,5 +345,5 @@ void cgit_diff_commit(struct commit *commit, filepair_fn fn)
345 if (commit->parents) 345 if (commit->parents)
346 old_sha1 = commit->parents->item->object.sha1; 346 old_sha1 = commit->parents->item->object.sha1;
347 cgit_diff_tree(old_sha1, commit->object.sha1, fn, NULL, 347 cgit_diff_tree(old_sha1, commit->object.sha1, fn, prefix,
348 ctx.qry.ignorews); 348 ctx.qry.ignorews);
349} 349}
diff --git a/ui-atom.c b/ui-atom.c
index 9f049ae..b218456 100644
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -25,5 +25,5 @@ void add_entry(struct commit *commit, char *host)
25 html("</title>\n"); 25 html("</title>\n");
26 html("<updated>"); 26 html("<updated>");
27 cgit_print_date(info->author_date, FMT_ATOMDATE, ctx.cfg.local_time); 27 cgit_print_date(info->committer_date, FMT_ATOMDATE, 0);
28 html("</updated>\n"); 28 html("</updated>\n");
29 html("<author>\n"); 29 html("<author>\n");
@@ -50,5 +50,5 @@ void add_entry(struct commit *commit, char *host)
50 html("</author>\n"); 50 html("</author>\n");
51 html("<published>"); 51 html("<published>");
52 cgit_print_date(info->author_date, FMT_ATOMDATE, ctx.cfg.local_time); 52 cgit_print_date(info->author_date, FMT_ATOMDATE, 0);
53 html("</published>\n"); 53 html("</published>\n");
54 if (host) { 54 if (host) {
@@ -112,4 +112,12 @@ void cgit_print_atom(char *tip, char *path, int max_count)
112 html("<title>"); 112 html("<title>");
113 html_txt(ctx.repo->name); 113 html_txt(ctx.repo->name);
114 if (path) {
115 html("/");
116 html_txt(path);
117 }
118 if (tip && !ctx.qry.show_all) {
119 html(", branch ");
120 html_txt(tip);
121 }
114 html("</title>\n"); 122 html("</title>\n");
115 html("<subtitle>"); 123 html("<subtitle>");
diff --git a/ui-log.c b/ui-log.c
index 41b5225..b9771fa 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -102,5 +102,5 @@ void print_commit(struct commit *commit)
102 add_lines = 0; 102 add_lines = 0;
103 rem_lines = 0; 103 rem_lines = 0;
104 cgit_diff_commit(commit, inspect_files); 104 cgit_diff_commit(commit, inspect_files, ctx.qry.vpath);
105 html("</td><td>"); 105 html("</td><td>");
106 htmlf("%d", files); 106 htmlf("%d", files);
@@ -163,5 +163,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
163 argv[1] = disambiguate_ref(tip); 163 argv[1] = disambiguate_ref(tip);
164 164
165 if (grep && pattern) { 165 if (grep && pattern && *pattern) {
166 if (!strcmp(grep, "grep") || !strcmp(grep, "author") || 166 if (!strcmp(grep, "grep") || !strcmp(grep, "author") ||
167 !strcmp(grep, "committer")) 167 !strcmp(grep, "committer"))