From: Lars Hjemli Date: Sat, 19 Feb 2011 13:25:55 +0000 (+0100) Subject: Merge branch 'jh/scan-path' X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/fb9e6d1594a24fe4e551fd57a9c91fd18b14806e?hp=-c Merge branch 'jh/scan-path' * jh/scan-path: scan_path(): Do not recurse into hidden directories by default scan_path(): Improve handling of inaccessible directories --- fb9e6d1594a24fe4e551fd57a9c91fd18b14806e diff --combined cgit.c index 53ab68d,6a76281..71f3fc8 --- 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")) @@@ -143,8 -141,6 +143,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,6 -195,8 +199,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")) @@@ -319,6 -317,7 +321,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; @@@ -544,8 -543,6 +547,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.h index bed770b,ad94905..74aa340 --- a/cgit.h +++ b/cgit.h @@@ -20,7 -20,6 +20,7 @@@ #include #include #include +#include /* @@@ -72,7 -71,6 +72,7 @@@ struct cgit_repo char *section; char *clone_url; int snapshots; + int enable_commit_graph; int enable_log_filecount; int enable_log_linecount; int enable_remote_branches; @@@ -190,7 -188,6 +190,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,6 -207,7 +210,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 3c20fe1,1dc3cce..a832830 --- 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,6 -269,14 +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 @@@ -359,10 -362,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. @@@ -450,10 -449,6 +458,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