author | Lars Hjemli <hjemli@gmail.com> | 2007-05-13 15:15:06 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-13 15:15:06 (UTC) |
commit | c6cf3a424a0860d69b290254d9b19d35527b2d27 (patch) (side-by-side diff) | |
tree | 2874f2c42e907cba1187ae32ee686daebc2de59e | |
parent | 80e577c3ef2a73becabff7e9c9c242f317a87de9 (diff) | |
download | cgit-c6cf3a424a0860d69b290254d9b19d35527b2d27.zip cgit-c6cf3a424a0860d69b290254d9b19d35527b2d27.tar.gz cgit-c6cf3a424a0860d69b290254d9b19d35527b2d27.tar.bz2 |
Add max-commit-count parameter to cgitrc
This enabled customizing number of commits shown per page in log view. It
also changes the default from 100 to 50, mainly due to the more cpu
intensive log pages (number of files/lines changed) but also since 100
log messages requires excessive scrolling.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 4 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | cgitrc | 4 | ||||
-rw-r--r-- | shared.c | 3 |
4 files changed, 10 insertions, 2 deletions
@@ -98,26 +98,26 @@ static void cgit_print_repo_page(struct cacheitem *item) if (!cgit_query_page) { cgit_print_pageheader("summary", show_search); cgit_print_summary(); cgit_print_docend(); return; } cgit_print_pageheader(cgit_query_page, show_search); if (!strcmp(cgit_query_page, "log")) { - cgit_print_log(cgit_query_head, cgit_query_ofs, 100, - cgit_query_search); + cgit_print_log(cgit_query_head, cgit_query_ofs, + cgit_max_commit_count, cgit_query_search); } else if (!strcmp(cgit_query_page, "tree")) { cgit_print_tree(cgit_query_sha1, cgit_query_path); } else if (!strcmp(cgit_query_page, "commit")) { cgit_print_commit(cgit_query_sha1); } else if (!strcmp(cgit_query_page, "view")) { cgit_print_view(cgit_query_sha1, cgit_query_path); } else if (!strcmp(cgit_query_page, "diff")) { cgit_print_diff(cgit_query_sha1, cgit_query_sha2); } else { cgit_print_error("Invalid request"); } cgit_print_docend(); @@ -78,24 +78,25 @@ extern char *cgit_virtual_root; extern char *cgit_cache_root; extern int cgit_nocache; extern int cgit_snapshots; extern int cgit_max_lock_attempts; extern int cgit_cache_root_ttl; extern int cgit_cache_repo_ttl; extern int cgit_cache_dynamic_ttl; extern int cgit_cache_static_ttl; extern int cgit_cache_max_create_time; extern int cgit_max_msg_len; +extern int cgit_max_commit_count; extern char *cgit_repo_name; extern char *cgit_repo_desc; extern char *cgit_repo_owner; extern int cgit_query_has_symref; extern int cgit_query_has_sha1; extern char *cgit_querystring; extern char *cgit_query_repo; extern char *cgit_query_page; extern char *cgit_query_search; @@ -46,24 +46,28 @@ ## Url loaded when clicking the logo #logo-link=http://www.kernel.org/pub/software/scm/git/docs/ ## Url loaded when clicking a submodule link #module-link=./?repo=%s&page=commit&id=%s ## Number of chars shown of commit subject message (in log view) #max-message-length=60 +## Number of commits per page in log view +#max-commit-count=50 + + ## Root of cached output #cache-root=/var/cache/cgit ## ## Time-To-Live settings: specifies how long (in minutes) different pages ## should be cached (0 for instant expiration, -1 for immortal pages) ## ## ttl for root page #cache-root-ttl=5 @@ -21,24 +21,25 @@ char *cgit_virtual_root = NULL; char *cgit_cache_root = "/var/cache/cgit"; int cgit_nocache = 0; int cgit_snapshots = 0; int cgit_max_lock_attempts = 5; int cgit_cache_root_ttl = 5; int cgit_cache_repo_ttl = 5; int cgit_cache_dynamic_ttl = 5; int cgit_cache_static_ttl = -1; int cgit_cache_max_create_time = 5; int cgit_max_msg_len = 60; +int cgit_max_commit_count = 50; char *cgit_repo_name = NULL; char *cgit_repo_desc = NULL; char *cgit_repo_owner = NULL; int cgit_query_has_symref = 0; int cgit_query_has_sha1 = 0; char *cgit_querystring = NULL; char *cgit_query_repo = NULL; char *cgit_query_page = NULL; char *cgit_query_head = NULL; @@ -111,24 +112,26 @@ void cgit_global_config_cb(const char *name, const char *value) else if (!strcmp(name, "cache-root")) cgit_cache_root = xstrdup(value); else if (!strcmp(name, "cache-root-ttl")) cgit_cache_root_ttl = atoi(value); else if (!strcmp(name, "cache-repo-ttl")) cgit_cache_repo_ttl = atoi(value); else if (!strcmp(name, "cache-static-ttl")) cgit_cache_static_ttl = atoi(value); else if (!strcmp(name, "cache-dynamic-ttl")) cgit_cache_dynamic_ttl = atoi(value); else if (!strcmp(name, "max-message-length")) cgit_max_msg_len = atoi(value); + else if (!strcmp(name, "max-commit-count")) + cgit_max_commit_count = atoi(value); else if (!strcmp(name, "repo.url")) cgit_repo = add_repo(value); else if (!strcmp(name, "repo.name")) cgit_repo->name = xstrdup(value); else if (cgit_repo && !strcmp(name, "repo.path")) cgit_repo->path = xstrdup(value); else if (cgit_repo && !strcmp(name, "repo.desc")) cgit_repo->desc = xstrdup(value); else if (cgit_repo && !strcmp(name, "repo.owner")) cgit_repo->owner = xstrdup(value); else if (cgit_repo && !strcmp(name, "repo.snapshots")) cgit_repo->snapshots = atoi(value); |