author | Lars Hjemli <hjemli@gmail.com> | 2006-12-20 21:48:27 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2006-12-20 21:48:27 (UTC) |
commit | 36aba00273e7af1b94bf8c5dd5068709d983d01e (patch) (unidiff) | |
tree | d9be4e6f27b115a799af40cad43445f63fbf2238 /shared.c | |
parent | a53042865a4ac8b1fa1d6b37720787601e181495 (diff) | |
download | cgit-36aba00273e7af1b94bf8c5dd5068709d983d01e.zip cgit-36aba00273e7af1b94bf8c5dd5068709d983d01e.tar.gz cgit-36aba00273e7af1b94bf8c5dd5068709d983d01e.tar.bz2 |
Add basic diff view
Finally, xdiff is used to show per-file diffs via commit view.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | shared.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -24,32 +24,33 @@ int cgit_cache_repo_ttl = 5; | |||
24 | int cgit_cache_dynamic_ttl = 5; | 24 | 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 | char *cgit_repo_name = NULL; | 28 | char *cgit_repo_name = NULL; |
29 | char *cgit_repo_desc = NULL; | 29 | char *cgit_repo_desc = NULL; |
30 | char *cgit_repo_owner = NULL; | 30 | char *cgit_repo_owner = NULL; |
31 | 31 | ||
32 | int cgit_query_has_symref = 0; | 32 | int cgit_query_has_symref = 0; |
33 | int cgit_query_has_sha1 = 0; | 33 | int cgit_query_has_sha1 = 0; |
34 | 34 | ||
35 | char *cgit_querystring = NULL; | 35 | char *cgit_querystring = NULL; |
36 | char *cgit_query_repo = NULL; | 36 | char *cgit_query_repo = NULL; |
37 | char *cgit_query_page = NULL; | 37 | char *cgit_query_page = NULL; |
38 | char *cgit_query_head = NULL; | 38 | char *cgit_query_head = NULL; |
39 | char *cgit_query_sha1 = NULL; | 39 | char *cgit_query_sha1 = NULL; |
40 | char *cgit_query_sha2 = NULL; | ||
40 | int cgit_query_ofs = 0; | 41 | int cgit_query_ofs = 0; |
41 | 42 | ||
42 | int htmlfd = 0; | 43 | int htmlfd = 0; |
43 | 44 | ||
44 | void cgit_global_config_cb(const char *name, const char *value) | 45 | void cgit_global_config_cb(const char *name, const char *value) |
45 | { | 46 | { |
46 | if (!strcmp(name, "root")) | 47 | if (!strcmp(name, "root")) |
47 | cgit_root = xstrdup(value); | 48 | cgit_root = xstrdup(value); |
48 | else if (!strcmp(name, "root-title")) | 49 | else if (!strcmp(name, "root-title")) |
49 | cgit_root_title = xstrdup(value); | 50 | cgit_root_title = xstrdup(value); |
50 | else if (!strcmp(name, "css")) | 51 | else if (!strcmp(name, "css")) |
51 | cgit_css = xstrdup(value); | 52 | cgit_css = xstrdup(value); |
52 | else if (!strcmp(name, "logo")) | 53 | else if (!strcmp(name, "logo")) |
53 | cgit_logo = xstrdup(value); | 54 | cgit_logo = xstrdup(value); |
54 | else if (!strcmp(name, "logo-link")) | 55 | else if (!strcmp(name, "logo-link")) |
55 | cgit_logo_link = xstrdup(value); | 56 | cgit_logo_link = xstrdup(value); |
@@ -70,31 +71,34 @@ void cgit_repo_config_cb(const char *name, const char *value) | |||
70 | else if (!strcmp(name, "owner")) | 71 | else if (!strcmp(name, "owner")) |
71 | cgit_repo_owner = xstrdup(value); | 72 | cgit_repo_owner = xstrdup(value); |
72 | } | 73 | } |
73 | 74 | ||
74 | void cgit_querystring_cb(const char *name, const char *value) | 75 | void cgit_querystring_cb(const char *name, const char *value) |
75 | { | 76 | { |
76 | if (!strcmp(name,"r")) { | 77 | if (!strcmp(name,"r")) { |
77 | cgit_query_repo = xstrdup(value); | 78 | cgit_query_repo = xstrdup(value); |
78 | } else if (!strcmp(name, "p")) { | 79 | } else if (!strcmp(name, "p")) { |
79 | cgit_query_page = xstrdup(value); | 80 | cgit_query_page = xstrdup(value); |
80 | } else if (!strcmp(name, "h")) { | 81 | } else if (!strcmp(name, "h")) { |
81 | cgit_query_head = xstrdup(value); | 82 | cgit_query_head = xstrdup(value); |
82 | cgit_query_has_symref = 1; | 83 | cgit_query_has_symref = 1; |
83 | } else if (!strcmp(name, "id")) { | 84 | } else if (!strcmp(name, "id")) { |
84 | cgit_query_sha1 = xstrdup(value); | 85 | cgit_query_sha1 = xstrdup(value); |
85 | cgit_query_has_sha1 = 1; | 86 | cgit_query_has_sha1 = 1; |
87 | } else if (!strcmp(name, "id2")) { | ||
88 | cgit_query_sha2 = xstrdup(value); | ||
89 | cgit_query_has_sha1 = 1; | ||
86 | } else if (!strcmp(name, "ofs")) { | 90 | } else if (!strcmp(name, "ofs")) { |
87 | cgit_query_ofs = atoi(value); | 91 | cgit_query_ofs = atoi(value); |
88 | } | 92 | } |
89 | } | 93 | } |
90 | 94 | ||
91 | void *cgit_free_commitinfo(struct commitinfo *info) | 95 | void *cgit_free_commitinfo(struct commitinfo *info) |
92 | { | 96 | { |
93 | free(info->author); | 97 | free(info->author); |
94 | free(info->author_email); | 98 | free(info->author_email); |
95 | free(info->committer); | 99 | free(info->committer); |
96 | free(info->committer_email); | 100 | free(info->committer_email); |
97 | free(info->subject); | 101 | free(info->subject); |
98 | free(info); | 102 | free(info); |
99 | return NULL; | 103 | return NULL; |
100 | } | 104 | } |