diff options
| -rw-r--r-- | Makefile | 16 | ||||
| -rw-r--r-- | cgit.c | 14 | ||||
| -rw-r--r-- | cgit.css | 104 | ||||
| -rw-r--r-- | cgit.h | 5 | ||||
| -rw-r--r-- | cgitrc.5.txt | 17 | ||||
| -rwxr-xr-x | filters/syntax-highlighting.sh | 29 | ||||
| -rw-r--r-- | shared.c | 1 | ||||
| -rw-r--r-- | ui-commit.c | 11 | ||||
| -rw-r--r-- | ui-diff.c | 62 | ||||
| -rw-r--r-- | ui-log.c | 4 | ||||
| -rw-r--r-- | ui-refs.c | 4 | ||||
| -rw-r--r-- | ui-shared.c | 43 | ||||
| -rw-r--r-- | ui-shared.h | 5 | ||||
| -rw-r--r-- | ui-snapshot.c | 14 | ||||
| -rw-r--r-- | ui-ssdiff.c | 369 | ||||
| -rw-r--r-- | ui-ssdiff.h | 13 | ||||
| -rw-r--r-- | ui-tag.c | 24 | ||||
| -rw-r--r-- | ui-tree.c | 6 |
18 files changed, 684 insertions, 57 deletions
| @@ -11,6 +11,9 @@ INSTALL = install | |||
| 11 | 11 | ||
| 12 | # Define NO_STRCASESTR if you don't have strcasestr. | 12 | # Define NO_STRCASESTR if you don't have strcasestr. |
| 13 | # | 13 | # |
| 14 | # Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1 | ||
| 15 | # implementation (slower). | ||
| 16 | # | ||
| 14 | # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). | 17 | # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). |
| 15 | # | 18 | # |
| 16 | 19 | ||
| @@ -68,7 +71,7 @@ endif | |||
| 68 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< | 71 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
| 69 | 72 | ||
| 70 | 73 | ||
| 71 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto | 74 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz |
| 72 | OBJECTS = | 75 | OBJECTS = |
| 73 | OBJECTS += cache.o | 76 | OBJECTS += cache.o |
| 74 | OBJECTS += cgit.o | 77 | OBJECTS += cgit.o |
| @@ -90,6 +93,7 @@ OBJECTS += ui-refs.o | |||
| 90 | OBJECTS += ui-repolist.o | 93 | OBJECTS += ui-repolist.o |
| 91 | OBJECTS += ui-shared.o | 94 | OBJECTS += ui-shared.o |
| 92 | OBJECTS += ui-snapshot.o | 95 | OBJECTS += ui-snapshot.o |
| 96 | OBJECTS += ui-ssdiff.o | ||
| 93 | OBJECTS += ui-stats.o | 97 | OBJECTS += ui-stats.o |
| 94 | OBJECTS += ui-summary.o | 98 | OBJECTS += ui-summary.o |
| 95 | OBJECTS += ui-tag.o | 99 | OBJECTS += ui-tag.o |
| @@ -123,6 +127,12 @@ endif | |||
| 123 | ifdef NO_STRCASESTR | 127 | ifdef NO_STRCASESTR |
| 124 | CFLAGS += -DNO_STRCASESTR | 128 | CFLAGS += -DNO_STRCASESTR |
| 125 | endif | 129 | endif |
| 130 | ifdef NO_OPENSSL | ||
| 131 | CFLAGS += -DNO_OPENSSL | ||
| 132 | GIT_OPTIONS += NO_OPENSSL=1 | ||
| 133 | else | ||
| 134 | EXTLIBS += -lcrypto | ||
| 135 | endif | ||
| 126 | 136 | ||
| 127 | cgit: $(OBJECTS) libgit | 137 | cgit: $(OBJECTS) libgit |
| 128 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) | 138 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) |
| @@ -132,8 +142,8 @@ cgit.o: VERSION | |||
| 132 | -include $(OBJECTS:.o=.d) | 142 | -include $(OBJECTS:.o=.d) |
| 133 | 143 | ||
| 134 | libgit: | 144 | libgit: |
| 135 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 libgit.a | 145 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a |
| 136 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 xdiff/lib.a | 146 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a |
| 137 | 147 | ||
| 138 | test: all | 148 | test: all |
| 139 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all | 149 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all |
| @@ -60,6 +60,8 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) | |||
| 60 | repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); | 60 | repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
| 61 | else if (!strcmp(name, "enable-log-linecount")) | 61 | else if (!strcmp(name, "enable-log-linecount")) |
| 62 | repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); | 62 | repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
| 63 | else if (!strcmp(name, "enable-remote-branches")) | ||
| 64 | repo->enable_remote_branches = atoi(value); | ||
| 63 | else if (!strcmp(name, "max-stats")) | 65 | else if (!strcmp(name, "max-stats")) |
| 64 | repo->max_stats = cgit_find_stats_period(value, NULL); | 66 | repo->max_stats = cgit_find_stats_period(value, NULL); |
| 65 | else if (!strcmp(name, "module-link")) | 67 | else if (!strcmp(name, "module-link")) |
| @@ -137,6 +139,8 @@ void config_cb(const char *name, const char *value) | |||
| 137 | ctx.cfg.enable_log_filecount = atoi(value); | 139 | ctx.cfg.enable_log_filecount = atoi(value); |
| 138 | else if (!strcmp(name, "enable-log-linecount")) | 140 | else if (!strcmp(name, "enable-log-linecount")) |
| 139 | ctx.cfg.enable_log_linecount = atoi(value); | 141 | ctx.cfg.enable_log_linecount = atoi(value); |
| 142 | else if (!strcmp(name, "enable-remote-branches")) | ||
| 143 | ctx.cfg.enable_remote_branches = atoi(value); | ||
| 140 | else if (!strcmp(name, "enable-tree-linenumbers")) | 144 | else if (!strcmp(name, "enable-tree-linenumbers")) |
| 141 | ctx.cfg.enable_tree_linenumbers = atoi(value); | 145 | ctx.cfg.enable_tree_linenumbers = atoi(value); |
| 142 | else if (!strcmp(name, "max-stats")) | 146 | else if (!strcmp(name, "max-stats")) |
| @@ -165,6 +169,8 @@ void config_cb(const char *name, const char *value) | |||
| 165 | ctx.cfg.max_msg_len = atoi(value); | 169 | ctx.cfg.max_msg_len = atoi(value); |
| 166 | else if (!strcmp(name, "max-repodesc-length")) | 170 | else if (!strcmp(name, "max-repodesc-length")) |
| 167 | ctx.cfg.max_repodesc_len = atoi(value); | 171 | ctx.cfg.max_repodesc_len = atoi(value); |
| 172 | else if (!strcmp(name, "max-blob-size")) | ||
| 173 | ctx.cfg.max_blob_size = atoi(value); | ||
| 168 | else if (!strcmp(name, "max-repo-count")) | 174 | else if (!strcmp(name, "max-repo-count")) |
| 169 | ctx.cfg.max_repo_count = atoi(value); | 175 | ctx.cfg.max_repo_count = atoi(value); |
| 170 | else if (!strcmp(name, "max-commit-count")) | 176 | else if (!strcmp(name, "max-commit-count")) |
| @@ -182,6 +188,8 @@ void config_cb(const char *name, const char *value) | |||
| 182 | ctx.cfg.summary_branches = atoi(value); | 188 | ctx.cfg.summary_branches = atoi(value); |
| 183 | else if (!strcmp(name, "summary-tags")) | 189 | else if (!strcmp(name, "summary-tags")) |
| 184 | ctx.cfg.summary_tags = atoi(value); | 190 | ctx.cfg.summary_tags = atoi(value); |
| 191 | else if (!strcmp(name, "side-by-side-diffs")) | ||
| 192 | ctx.cfg.ssdiff = atoi(value); | ||
| 185 | else if (!strcmp(name, "agefile")) | 193 | else if (!strcmp(name, "agefile")) |
| 186 | ctx.cfg.agefile = xstrdup(value); | 194 | ctx.cfg.agefile = xstrdup(value); |
| 187 | else if (!strcmp(name, "renamelimit")) | 195 | else if (!strcmp(name, "renamelimit")) |
| @@ -209,6 +217,8 @@ static void querystring_cb(const char *name, const char *value) | |||
| 209 | } else if (!strcmp(name, "p")) { | 217 | } else if (!strcmp(name, "p")) { |
| 210 | ctx.qry.page = xstrdup(value); | 218 | ctx.qry.page = xstrdup(value); |
| 211 | } else if (!strcmp(name, "url")) { | 219 | } else if (!strcmp(name, "url")) { |
| 220 | if (*value == '/') | ||
| 221 | value++; | ||
| 212 | ctx.qry.url = xstrdup(value); | 222 | ctx.qry.url = xstrdup(value); |
| 213 | cgit_parse_url(value); | 223 | cgit_parse_url(value); |
| 214 | } else if (!strcmp(name, "qt")) { | 224 | } else if (!strcmp(name, "qt")) { |
| @@ -238,6 +248,8 @@ static void querystring_cb(const char *name, const char *value) | |||
| 238 | ctx.qry.showmsg = atoi(value); | 248 | ctx.qry.showmsg = atoi(value); |
| 239 | } else if (!strcmp(name, "period")) { | 249 | } else if (!strcmp(name, "period")) { |
| 240 | ctx.qry.period = xstrdup(value); | 250 | ctx.qry.period = xstrdup(value); |
| 251 | } else if (!strcmp(name, "ss")) { | ||
| 252 | ctx.qry.ssdiff = atoi(value); | ||
| 241 | } | 253 | } |
| 242 | } | 254 | } |
| 243 | 255 | ||
| @@ -268,6 +280,7 @@ static void prepare_context(struct cgit_context *ctx) | |||
| 268 | ctx->cfg.max_lock_attempts = 5; | 280 | ctx->cfg.max_lock_attempts = 5; |
| 269 | ctx->cfg.max_msg_len = 80; | 281 | ctx->cfg.max_msg_len = 80; |
| 270 | ctx->cfg.max_repodesc_len = 80; | 282 | ctx->cfg.max_repodesc_len = 80; |
| 283 | ctx->cfg.max_blob_size = 0; | ||
| 271 | ctx->cfg.max_stats = 0; | 284 | ctx->cfg.max_stats = 0; |
| 272 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; | 285 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |
| 273 | ctx->cfg.renamelimit = -1; | 286 | ctx->cfg.renamelimit = -1; |
| @@ -279,6 +292,7 @@ static void prepare_context(struct cgit_context *ctx) | |||
| 279 | ctx->cfg.summary_branches = 10; | ||
