aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--README9
-rw-r--r--cgit.c28
-rw-r--r--cgit.css42
-rw-r--r--cgit.h6
-rw-r--r--cgit.pngbin1840 -> 1488 bytes
-rw-r--r--cgitrc.5.txt40
-rw-r--r--cmd.c3
m---------git0
-rw-r--r--html.c6
-rw-r--r--parsing.c24
-rw-r--r--scan-tree.c21
-rw-r--r--shared.c1
-rw-r--r--ui-diff.c19
-rw-r--r--ui-diff.h6
-rw-r--r--ui-log.c287
-rw-r--r--ui-log.h3
-rw-r--r--ui-shared.c20
-rw-r--r--ui-ssdiff.c34
-rw-r--r--ui-summary.c2
-rw-r--r--ui-tree.c2
-rw-r--r--vector.c38
-rw-r--r--vector.h17
23 files changed, 485 insertions, 130 deletions
diff --git a/Makefile b/Makefile
index fe4b10e..af2879e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
1CGIT_VERSION = v0.8.3.4 1CGIT_VERSION = v0.9
2CGIT_SCRIPT_NAME = cgit.cgi 2CGIT_SCRIPT_NAME = cgit.cgi
3CGIT_SCRIPT_PATH = /var/www/htdocs/cgit 3CGIT_SCRIPT_PATH = /var/www/htdocs/cgit
4CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) 4CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH)
@@ -12,7 +12,7 @@ htmldir = $(docdir)
12pdfdir = $(docdir) 12pdfdir = $(docdir)
13mandir = $(prefix)/share/man 13mandir = $(prefix)/share/man
14SHA1_HEADER = <openssl/sha.h> 14SHA1_HEADER = <openssl/sha.h>
15GIT_VER = 1.7.3 15GIT_VER = 1.7.4
16GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 16GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2
17INSTALL = install 17INSTALL = install
18MAN5_TXT = $(wildcard *.5.txt) 18MAN5_TXT = $(wildcard *.5.txt)
@@ -115,6 +115,7 @@ OBJECTS += ui-stats.o
115OBJECTS += ui-summary.o 115OBJECTS += ui-summary.o
116OBJECTS += ui-tag.o 116OBJECTS += ui-tag.o
117OBJECTS += ui-tree.o 117OBJECTS += ui-tree.o
118OBJECTS += vector.o
118 119
119ifdef NEEDS_LIBICONV 120ifdef NEEDS_LIBICONV
120 EXTLIBS += -liconv 121 EXTLIBS += -liconv
@@ -240,4 +241,4 @@ clean-doc:
240 rm -f cgitrc.5 cgitrc.5.html cgitrc.5.pdf cgitrc.5.xml cgitrc.5.fo 241 rm -f cgitrc.5 cgitrc.5.html cgitrc.5.pdf cgitrc.5.xml cgitrc.5.fo
241 242
242get-git: 243get-git:
243 curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git 244 curl $(GIT_URL) | tar -xjf - && rm -rf git && mv git-$(GIT_VER) git
diff --git a/README b/README
index 050e21e..1692ad6 100644
--- a/README
+++ b/README
@@ -36,7 +36,7 @@ file (see the Makefile for details).
36 36
37 37
38Dependencies: 38Dependencies:
39 -git 1.5.3 39 -git 1.7.4
40 -zip lib 40 -zip lib
41 -crypto lib 41 -crypto lib
42 -openssl lib 42 -openssl lib
@@ -86,13 +86,6 @@ The missing features
86 repository. This should probably be extended to a generic map between 86 repository. This should probably be extended to a generic map between
87 submodule path and url. 87 submodule path and url.
88 88
89* Branch- and tag-lists in the summary page can get very long, they should
90 probably only show something like the ten "latest modified" branches and
91 a similar number of "most recent" tags.
92
93* There should be a new page for browsing refs/heads and refs/tags, with links
94 from the summary page whenever the branch/tag lists overflow.
95
96* The log-page should have more/better search options (author, committer, 89* The log-page should have more/better search options (author, committer,
97 pickaxe, paths) and possibly support arbitrary revision specifiers. 90 pickaxe, paths) and possibly support arbitrary revision specifiers.
98 91
diff --git a/cgit.c b/cgit.c
index e0c2d9f..349d6e0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -29,15 +29,17 @@ void add_mimetype(const char *name, const char *value)
29struct cgit_filter *new_filter(const char *cmd, int extra_args) 29struct cgit_filter *new_filter(const char *cmd, int extra_args)
30{ 30{
31 struct cgit_filter *f; 31 struct cgit_filter *f;
32 int args_size = 0;
32 33
33 if (!cmd || !cmd[0]) 34 if (!cmd || !cmd[0])
34 return NULL; 35 return NULL;
35 36
36 f = xmalloc(sizeof(struct cgit_filter)); 37 f = xmalloc(sizeof(struct cgit_filter));
37 f->cmd = xstrdup(cmd); 38 f->cmd = xstrdup(cmd);
38 f->argv = xmalloc((2 + extra_args) * sizeof(char *)); 39 args_size = (2 + extra_args) * sizeof(char *);
40 f->argv = xmalloc(args_size);
41 memset(f->argv, 0, args_size);
39 f->argv[0] = f->cmd; 42 f->argv[0] = f->cmd;
40 f->argv[1] = NULL;
41 return f; 43 return f;
42} 44}
43 45
@@ -57,6 +59,8 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
57 repo->defbranch = xstrdup(value); 59 repo->defbranch = xstrdup(value);
58 else if (!strcmp(name, "snapshots")) 60 else if (!strcmp(name, "snapshots"))
59 repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); 61 repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value);
62 else if (!strcmp(name, "enable-commit-graph"))
63 repo->enable_commit_graph = ctx.cfg.enable_commit_graph * atoi(value);
60 else if (!strcmp(name, "enable-log-filecount")) 64 else if (!strcmp(name, "enable-log-filecount"))
61 repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); 65 repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value);
62 else if (!strcmp(name, "enable-log-linecount")) 66 else if (!strcmp(name, "enable-log-linecount"))
@@ -71,9 +75,13 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
71 repo->module_link= xstrdup(value); 75 repo->module_link= xstrdup(value);
72 else if (!strcmp(name, "section")) 76 else if (!strcmp(name, "section"))
73 repo->section = xstrdup(value); 77 repo->section = xstrdup(value);
74 else if (!strcmp(name, "readme") && value != NULL) { 78 else if (!strcmp(name, "readme") && value != NULL)
75 repo->readme = xstrdup(value); 79 repo->readme = xstrdup(value);
76 } else if (ctx.cfg.enable_filter_overrides) { 80 else if (!strcmp(name, "logo") && value != NULL)
81 repo->logo = xstrdup(value);
82 else if (!strcmp(name, "logo-link") && value != NULL)
83 repo->logo_link = xstrdup(value);
84 else if (ctx.cfg.enable_filter_overrides) {
77 if (!strcmp(name, "about-filter")) 85 if (!strcmp(name, "about-filter"))
78 repo->about_filter = new_filter(value, 0); 86 repo->about_filter = new_filter(value, 0);
79 else if (!strcmp(name, "commit-filter")) 87 else if (!strcmp(name, "commit-filter"))
@@ -143,6 +151,8 @@ void config_cb(const char *name, const char *value)
143 ctx.cfg.enable_http_clone = atoi(value); 151 ctx.cfg.enable_http_clone = atoi(value);
144 else if (!strcmp(name, "enable-index-links")) 152 else if (!strcmp(name, "enable-index-links"))
145 ctx.cfg.enable_index_links = atoi(value); 153 ctx.cfg.enable_index_links = atoi(value);
154 else if (!strcmp(name, "enable-commit-graph"))
155 ctx.cfg.enable_commit_graph = atoi(value);
146 else if (!strcmp(name, "enable-log-filecount")) 156 else if (!strcmp(name, "enable-log-filecount"))
147 ctx.cfg.enable_log_filecount = atoi(value); 157 ctx.cfg.enable_log_filecount = atoi(value);
148 else if (!strcmp(name, "enable-log-linecount")) 158 else if (!strcmp(name, "enable-log-linecount"))
@@ -197,6 +207,8 @@ void config_cb(const char *name, const char *value)
197 ctx.cfg.project_list, repo_config); 207 ctx.cfg.project_list, repo_config);
198 else 208 else
199 scan_tree(expand_macros(value), repo_config); 209 scan_tree(expand_macros(value), repo_config);
210 else if (!strcmp(name, "scan-hidden-path"))
211 ctx.cfg.scan_hidden_path = atoi(value);
200 else if (!strcmp(name, "section-from-path")) 212 else if (!strcmp(name, "section-from-path"))
201 ctx.cfg.section_from_path = atoi(value); 213 ctx.cfg.section_from_path = atoi(value);
202 else if (!strcmp(name, "source-filter")) 214 else if (!strcmp(name, "source-filter"))
@@ -318,6 +330,7 @@ static void prepare_context(struct cgit_context *ctx)
318 ctx->cfg.robots = "index, nofollow"; 330 ctx->cfg.robots = "index, nofollow";
319 ctx->cfg.root_title = "Git repository browser"; 331 ctx->cfg.root_title = "Git repository browser";
320 ctx->cfg.root_desc = "a fast webinterface for the git dscm"; 332 ctx->cfg.root_desc = "a fast webinterface for the git dscm";
333 ctx->cfg.scan_hidden_path = 0;
321 ctx->cfg.script_name = CGIT_SCRIPT_NAME; 334 ctx->cfg.script_name = CGIT_SCRIPT_NAME;
322 ctx->cfg.section = ""; 335 ctx->cfg.section = "";
323 ctx->cfg.summary_branches = 10; 336 ctx->cfg.summary_branches = 10;
@@ -550,6 +563,8 @@ void print_repo(FILE *f, struct cgit_repo *repo)
550 fprintf(f, "repo.section=%s\n", repo->section); 563 fprintf(f, "repo.section=%s\n", repo->section);
551 if (repo->clone_url) 564 if (repo->clone_url)
552 fprintf(f, "repo.clone-url=%s\n", repo->clone_url); 565 fprintf(f, "repo.clone-url=%s\n", repo->clone_url);
566 fprintf(f, "repo.enable-commit-graph=%d\n",
567 repo->enable_commit_graph);
553 fprintf(f, "repo.enable-log-filecount=%d\n", 568 fprintf(f, "repo.enable-log-filecount=%d\n",
554 repo->enable_log_filecount); 569 repo->enable_log_filecount);
555 fprintf(f, "repo.enable-log-linecount=%d\n", 570 fprintf(f, "repo.enable-log-linecount=%d\n",
@@ -749,10 +764,11 @@ int main(int argc, const char **argv)
749 http_parse_querystring(ctx.qry.raw, querystring_cb); 764 http_parse_querystring(ctx.qry.raw, querystring_cb);