author | Lars Hjemli <hjemli@gmail.com> | 2007-06-18 07:42:10 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-06-18 08:38:40 (UTC) |
commit | f69250358a74efa5d7d9c562b2cdd80fad1430f1 (patch) (unidiff) | |
tree | 19c0ddab227d1c27a49046e559618cd067169591 /shared.c | |
parent | 4a0be586662843382ecfa53af34a13b291312bc0 (diff) | |
download | cgit-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>
-rw-r--r-- | shared.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 | ||
11 | struct repolist cgit_repolist; | 11 | struct repolist cgit_repolist; |
12 | struct repoinfo *cgit_repo; | 12 | struct repoinfo *cgit_repo; |
13 | int cgit_cmd; | 13 | int cgit_cmd; |
14 | 14 | ||
15 | const char *cgit_version = CGIT_VERSION; | ||
16 | |||
15 | char *cgit_root_title = "Git repository browser"; | 17 | char *cgit_root_title = "Git repository browser"; |
16 | char *cgit_css = "/cgit.css"; | 18 | char *cgit_css = "/cgit.css"; |
17 | char *cgit_logo = "/git-logo.png"; | 19 | char *cgit_logo = "/git-logo.png"; |
18 | char *cgit_index_header = NULL; | 20 | char *cgit_index_header = NULL; |
19 | char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/"; | 21 | char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/"; |
20 | char *cgit_module_link = "./?repo=%s&page=commit&id=%s"; | 22 | char *cgit_module_link = "./?repo=%s&page=commit&id=%s"; |
21 | char *cgit_agefile = "info/web/last-modified"; | 23 | char *cgit_agefile = "info/web/last-modified"; |
22 | char *cgit_virtual_root = NULL; | 24 | char *cgit_virtual_root = NULL; |
23 | char *cgit_script_name = CGIT_SCRIPT_NAME; | 25 | char *cgit_script_name = CGIT_SCRIPT_NAME; |
24 | char *cgit_cache_root = "/var/cache/cgit"; | 26 | char *cgit_cache_root = "/var/cache/cgit"; |
25 | char *cgit_repo_group = NULL; | 27 | char *cgit_repo_group = NULL; |
26 | 28 | ||
27 | int cgit_nocache = 0; | 29 | int cgit_nocache = 0; |
28 | int cgit_snapshots = 0; | 30 | int cgit_snapshots = 0; |
29 | int cgit_enable_log_filecount = 0; | 31 | int cgit_enable_log_filecount = 0; |
30 | int cgit_enable_log_linecount = 0; | 32 | int cgit_enable_log_linecount = 0; |
31 | int cgit_max_lock_attempts = 5; | 33 | int cgit_max_lock_attempts = 5; |
32 | int cgit_cache_root_ttl = 5; | 34 | int cgit_cache_root_ttl = 5; |
33 | int cgit_cache_repo_ttl = 5; | 35 | int cgit_cache_repo_ttl = 5; |
34 | int cgit_cache_dynamic_ttl = 5; | 36 | int cgit_cache_dynamic_ttl = 5; |
35 | int cgit_cache_static_ttl = -1; | 37 | int cgit_cache_static_ttl = -1; |
36 | int cgit_cache_max_create_time = 5; | 38 | int cgit_cache_max_create_time = 5; |
37 | int cgit_summary_log = 0; | 39 | int cgit_summary_log = 0; |
38 | 40 | ||
39 | int cgit_max_msg_len = 60; | 41 | int cgit_max_msg_len = 60; |
40 | int cgit_max_repodesc_len = 60; | 42 | int cgit_max_repodesc_len = 60; |
41 | int cgit_max_commit_count = 50; | 43 | int cgit_max_commit_count = 50; |
42 | 44 | ||
43 | int cgit_query_has_symref = 0; | 45 | int cgit_query_has_symref = 0; |
44 | int cgit_query_has_sha1 = 0; | 46 | int cgit_query_has_sha1 = 0; |
45 | 47 | ||
46 | char *cgit_querystring = NULL; | 48 | char *cgit_querystring = NULL; |
47 | char *cgit_query_repo = NULL; | 49 | char *cgit_query_repo = NULL; |
48 | char *cgit_query_page = NULL; | 50 | char *cgit_query_page = NULL; |
49 | char *cgit_query_head = NULL; | 51 | char *cgit_query_head = NULL; |
50 | char *cgit_query_search = NULL; | 52 | char *cgit_query_search = NULL; |
51 | char *cgit_query_sha1 = NULL; | 53 | char *cgit_query_sha1 = NULL; |
52 | char *cgit_query_sha2 = NULL; | 54 | char *cgit_query_sha2 = NULL; |
53 | char *cgit_query_path = NULL; | 55 | char *cgit_query_path = NULL; |
54 | char *cgit_query_name = NULL; | 56 | char *cgit_query_name = NULL; |
55 | int cgit_query_ofs = 0; | 57 | int cgit_query_ofs = 0; |
56 | 58 | ||
57 | int htmlfd = 0; | 59 | int htmlfd = 0; |
58 | 60 | ||
59 | 61 | ||
60 | int cgit_get_cmd_index(const char *cmd) | 62 | int 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 | ||
72 | int chk_zero(int result, char *msg) | 74 | int 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 | ||