summaryrefslogtreecommitdiffabout
path: root/shared.c
authorLars Hjemli <hjemli@gmail.com>2007-06-18 07:42:10 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-06-18 08:38:40 (UTC)
commitf69250358a74efa5d7d9c562b2cdd80fad1430f1 (patch) (unidiff)
tree19c0ddab227d1c27a49046e559618cd067169591 /shared.c
parent4a0be586662843382ecfa53af34a13b291312bc0 (diff)
downloadcgit-f69250358a74efa5d7d9c562b2cdd80fad1430f1.zip
cgit-f69250358a74efa5d7d9c562b2cdd80fad1430f1.tar.gz
cgit-f69250358a74efa5d7d9c562b2cdd80fad1430f1.tar.bz2
Add version info from git-describe
A new script, gen-version.sh, is now invoked from 'make version' to generate the file VERSION. This file contains a version identifier generated by git-describe and is included in the Makefile. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--shared.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index f20fb5c..f7f43b2 100644
--- a/shared.c
+++ b/shared.c
@@ -1,78 +1,80 @@
1/* shared.c: global vars + some callback functions 1/* shared.c: global vars + some callback functions
2 * 2 *
3 * Copyright (C) 2006 Lars Hjemli 3 * Copyright (C) 2006 Lars Hjemli
4 * 4 *
5 * Licensed under GNU General Public License v2 5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text) 6 * (see COPYING for full license text)
7 */ 7 */
8 8
9#include "cgit.h" 9#include "cgit.h"
10 10
11struct repolist cgit_repolist; 11struct repolist cgit_repolist;
12struct repoinfo *cgit_repo; 12struct repoinfo *cgit_repo;
13int cgit_cmd; 13int cgit_cmd;
14 14
15const char *cgit_version = CGIT_VERSION;
16
15char *cgit_root_title = "Git repository browser"; 17char *cgit_root_title = "Git repository browser";
16char *cgit_css = "/cgit.css"; 18char *cgit_css = "/cgit.css";
17char *cgit_logo = "/git-logo.png"; 19char *cgit_logo = "/git-logo.png";
18char *cgit_index_header = NULL; 20char *cgit_index_header = NULL;
19char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/"; 21char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/";
20char *cgit_module_link = "./?repo=%s&page=commit&id=%s"; 22char *cgit_module_link = "./?repo=%s&page=commit&id=%s";
21char *cgit_agefile = "info/web/last-modified"; 23char *cgit_agefile = "info/web/last-modified";
22char *cgit_virtual_root = NULL; 24char *cgit_virtual_root = NULL;
23char *cgit_script_name = CGIT_SCRIPT_NAME; 25char *cgit_script_name = CGIT_SCRIPT_NAME;
24char *cgit_cache_root = "/var/cache/cgit"; 26char *cgit_cache_root = "/var/cache/cgit";
25char *cgit_repo_group = NULL; 27char *cgit_repo_group = NULL;
26 28
27int cgit_nocache = 0; 29int cgit_nocache = 0;
28int cgit_snapshots = 0; 30int cgit_snapshots = 0;
29int cgit_enable_log_filecount = 0; 31int cgit_enable_log_filecount = 0;
30int cgit_enable_log_linecount = 0; 32int cgit_enable_log_linecount = 0;
31int cgit_max_lock_attempts = 5; 33int cgit_max_lock_attempts = 5;
32int cgit_cache_root_ttl = 5; 34int cgit_cache_root_ttl = 5;
33int cgit_cache_repo_ttl = 5; 35int cgit_cache_repo_ttl = 5;
34int cgit_cache_dynamic_ttl = 5; 36int cgit_cache_dynamic_ttl = 5;
35int cgit_cache_static_ttl = -1; 37int cgit_cache_static_ttl = -1;
36int cgit_cache_max_create_time = 5; 38int cgit_cache_max_create_time = 5;
37int cgit_summary_log = 0; 39int cgit_summary_log = 0;
38 40
39int cgit_max_msg_len = 60; 41int cgit_max_msg_len = 60;
40int cgit_max_repodesc_len = 60; 42int cgit_max_repodesc_len = 60;
41int cgit_max_commit_count = 50; 43int cgit_max_commit_count = 50;
42 44
43int cgit_query_has_symref = 0; 45int cgit_query_has_symref = 0;
44int cgit_query_has_sha1 = 0; 46int cgit_query_has_sha1 = 0;
45 47
46char *cgit_querystring = NULL; 48char *cgit_querystring = NULL;
47char *cgit_query_repo = NULL; 49char *cgit_query_repo = NULL;
48char *cgit_query_page = NULL; 50char *cgit_query_page = NULL;
49char *cgit_query_head = NULL; 51char *cgit_query_head = NULL;
50char *cgit_query_search = NULL; 52char *cgit_query_search = NULL;
51char *cgit_query_sha1 = NULL; 53char *cgit_query_sha1 = NULL;
52char *cgit_query_sha2 = NULL; 54char *cgit_query_sha2 = NULL;
53char *cgit_query_path = NULL; 55char *cgit_query_path = NULL;
54char *cgit_query_name = NULL; 56char *cgit_query_name = NULL;
55int cgit_query_ofs = 0; 57int cgit_query_ofs = 0;
56 58
57int htmlfd = 0; 59int htmlfd = 0;
58 60
59 61
60int cgit_get_cmd_index(const char *cmd) 62int cgit_get_cmd_index(const char *cmd)
61{ 63{
62 static char *cmds[] = {"log", "commit", "diff", "tree", "blob", 64 static char *cmds[] = {"log", "commit", "diff", "tree", "blob",
63 "snapshot", NULL}; 65 "snapshot", NULL};
64 int i; 66 int i;
65 67
66 for(i = 0; cmds[i]; i++) 68 for(i = 0; cmds[i]; i++)
67 if (!strcmp(cmd, cmds[i])) 69 if (!strcmp(cmd, cmds[i]))
68 return i + 1; 70 return i + 1;
69 return 0; 71 return 0;
70} 72}
71 73
72int chk_zero(int result, char *msg) 74int chk_zero(int result, char *msg)
73{ 75{
74 if (result != 0) 76 if (result != 0)
75 die("%s: %s", msg, strerror(errno)); 77 die("%s: %s", msg, strerror(errno));
76 return result; 78 return result;
77} 79}
78 80