diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | cgit.c | 17 | ||||
| -rw-r--r-- | cgit.css | 15 | ||||
| -rw-r--r-- | cgit.h | 8 | ||||
| -rw-r--r-- | cgitrc.5.txt | 16 | ||||
| -rw-r--r-- | cmd.c | 48 | ||||
| -rw-r--r-- | cmd.h | 3 | ||||
| -rw-r--r-- | parsing.c | 4 | ||||
| -rw-r--r-- | scan-tree.c | 2 | ||||
| -rw-r--r-- | shared.c | 15 | ||||
| -rw-r--r-- | ui-atom.c | 4 | ||||
| -rw-r--r-- | ui-commit.c | 30 | ||||
| -rw-r--r-- | ui-commit.h | 2 | ||||
| -rw-r--r-- | ui-diff.c | 22 | ||||
| -rw-r--r-- | ui-log.c | 40 | ||||
| -rw-r--r-- | ui-patch.c | 8 | ||||
| -rw-r--r-- | ui-patch.h | 2 | ||||
| -rw-r--r-- | ui-plain.c | 68 | ||||
| -rw-r--r-- | ui-refs.c | 2 | ||||
| -rw-r--r-- | ui-shared.c | 231 | ||||
| -rw-r--r-- | ui-shared.h | 72 | ||||
| -rw-r--r-- | ui-tree.c | 15 |
22 files changed, 435 insertions, 191 deletions
| @@ -1,4 +1,4 @@ | |||
| 1 | CGIT_VERSION = v0.8.3.1 | 1 | CGIT_VERSION = v0.8.3.2 |
| 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) |
| @@ -62,6 +62,8 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) | |||
| 62 | repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); | 62 | repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
| 63 | else if (!strcmp(name, "enable-remote-branches")) | 63 | else if (!strcmp(name, "enable-remote-branches")) |
| 64 | repo->enable_remote_branches = atoi(value); | 64 | repo->enable_remote_branches = atoi(value); |
| 65 | else if (!strcmp(name, "enable-subject-links")) | ||
| 66 | repo->enable_subject_links = atoi(value); | ||
| 65 | else if (!strcmp(name, "max-stats")) | 67 | else if (!strcmp(name, "max-stats")) |
| 66 | repo->max_stats = cgit_find_stats_period(value, NULL); | 68 | repo->max_stats = cgit_find_stats_period(value, NULL); |
| 67 | else if (!strcmp(name, "module-link")) | 69 | else if (!strcmp(name, "module-link")) |
| @@ -141,6 +143,8 @@ void config_cb(const char *name, const char *value) | |||
| 141 | ctx.cfg.enable_log_linecount = atoi(value); | 143 | ctx.cfg.enable_log_linecount = atoi(value); |
| 142 | else if (!strcmp(name, "enable-remote-branches")) | 144 | else if (!strcmp(name, "enable-remote-branches")) |
| 143 | ctx.cfg.enable_remote_branches = atoi(value); | 145 | ctx.cfg.enable_remote_branches = atoi(value); |
| 146 | else if (!strcmp(name, "enable-subject-links")) | ||
| 147 | ctx.cfg.enable_subject_links = atoi(value); | ||
| 144 | else if (!strcmp(name, "enable-tree-linenumbers")) | 148 | else if (!strcmp(name, "enable-tree-linenumbers")) |
| 145 | ctx.cfg.enable_tree_linenumbers = atoi(value); | 149 | ctx.cfg.enable_tree_linenumbers = atoi(value); |
| 146 | else if (!strcmp(name, "max-stats")) | 150 | else if (!strcmp(name, "max-stats")) |
| @@ -165,6 +169,8 @@ void config_cb(const char *name, const char *value) | |||
| 165 | ctx.cfg.commit_filter = new_filter(value, 0); | 169 | ctx.cfg.commit_filter = new_filter(value, 0); |
| 166 | else if (!strcmp(name, "embedded")) | 170 | else if (!strcmp(name, "embedded")) |
| 167 | ctx.cfg.embedded = atoi(value); | 171 | ctx.cfg.embedded = atoi(value); |
| 172 | else if (!strcmp(name, "max-atom-items")) | ||
| 173 | ctx.cfg.max_atom_items = atoi(value); | ||
| 168 | else if (!strcmp(name, "max-message-length")) | 174 | else if (!strcmp(name, "max-message-length")) |
| 169 | ctx.cfg.max_msg_len = atoi(value); | 175 | ctx.cfg.max_msg_len = atoi(value); |
| 170 | else if (!strcmp(name, "max-repodesc-length")) | 176 | else if (!strcmp(name, "max-repodesc-length")) |
| @@ -250,6 +256,10 @@ static void querystring_cb(const char *name, const char *value) | |||
| 250 | ctx.qry.period = xstrdup(value); | 256 | ctx.qry.period = xstrdup(value); |
| 251 | } else if (!strcmp(name, "ss")) { | 257 | } else if (!strcmp(name, "ss")) { |
| 252 | ctx.qry.ssdiff = atoi(value); | 258 | ctx.qry.ssdiff = atoi(value); |
| 259 | } else if (!strcmp(name, "all")) { | ||
| 260 | ctx.qry.show_all = atoi(value); | ||
| 261 | } else if (!strcmp(name, "context")) { | ||
| 262 | ctx.qry.context = atoi(value); | ||
| 253 | } | 263 | } |
| 254 | } | 264 | } |
| 255 | 265 | ||
| @@ -292,6 +302,7 @@ static void prepare_context(struct cgit_context *ctx) | |||
| 292 | ctx->cfg.summary_branches = 10; | 302 | ctx->cfg.summary_branches = 10; |
| 293 | ctx->cfg.summary_log = 10; | 303 | ctx->cfg.summary_log = 10; |
| 294 | ctx->cfg.summary_tags = 10; | 304 | ctx->cfg.summary_tags = 10; |
| 305 | ctx->cfg.max_atom_items = 10; | ||
| 295 | ctx->cfg.ssdiff = 0; | 306 | ctx->cfg.ssdiff = 0; |
| 296 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); | 307 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); |
| 297 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); | 308 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); |
| @@ -424,6 +435,12 @@ static void process_request(void *cbdata) | |||
| 424 | return; | 435 | return; |
| 425 | } | 436 | } |
| 426 | 437 | ||
| 438 | /* If cmd->want_vpath is set, assume ctx->qry.path contains a "virtual" | ||
| 439 | * in-project path limit to be made available at ctx->qry.vpath. | ||
| 440 | * Otherwise, no path limit is in effect (ctx->qry.vpath = NULL). | ||
| 441 | */ | ||
| 442 | ctx->qry.vpath = cmd->want_vpath ? ctx->qry.path : NULL; | ||
| 443 | |||
| 427 | if (cmd->want_repo && !ctx->repo) { | 444 | if (cmd->want_repo && !ctx->repo) { |
| 428 | cgit_print_http_headers(ctx); | 445 | cgit_print_http_headers(ctx); |
| 429 | cgit_print_docstart(ctx); | 446 | cgit_print_docstart(ctx); |
| @@ -64,7 +64,7 @@ table#header td.sub { | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | table.tabs { | 66 | table.tabs { |
| 67 | /* border-bottom: solid 2px #ccc; */ | 67 | border-bottom: solid 3px #ccc; |
| 68 | border-collapse: collapse; | 68 | border-collapse: collapse; |
| 69 | margin-top: 2em; | 69 | margin-top: 2em; |
| 70 | margin-bottom: 0px; | 70 | margin-bottom: 0px; |
| @@ -102,10 +102,16 @@ table.tabs td.form select { | |||
| 102 | font-size: 90%; | 102 | font-size: 90%; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | div.path { | ||
| 106 | margin: 0px; | ||
| 107 | padding: 5px 2em 2px 2em; | ||
| 108 | color: #000; | ||
| 109 | background-color: #eee; | ||
| 110 | } | ||
| 111 | |||
| 105 | div.content { | 112 | div.content { |
| 106 | margin: 0px; | 113 | margin: 0px; |
| 107 | padding: 2em; | 114 | padding: 2em; |
| 108 | border-top: solid 3px #ccc; | ||
| 109 | border-bottom: solid 3px #ccc; | 115 | border-bottom: solid 3px #ccc; |
| 110 | } | 116 | } |
| 111 | 117 | ||
| @@ -525,7 +531,10 @@ a.deco { | |||
| 525 | border: solid 1px #770000; | 531 | border: solid 1px #770000; |
| 526 | } | 532 | } |
| 527 | 533 | ||
| 528 | div.commit-subject a { | 534 | div.commit-subject a.branch-deco, |
| 535 | div.commit-subject a.tag-deco, | ||
| 536 | div.commit-subject a.remote-deco, | ||
| 537 | div.commit-subject a.deco { | ||
| 529 | margin-left: 1em; | 538 | margin-left: 1em; |
| 530 | font-size: 75%; | 539 | font-size: 75%; |
| 531 | } | 540 | } |
| @@ -73,6 +73,7 @@ struct cgit_repo { | |||
| 73 | int enable_log_filecount; | 73 | int enable_log_filecount; |
| 74 | int enable_log_linecount; | 74 | int enable_log_linecount; |
| 75 | int enable_remote_branches; | 75 | int enable_remote_branches; |
| 76 | int enable_subject_links; | ||
| 76 | int max_stats; | 77 | int max_stats; |
| 77 | time_t mtime; | 78 | time_t mtime; |
| 78 | struct cgit_filter *about_filter; | 79 | struct cgit_filter *about_filter; |
| @@ -145,6 +146,9 @@ struct cgit_query { | |||
| 145 | char *sort; | 146 | char *sort; |
| 146 | int showmsg; | 147 | int showmsg; |
| 147 | int ssdiff; | 148 | int ssdiff; |
| 149 | int show_all; | ||
| 150 | int context; | ||
| 151 | char *vpath; | ||
| 148 | }; | 152 | }; |
| 149 | 153 | ||
| 150 | struct cgit_config { | 154 | struct cgit_config { |
| @@ -181,8 +185,10 @@ struct cgit_config { | |||
| 181 | int enable_log_filecount; | 185 | int enable_log_filecount; |
| 182 | int enable_log_linecount; | 186 | int enable_log_linecount; |
| 183 | int enable_remote_branches; | 187 | int enable_remote_branches; |
| 188 | int enable_subject_links; | ||
| 184 | int enable_tree_linenumbers; | 189 | int enable_tree_linenumbers; |
| 185 | int local_time; | 190 | int local_time; |
| 191 | int max_atom_items; | ||
| 186 | int max_repo_count; | 192 | int max_repo_count; |
| 187 | int max_commit_count; | 193 | int max_commit_count; |
| 188 | int max_lock_attempts; | 194 | int max_lock_attempts; |
| @@ -273,7 +279,7 @@ extern void *cgit_free_commitinfo(struct commitinfo *info); | |||
| 273 | extern int cgit_diff_files(const unsigned char *old_sha1, | 279 | extern int cgit_diff_files(const unsigned char *old_sha1, |
| 274 | const unsigned char *new_sha1, | 280 | const unsigned char *new_sha1, |
| 275 | unsigned long *old_size, unsigned long *new_size, | 281 | unsigned long *old_size, unsigned long *new_size, |
| 276 | int *binary, linediff_fn fn); | 282 | int *binary, int context, linediff_fn fn); |
| 277 | 283 | ||
| 278 | extern void cgit_diff_tree(const unsigned char *old_sha1, | 284 | extern void cgit_diff_tree(const unsigned char *old_sha1, |
| 279 | const unsigned char *new_sha1, | 285 | const unsigned char *new_sha1, |
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index d74d9e7..a853522 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
| @@ -115,6 +115,12 @@ enable-remote-branches:: | |||
| 115 | in the summary and refs views. Default value: "0". See also: | 115 | in the summary and refs views. Default value: "0". See also: |
| 116 | "repo.enable-remote-branches". | 116 | "repo.enable-remote-branches". |
| 117 | 117 | ||
| 118 | enable-subject-links:: | ||
| 119 | Flag which, when set to "1", will make cgit use the subject of the | ||
| 120 | parent commit as link text when generating links to parent commits | ||
| 121 | in commit view. Default value: "0". See also: | ||
| 122 | "repo.enable-subject-links". | ||
| 123 | |||
| 118 | enable-tree-linenumbers:: | 124 | enable-tree-linenumbers:: |
| 119 | Flag which, when set to "1", will make cgit generate linenumber links | 125 | Flag which, when set to "1", will make cgit generate linenumber links |
| 120 | for plaintext blobs printed in the tree view. Default value: "1". | 126 | for plaintext blobs printed in the tree view. Default value: "1". |
| @@ -166,6 +172,10 @@ logo-link:: | |||
| 166 | calculated url of the repository index page will be used. Default | 172 | calculated url of the repository index page will be used. Default |
| 167 | value: none. | 173 | value: none. |
| 168 | 174 | ||
