diff options
author | Lars Hjemli <hjemli@gmail.com> | 2007-01-28 20:17:03 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-01-28 20:17:03 (JST) |
commit | 7dd50c98d73bf6c579b8ce5893739a2d0ffc00d5 (patch) | |
tree | 17f0e21c129723468a1f291faba52580993a39b1 | |
parent | d8b0cca2606f8919208ea68549ff60c6e5fe91bb (diff) | |
download | cgit-7dd50c98d73bf6c579b8ce5893739a2d0ffc00d5.zip cgit-7dd50c98d73bf6c579b8ce5893739a2d0ffc00d5.tar.gz |
Add parameter to adjust max message length in log listings
The parameter "max-message-length" can be specified in cgitrc, default value
is 60.
This affects the log message shown in repo summary and shortlog.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.h | 2 | ||||
-rw-r--r-- | shared.c | 4 | ||||
-rw-r--r-- | ui-log.c | 2 | ||||
-rw-r--r-- | ui-summary.c | 2 |
4 files changed, 8 insertions, 2 deletions
@@ -52,6 +52,8 @@ extern int cgit_cache_dynamic_ttl; | |||
52 | extern int cgit_cache_static_ttl; | 52 | extern int cgit_cache_static_ttl; |
53 | extern int cgit_cache_max_create_time; | 53 | extern int cgit_cache_max_create_time; |
54 | 54 | ||
55 | extern int cgit_max_msg_len; | ||
56 | |||
55 | extern char *cgit_repo_name; | 57 | extern char *cgit_repo_name; |
56 | extern char *cgit_repo_desc; | 58 | extern char *cgit_repo_desc; |
57 | extern char *cgit_repo_owner; | 59 | extern char *cgit_repo_owner; |
@@ -25,6 +25,8 @@ int cgit_cache_dynamic_ttl = 5; | |||
25 | int cgit_cache_static_ttl = -1; | 25 | int cgit_cache_static_ttl = -1; |
26 | int cgit_cache_max_create_time = 5; | 26 | int cgit_cache_max_create_time = 5; |
27 | 27 | ||
28 | int cgit_max_msg_len = 60; | ||
29 | |||
28 | char *cgit_repo_name = NULL; | 30 | char *cgit_repo_name = NULL; |
29 | char *cgit_repo_desc = NULL; | 31 | char *cgit_repo_desc = NULL; |
30 | char *cgit_repo_owner = NULL; | 32 | char *cgit_repo_owner = NULL; |
@@ -70,6 +72,8 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
70 | cgit_cache_static_ttl = atoi(value); | 72 | cgit_cache_static_ttl = atoi(value); |
71 | else if (!strcmp(name, "cache-dynamic-ttl")) | 73 | else if (!strcmp(name, "cache-dynamic-ttl")) |
72 | cgit_cache_dynamic_ttl = atoi(value); | 74 | cgit_cache_dynamic_ttl = atoi(value); |
75 | else if (!strcmp(name, "max-message-length")) | ||
76 | cgit_max_msg_len = atoi(value); | ||
73 | } | 77 | } |
74 | 78 | ||
75 | void cgit_repo_config_cb(const char *name, const char *value) | 79 | void cgit_repo_config_cb(const char *name, const char *value) |
@@ -23,7 +23,7 @@ void print_commit(struct commit *commit) | |||
23 | char *qry = fmt("id=%s", sha1_to_hex(commit->object.sha1)); | 23 | char *qry = fmt("id=%s", sha1_to_hex(commit->object.sha1)); |
24 | char *url = cgit_pageurl(cgit_query_repo, "commit", qry); | 24 | char *url = cgit_pageurl(cgit_query_repo, "commit", qry); |
25 | html_link_open(url, NULL, NULL); | 25 | html_link_open(url, NULL, NULL); |
26 | html_ntxt(80, info->subject); | 26 | html_ntxt(cgit_max_msg_len, info->subject); |
27 | html_link_close(); | 27 | html_link_close(); |
28 | html("</td><td>"); | 28 | html("</td><td>"); |
29 | html_txt(info->author); | 29 | html_txt(info->author); |
diff --git a/ui-summary.c b/ui-summary.c index 04d4912..5518d01 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -33,7 +33,7 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1, | |||
33 | url = cgit_pageurl(cgit_query_repo, "commit", | 33 | url = cgit_pageurl(cgit_query_repo, "commit", |
34 | fmt("id=%s", sha1_to_hex(sha1))); | 34 | fmt("id=%s", sha1_to_hex(sha1))); |
35 | html_link_open(url, NULL, NULL); | 35 | html_link_open(url, NULL, NULL); |
36 | html_ntxt(80, info->subject); | 36 | html_ntxt(cgit_max_msg_len, info->subject); |
37 | html_link_close(); | 37 | html_link_close(); |
38 | html("</td></tr>\n"); | 38 | html("</td></tr>\n"); |
39 | cgit_free_commitinfo(info); | 39 | cgit_free_commitinfo(info); |