From: Lars Hjemli Date: Sat, 19 Feb 2011 13:51:00 +0000 (+0100) Subject: Merge branch 'br/misc' X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/979c460e7f71d153ae79da67b8b21c3412f0fe02?hp=-c Merge branch 'br/misc' * br/misc: Use transparent background for the cgit logo ssdiff: anchors for ssdiff implement repo.logo and repo.logo-link --- 979c460e7f71d153ae79da67b8b21c3412f0fe02 diff --combined cgit.c index 71f3fc8,e8c1f94..916feb4 --- a/cgit.c +++ b/cgit.c @@@ -57,8 -57,6 +57,8 @@@ void repo_config(struct cgit_repo *repo repo->defbranch = xstrdup(value); else if (!strcmp(name, "snapshots")) repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); + else if (!strcmp(name, "enable-commit-graph")) + repo->enable_commit_graph = ctx.cfg.enable_commit_graph * atoi(value); else if (!strcmp(name, "enable-log-filecount")) repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); else if (!strcmp(name, "enable-log-linecount")) @@@ -73,9 -71,13 +73,13 @@@ repo->module_link= xstrdup(value); else if (!strcmp(name, "section")) repo->section = xstrdup(value); - else if (!strcmp(name, "readme") && value != NULL) { + else if (!strcmp(name, "readme") && value != NULL) repo->readme = xstrdup(value); - } else if (ctx.cfg.enable_filter_overrides) { + else if (!strcmp(name, "logo") && value != NULL) + repo->logo = xstrdup(value); + else if (!strcmp(name, "logo-link") && value != NULL) + repo->logo_link = xstrdup(value); + else if (ctx.cfg.enable_filter_overrides) { if (!strcmp(name, "about-filter")) repo->about_filter = new_filter(value, 0); else if (!strcmp(name, "commit-filter")) @@@ -143,8 -145,6 +147,8 @@@ void config_cb(const char *name, const ctx.cfg.enable_gitweb_owner = atoi(value); else if (!strcmp(name, "enable-index-links")) ctx.cfg.enable_index_links = atoi(value); + else if (!strcmp(name, "enable-commit-graph")) + ctx.cfg.enable_commit_graph = atoi(value); else if (!strcmp(name, "enable-log-filecount")) ctx.cfg.enable_log_filecount = atoi(value); else if (!strcmp(name, "enable-log-linecount")) @@@ -199,8 -199,6 +203,8 @@@ ctx.cfg.project_list, repo_config); else scan_tree(expand_macros(value), repo_config); + else if (!strcmp(name, "scan-hidden-path")) + ctx.cfg.scan_hidden_path = atoi(value); else if (!strcmp(name, "section-from-path")) ctx.cfg.section_from_path = atoi(value); else if (!strcmp(name, "source-filter")) @@@ -321,7 -319,6 +325,7 @@@ static void prepare_context(struct cgit ctx->cfg.robots = "index, nofollow"; ctx->cfg.root_title = "Git repository browser"; ctx->cfg.root_desc = "a fast webinterface for the git dscm"; + ctx->cfg.scan_hidden_path = 0; ctx->cfg.script_name = CGIT_SCRIPT_NAME; ctx->cfg.section = ""; ctx->cfg.summary_branches = 10; @@@ -547,8 -544,6 +551,8 @@@ void print_repo(FILE *f, struct cgit_re fprintf(f, "repo.section=%s\n", repo->section); if (repo->clone_url) fprintf(f, "repo.clone-url=%s\n", repo->clone_url); + fprintf(f, "repo.enable-commit-graph=%d\n", + repo->enable_commit_graph); fprintf(f, "repo.enable-log-filecount=%d\n", repo->enable_log_filecount); fprintf(f, "repo.enable-log-linecount=%d\n", diff --combined cgit.css index 008cff8,3ed1989..1d90057 --- a/cgit.css +++ b/cgit.css @@@ -153,44 -153,26 +153,44 @@@ table.list td padding: 0.1em 0.5em 0.1em 0.5em; } -table.list td.logsubject { +table.list td.commitgraph { font-family: monospace; - font-weight: bold; + white-space: pre; } -table.list td.logmsg { - font-family: monospace; - white-space: pre; - padding: 1em 0.5em 2em 0.5em; +table.list td.commitgraph .column1 { + color: #a00; +} + +table.list td.commitgraph .column2 { + color: #0a0; +} + +table.list td.commitgraph .column3 { + color: #aa0; } -table.list td.lognotes-label { - text-align:right; - vertical-align:top; +table.list td.commitgraph .column4 { + color: #00a; } -table.list td.lognotes { +table.list td.commitgraph .column5 { + color: #a0a; +} + +table.list td.commitgraph .column6 { + color: #0aa; +} + +table.list td.logsubject { + font-family: monospace; + font-weight: bold; +} + +table.list td.logmsg { font-family: monospace; white-space: pre; - padding: 0em 0.5em 2em 0.5em; + padding: 0 0.5em; } table.list td a { @@@ -293,7 -275,7 +293,7 @@@ table.blob pre padding: 0; margin: 0; } - table.blob a.no { + table.blob a.no, table.ssdiff a.no { color: gray; text-align: right; text-decoration: none; diff --combined cgit.h index 74aa340,8a9d5fa..b5f00fc --- a/cgit.h +++ b/cgit.h @@@ -20,7 -20,6 +20,7 @@@ #include #include #include +#include /* @@@ -71,8 -70,9 +71,10 @@@ struct cgit_repo char *readme; char *section; char *clone_url; + char *logo; + char *logo_link; int snapshots; + int enable_commit_graph; int enable_log_filecount; int enable_log_linecount; int enable_remote_branches; @@@ -190,7 -190,6 +192,7 @@@ struct cgit_config int enable_filter_overrides; int enable_gitweb_owner; int enable_index_links; + int enable_commit_graph; int enable_log_filecount; int enable_log_linecount; int enable_remote_branches; @@@ -210,7 -209,6 +212,7 @@@ int noheader; int renamelimit; int remove_suffix; + int scan_hidden_path; int section_from_path; int snapshots; int summary_branches; diff --combined cgitrc.5.txt index a832830,01157a9..c3698a6 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@@ -90,12 -90,7 +90,12 @@@ embedded: Flag which, when set to "1", will make cgit generate a html fragment suitable for embedding in other html pages. Default value: none. See also: "noheader". - + +enable-commit-graph:: + Flag which, when set to "1", will make cgit print an ASCII-art commit + history graph to the left of the commit messages in the repository + log page. Default value: "0". + enable-filter-overrides:: Flag which, when set to "1", allows all filter settings to be overridden in repository-specific cgitrc files. Default value: none. @@@ -274,14 -269,6 +274,14 @@@ root-title: Text printed as heading on the repository index page. Default value: "Git Repository Browser". +scan-hidden-path:: + If set to "1" and scan-path is enabled, scan-path will recurse into + directories whose name starts with a period ('.'). Otherwise, + scan-path will stay away from such directories (considered as + "hidden"). Note that this does not apply to the ".git" directory in + non-bare repos. This must be defined prior to scan-path. + Default value: 0. See also: scan-path. + scan-path:: A path which will be scanned for repositories. If caching is enabled, the result will be cached as a cgitrc include-file in the cache @@@ -367,10 -354,6 +367,10 @@@ repo.defbranch: repo.desc:: The value to show as repository description. Default value: none. +repo.enable-commit-graph:: + A flag which can be used to disable the global setting + `enable-commit-graph'. Default value: none. + repo.enable-log-filecount:: A flag which can be used to disable the global setting `enable-log-filecount'. Default value: none. @@@ -387,6 -370,15 +387,15 @@@ repo.enable-subject-links: A flag which can be used to override the global setting `enable-subject-links'. Default value: none. + repo.logo:: + Url which specifies the source of an image which will be used as a logo + on this repo's pages. Default value: global logo. + + repo.logo-link:: + Url loaded when clicking on the cgit logo image. If unspecified the + calculated url of the repository index page will be used. Default + value: global logo-link. + repo.max-stats:: Override the default maximum statistics period. Valid values are equal to the values specified for the global "max-stats" setting. Default @@@ -458,10 -450,6 +467,10 @@@ css=/css/cgit.cs enable-index-links=1 +# Enable ASCII art commit history graph on the log pages +enable-commit-graph=1 + + # Show number of affected files per commit on the log pages enable-log-filecount=1