summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c4
-rw-r--r--cgit.h1
-rw-r--r--cgitrc4
-rw-r--r--shared.c3
4 files changed, 10 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 28bab8d..aee7ba3 100644
--- a/cgit.c
+++ b/cgit.c
@@ -94,34 +94,34 @@ static void cgit_print_repo_page(struct cacheitem *item)
if (cgit_query_page && !strcmp(cgit_query_page, "log"))
show_search = 1;
cgit_print_docstart(title, 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();
}
static void cgit_fill_cache(struct cacheitem *item, int use_cache)
{
diff --git a/cgit.h b/cgit.h
index 43de375..46f3173 100644
--- a/cgit.h
+++ b/cgit.h
@@ -74,32 +74,33 @@ extern char *cgit_css;
extern char *cgit_logo;
extern char *cgit_logo_link;
extern char *cgit_module_link;
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;
extern char *cgit_query_head;
extern char *cgit_query_sha1;
extern char *cgit_query_sha2;
extern char *cgit_query_path;
diff --git a/cgitrc b/cgitrc
index f217b39..019781e 100644
--- a/cgitrc
+++ b/cgitrc
@@ -42,32 +42,36 @@
## Link to logo file
#logo=/cgit/git-logo.png
## 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
## ttl for repo summary page
#cache-repo-ttl=5
## ttl for other dynamic pages
diff --git a/shared.c b/shared.c
index 801f68d..ffecac8 100644
--- a/shared.c
+++ b/shared.c
@@ -17,32 +17,33 @@ char *cgit_logo = "/git-logo.png";
char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/";
char *cgit_module_link = "./?repo=%s&page=commit&id=%s";
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;
char *cgit_query_search = NULL;
char *cgit_query_sha1 = NULL;
char *cgit_query_sha2 = NULL;
char *cgit_query_path = NULL;
@@ -107,32 +108,34 @@ void cgit_global_config_cb(const char *name, const char *value)
else if (!strcmp(name, "nocache"))
cgit_nocache = atoi(value);
else if (!strcmp(name, "snapshots"))
cgit_snapshots = atoi(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);
else if (cgit_repo && !strcmp(name, "repo.module-link"))
cgit_repo->module_link= xstrdup(value);
}