diff options
author | Lars Hjemli | 2007-05-18 13:55:52 +0200 |
---|---|---|
committer | Lars Hjemli | 2007-05-18 13:55:52 +0200 |
commit | e189344a7dfe6fa1b07434d5170e6441dcbaf788 (patch) | |
tree | f1500b97f95a710dba27469510114388be435d01 /shared.c | |
parent | c1ad6cb77889880ad0189a689840fbfa6e5cbc80 (diff) | |
download | cgit-e189344a7dfe6fa1b07434d5170e6441dcbaf788.tar.gz cgit-e189344a7dfe6fa1b07434d5170e6441dcbaf788.tar.bz2 cgit-e189344a7dfe6fa1b07434d5170e6441dcbaf788.zip |
Add knobs to enable/disable files/lines changed in log view
These columns can cause lots of IO on the server, so add settings to
explicitly enable them. Also, add per repo settings to optionally disable
the columns if sitewide enabled.
While at it, do not allow repo.snapshot to enable snapshots if the global
setting is disabled.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'shared.c')
-rw-r--r-- | shared.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -22,6 +22,8 @@ char *cgit_cache_root = "/var/cache/cgit"; | |||
22 | 22 | ||
23 | int cgit_nocache = 0; | 23 | int cgit_nocache = 0; |
24 | int cgit_snapshots = 0; | 24 | int cgit_snapshots = 0; |
25 | int cgit_enable_log_filecount = 0; | ||
26 | int cgit_enable_log_linecount = 0; | ||
25 | int cgit_max_lock_attempts = 5; | 27 | int cgit_max_lock_attempts = 5; |
26 | int cgit_cache_root_ttl = 5; | 28 | int cgit_cache_root_ttl = 5; |
27 | int cgit_cache_repo_ttl = 5; | 29 | int cgit_cache_repo_ttl = 5; |
@@ -85,6 +87,8 @@ struct repoinfo *add_repo(const char *url) | |||
85 | ret->owner = NULL; | 87 | ret->owner = NULL; |
86 | ret->defbranch = "master"; | 88 | ret->defbranch = "master"; |
87 | ret->snapshots = cgit_snapshots; | 89 | ret->snapshots = cgit_snapshots; |
90 | ret->enable_log_filecount = cgit_enable_log_filecount; | ||
91 | ret->enable_log_linecount = cgit_enable_log_linecount; | ||
88 | ret->module_link = cgit_module_link; | 92 | ret->module_link = cgit_module_link; |
89 | return ret; | 93 | return ret; |
90 | } | 94 | } |
@@ -107,6 +111,10 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
107 | cgit_nocache = atoi(value); | 111 | cgit_nocache = atoi(value); |
108 | else if (!strcmp(name, "snapshots")) | 112 | else if (!strcmp(name, "snapshots")) |
109 | cgit_snapshots = atoi(value); | 113 | cgit_snapshots = atoi(value); |
114 | else if (!strcmp(name, "enable-log-filecount")) | ||
115 | cgit_enable_log_filecount = atoi(value); | ||
116 | else if (!strcmp(name, "enable-log-linecount")) | ||
117 | cgit_enable_log_linecount = atoi(value); | ||
110 | else if (!strcmp(name, "cache-root")) | 118 | else if (!strcmp(name, "cache-root")) |
111 | cgit_cache_root = xstrdup(value); | 119 | cgit_cache_root = xstrdup(value); |
112 | else if (!strcmp(name, "cache-root-ttl")) | 120 | else if (!strcmp(name, "cache-root-ttl")) |
@@ -136,7 +144,11 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
136 | else if (cgit_repo && !strcmp(name, "repo.defbranch")) | 144 | else if (cgit_repo && !strcmp(name, "repo.defbranch")) |
137 | cgit_repo->defbranch = xstrdup(value); | 145 | cgit_repo->defbranch = xstrdup(value); |
138 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) | 146 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) |
139 | cgit_repo->snapshots = atoi(value); | 147 | cgit_repo->snapshots = cgit_snapshots * atoi(value); |
148 | else if (cgit_repo && !strcmp(name, "repo.enable-log-filecount")) | ||
149 | cgit_repo->enable_log_filecount = cgit_enable_log_filecount * atoi(value); | ||
150 | else if (cgit_repo && !strcmp(name, "repo.enable-log-linecount")) | ||
151 | cgit_repo->enable_log_linecount = cgit_enable_log_linecount * atoi(value); | ||
140 | else if (cgit_repo && !strcmp(name, "repo.module-link")) | 152 | else if (cgit_repo && !strcmp(name, "repo.module-link")) |
141 | cgit_repo->module_link= xstrdup(value); | 153 | cgit_repo->module_link= xstrdup(value); |
142 | else if (!strcmp(name, "include")) | 154 | else if (!strcmp(name, "include")) |