diff options
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | README | 9 | ||||
-rw-r--r-- | cgit.c | 28 | ||||
-rw-r--r-- | cgit.css | 42 | ||||
-rw-r--r-- | cgit.h | 6 | ||||
-rw-r--r-- | cgit.png | bin | 1840 -> 1488 bytes | |||
-rw-r--r-- | cgitrc.5.txt | 40 | ||||
-rw-r--r-- | cmd.c | 3 | ||||
m--------- | git | 0 | ||||
-rw-r--r-- | html.c | 6 | ||||
-rw-r--r-- | parsing.c | 24 | ||||
-rw-r--r-- | scan-tree.c | 21 | ||||
-rw-r--r-- | shared.c | 1 | ||||
-rw-r--r-- | ui-diff.c | 19 | ||||
-rw-r--r-- | ui-diff.h | 6 | ||||
-rw-r--r-- | ui-log.c | 287 | ||||
-rw-r--r-- | ui-log.h | 3 | ||||
-rw-r--r-- | ui-shared.c | 20 | ||||
-rw-r--r-- | ui-ssdiff.c | 34 | ||||
-rw-r--r-- | ui-summary.c | 2 | ||||
-rw-r--r-- | ui-tree.c | 2 | ||||
-rw-r--r-- | vector.c | 38 | ||||
-rw-r--r-- | vector.h | 17 |
23 files changed, 485 insertions, 130 deletions
@@ -1,4 +1,4 @@ | |||
1 | CGIT_VERSION = v0.8.3.4 | 1 | CGIT_VERSION = v0.9 |
2 | CGIT_SCRIPT_NAME = cgit.cgi | 2 | CGIT_SCRIPT_NAME = cgit.cgi |
3 | CGIT_SCRIPT_PATH = /var/www/htdocs/cgit | 3 | CGIT_SCRIPT_PATH = /var/www/htdocs/cgit |
4 | CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) | 4 | CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) |
@@ -12,7 +12,7 @@ htmldir = $(docdir) | |||
12 | pdfdir = $(docdir) | 12 | pdfdir = $(docdir) |
13 | mandir = $(prefix)/share/man | 13 | mandir = $(prefix)/share/man |
14 | SHA1_HEADER = <openssl/sha.h> | 14 | SHA1_HEADER = <openssl/sha.h> |
15 | GIT_VER = 1.7.3 | 15 | GIT_VER = 1.7.4 |
16 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 | 16 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 |
17 | INSTALL = install | 17 | INSTALL = install |
18 | MAN5_TXT = $(wildcard *.5.txt) | 18 | MAN5_TXT = $(wildcard *.5.txt) |
@@ -115,6 +115,7 @@ OBJECTS += ui-stats.o | |||
115 | OBJECTS += ui-summary.o | 115 | OBJECTS += ui-summary.o |
116 | OBJECTS += ui-tag.o | 116 | OBJECTS += ui-tag.o |
117 | OBJECTS += ui-tree.o | 117 | OBJECTS += ui-tree.o |
118 | OBJECTS += vector.o | ||
118 | 119 | ||
119 | ifdef NEEDS_LIBICONV | 120 | ifdef 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 | ||
242 | get-git: | 243 | get-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 |
@@ -36,7 +36,7 @@ file (see the Makefile for details). | |||
36 | 36 | ||
37 | 37 | ||
38 | Dependencies: | 38 | Dependencies: |
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 | ||
@@ -29,15 +29,17 @@ void add_mimetype(const char *name, const char *value) | |||
29 | struct cgit_filter *new_filter(const char *cmd, int extra_args) | 29 | struct 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); |