diff options
| -rw-r--r-- | Makefile | 30 | ||||
| -rw-r--r-- | cache.h | 1 | ||||
| -rw-r--r-- | cgit.c | 88 | ||||
| -rw-r--r-- | cgit.css | 148 | ||||
| -rw-r--r-- | cgit.h | 26 | ||||
| -rw-r--r-- | cgitrc.5.txt | 68 | ||||
| -rw-r--r-- | cmd.c | 48 | ||||
| -rw-r--r-- | cmd.h | 3 | ||||
| -rwxr-xr-x | filters/commit-links.sh | 16 | ||||
| -rwxr-xr-x | filters/syntax-highlighting.sh | 29 | ||||
| m--------- | git | 0 | ||||
| -rw-r--r-- | html.c | 84 | ||||
| -rw-r--r-- | html.h | 21 | ||||
| -rw-r--r-- | scan-tree.c | 123 | ||||
| -rw-r--r-- | scan-tree.h | 3 | ||||
| -rw-r--r-- | shared.c | 90 | ||||
| -rw-r--r-- | ui-atom.c | 4 | ||||
| -rw-r--r-- | ui-blob.c | 37 | ||||
| -rw-r--r-- | ui-blob.h | 1 | ||||
| -rw-r--r-- | ui-commit.c | 46 | ||||
| -rw-r--r-- | ui-commit.h | 2 | ||||
| -rw-r--r-- | ui-diff.c | 94 | ||||
| -rw-r--r-- | ui-log.c | 56 | ||||
| -rw-r--r-- | ui-patch.c | 8 | ||||
| -rw-r--r-- | ui-patch.h | 2 | ||||
| -rw-r--r-- | ui-plain.c | 70 | ||||
| -rw-r--r-- | ui-refs.c | 4 | ||||
| -rw-r--r-- | ui-repolist.c | 6 | ||||
| -rw-r--r-- | ui-shared.c | 270 | ||||
| -rw-r--r-- | ui-shared.h | 71 | ||||
| -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-stats.c | 26 | ||||
| -rw-r--r-- | ui-summary.c | 42 | ||||
| -rw-r--r-- | ui-tag.c | 24 | ||||
| -rw-r--r-- | ui-tree.c | 27 |
37 files changed, 1620 insertions, 344 deletions
| @@ -5,14 +5,22 @@ CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) | |||
| 5 | CGIT_CONFIG = /etc/cgitrc | 5 | CGIT_CONFIG = /etc/cgitrc |
| 6 | CACHE_ROOT = /var/cache/cgit | 6 | CACHE_ROOT = /var/cache/cgit |
| 7 | SHA1_HEADER = <openssl/sha.h> | 7 | SHA1_HEADER = <openssl/sha.h> |
| 8 | GIT_VER = 1.6.4.3 | 8 | GIT_VER = 1.7.3 |
| 9 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 | 9 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 |
| 10 | INSTALL = install | 10 | 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 | # |
| 19 | # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) | ||
| 20 | # do not support the 'size specifiers' introduced by C99, namely ll, hh, | ||
| 21 | # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). | ||
| 22 | # some C compilers supported these specifiers prior to C99 as an extension. | ||
| 23 | # | ||
| 16 | 24 | ||
| 17 | #-include config.mak | 25 | #-include config.mak |
| 18 | 26 | ||
| @@ -68,7 +76,7 @@ endif | |||
| 68 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< | 76 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
| 69 | 77 | ||
| 70 | 78 | ||
| 71 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto | 79 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread |
| 72 | OBJECTS = | 80 | OBJECTS = |
| 73 | OBJECTS += cache.o | 81 | OBJECTS += cache.o |
| 74 | OBJECTS += cgit.o | 82 | OBJECTS += cgit.o |
| @@ -90,6 +98,7 @@ OBJECTS += ui-refs.o | |||
| 90 | OBJECTS += ui-repolist.o | 98 | OBJECTS += ui-repolist.o |
| 91 | OBJECTS += ui-shared.o | 99 | OBJECTS += ui-shared.o |
| 92 | OBJECTS += ui-snapshot.o | 100 | OBJECTS += ui-snapshot.o |
| 101 | OBJECTS += ui-ssdiff.o | ||
| 93 | OBJECTS += ui-stats.o | 102 | OBJECTS += ui-stats.o |
| 94 | OBJECTS += ui-summary.o | 103 | OBJECTS += ui-summary.o |
| 95 | OBJECTS += ui-tag.o | 104 | OBJECTS += ui-tag.o |
| @@ -123,17 +132,28 @@ endif | |||
| 123 | ifdef NO_STRCASESTR | 132 | ifdef NO_STRCASESTR |
| 124 | CFLAGS += -DNO_STRCASESTR | 133 | CFLAGS += -DNO_STRCASESTR |
| 125 | endif | 134 | endif |
| 135 | ifdef NO_C99_FORMAT | ||
| 136 | CFLAGS += -DNO_C99_FORMAT | ||
| 137 | endif | ||
| 138 | ifdef NO_OPENSSL | ||
| 139 | CFLAGS += -DNO_OPENSSL | ||
| 140 | GIT_OPTIONS += NO_OPENSSL=1 | ||
| 141 | else | ||
| 142 | EXTLIBS += -lcrypto | ||
| 143 | endif | ||
| 126 | 144 | ||
| 127 | cgit: $(OBJECTS) libgit | 145 | cgit: $(OBJECTS) libgit |
| 128 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) | 146 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) |
| 129 | 147 | ||
| 130 | cgit.o: VERSION | 148 | cgit.o: VERSION |
| 131 | 149 | ||
| 132 | -include $(OBJECTS:.o=.d) | 150 | ifneq "$(MAKECMDGOALS)" "clean" |
| 151 | -include $(OBJECTS:.o=.d) | ||
| 152 | endif | ||
| 133 | 153 | ||
| 134 | libgit: | 154 | libgit: |
| 135 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 libgit.a | 155 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a |
| 136 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 xdiff/lib.a | 156 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a |
| 137 | 157 | ||
| 138 | test: all | 158 | test: all |
| 139 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all | 159 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all |
| @@ -30,6 +30,7 @@ extern int cache_process(int size, const char *path, const char *key, int ttl, | |||
| 30 | extern int cache_ls(const char *path); | 30 | extern int cache_ls(const char *path); |
| 31 | 31 | ||
| 32 | /* Print a message to stdout */ | 32 | /* Print a message to stdout */ |
| 33 | __attribute__((format (printf,1,2))) | ||
| 33 | extern void cache_log(const char *format, ...); | 34 | extern void cache_log(const char *format, ...); |
| 34 | 35 | ||
| 35 | extern unsigned long hash_str(const char *str); | 36 | extern unsigned long hash_str(const char *str); |
| @@ -1,6 +1,7 @@ | |||
| 1 | /* cgit.c: cgi for the git scm | 1 | /* cgit.c: cgi for the git scm |
| 2 | * | 2 | * |
| 3 | * Copyright (C) 2006 Lars Hjemli | 3 | * Copyright (C) 2006 Lars Hjemli |
| 4 | * Copyright (C) 2010 Jason A. Donenfeld <Jason@zx2c4.com> | ||
| 4 | * | 5 | * |
| 5 | * Licensed under GNU General Public License v2 | 6 | * Licensed under GNU General Public License v2 |
| 6 | * (see COPYING for full license text) | 7 | * (see COPYING for full license text) |
| @@ -21,7 +22,7 @@ void add_mimetype(const char *name, const char *value) | |||
| 21 | { | 22 | { |
| 22 | struct string_list_item *item; | 23 | struct string_list_item *item; |
| 23 | 24 | ||
| 24 | item = string_list_insert(xstrdup(name), &ctx.cfg.mimetypes); | ||
