]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'br/misc'
authorLars Hjemli <hjemli@gmail.com>
Sat, 19 Feb 2011 13:51:00 +0000 (14:51 +0100)
committerLars Hjemli <hjemli@gmail.com>
Sat, 19 Feb 2011 13:51:00 +0000 (14:51 +0100)
* br/misc:
  Use transparent background for the cgit logo
  ssdiff: anchors for ssdiff
  implement repo.logo and repo.logo-link

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

diff --combined cgit.c
index 71f3fc8b36fbc56d403d188dcce02172f502e780,e8c1f9405f56af242b94587cf47349a40a40ba99..916feb4f10dd3f128a10381d39f139cfa318b9a9
--- 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"))
                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"))
                                      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 008cff8e0c766fa4bf85a6f7fbaee7e644335b60,3ed198958c8f208e2ccc3d6e929e36a76fad1e0d..1d90057802df162747d744eb9345616992122528
+++ 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 74aa340b1014d1cebb965202d29638d0236356ac,8a9d5fa6a86723ddf964ca8f51ae1a4f9f756006..b5f00fc9c1c1d6d6e7f7a8cdc2695cab334752ab
--- 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>
  
  
  /*
@@@ -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;
        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 a83283073c04cd167e03d7deb9b5eeca22f2f4f3,01157a915c0c72c8dc99b5844dd9c70f3ad49f71..c3698a643dc65a7d7cee43d3da780bbe9e844c2c
@@@ -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