]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'jh/scan-path'
authorLars Hjemli <hjemli@gmail.com>
Sat, 19 Feb 2011 13:25:55 +0000 (14:25 +0100)
committerLars Hjemli <hjemli@gmail.com>
Sat, 19 Feb 2011 13:25:55 +0000 (14:25 +0100)
* jh/scan-path:
  scan_path(): Do not recurse into hidden directories by default
  scan_path(): Improve handling of inaccessible directories

1  2 
cgit.c
cgit.h
cgitrc.5.txt

diff --combined cgit.c
index 53ab68da2d7ff8f8b54deafcfdb3de47cf0c89b0,6a76281621982786af2c4639b1bf5e238646ef9e..71f3fc8b36fbc56d403d188dcce02172f502e780
--- 1/cgit.c
--- 2/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"))
                                      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 bed770b11baffb6f5927ec3f3629fa7bf960088d,ad94905a005e8213b65866133b2ffb7b643cb151..74aa340b1014d1cebb965202d29638d0236356ac
--- 1/cgit.h
--- 2/cgit.h
+++ b/cgit.h
@@@ -20,7 -20,6 +20,7 @@@
  #include <xdiff/xdiff.h>
  #include <utf8.h>
  #include <notes.h>
 +#include <graph.h>
  
  
  /*
@@@ -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;
        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 3c20fe1a075f88da8c51a5ab790d2ce20c43d02f,1dc3cce3fed5e0f62493a0ddbc642175f38f5b68..a83283073c04cd167e03d7deb9b5eeca22f2f4f3
@@@ -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