From: Lars Hjemli Date: Mon, 1 Sep 2008 20:40:24 +0000 (+0200) Subject: Merge branch 'lh/clone' X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/288d502b3d8e7fa916104b486bbb146521e5c716?hp=-c Merge branch 'lh/clone' * lh/clone: Add support for cloning over http Conflicts: cmd.c --- 288d502b3d8e7fa916104b486bbb146521e5c716 diff --combined Makefile index 1163b02,78aad10..b002d44 --- a/Makefile +++ b/Makefile @@@ -4,7 -4,7 +4,7 @@@ CGIT_SCRIPT_PATH = /var/www/htdocs/cgi CGIT_CONFIG = /etc/cgitrc CACHE_ROOT = /var/cache/cgit SHA1_HEADER = -GIT_VER = 1.5.6 +GIT_VER = 1.6.0.rc1 GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 # @@@ -55,8 -55,8 +55,9 @@@ OBJECTS += configfile. OBJECTS += html.o OBJECTS += parsing.o OBJECTS += shared.o +OBJECTS += ui-atom.o OBJECTS += ui-blob.o + OBJECTS += ui-clone.o OBJECTS += ui-commit.o OBJECTS += ui-diff.o OBJECTS += ui-log.o @@@ -74,7 -74,7 +75,7 @@@ ifdef NEEDS_LIBICON endif -.PHONY: all git test install uninstall clean force-version get-git +.PHONY: all libgit test install uninstall clean force-version get-git all: cgit @@@ -91,15 -91,17 +92,15 @@@ CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_S CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' -cgit: $(OBJECTS) git/libgit.a git/xdiff/lib.a +cgit: $(OBJECTS) libgit $(QUIET_CC)$(CC) $(CFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) cgit.o: VERSION -include $(OBJECTS:.o=.d) -git/libgit.a: git +libgit: $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) libgit.a - -git/xdiff/lib.a: git $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) xdiff/lib.a test: all diff --combined cmd.c index c0e4db3,03e165c..40ac53e --- a/cmd.c +++ b/cmd.c @@@ -10,8 -10,8 +10,9 @@@ #include "cmd.h" #include "cache.h" #include "ui-shared.h" +#include "ui-atom.h" #include "ui-blob.h" + #include "ui-clone.h" #include "ui-commit.h" #include "ui-diff.h" #include "ui-log.h" @@@ -23,11 -23,11 +24,16 @@@ #include "ui-tag.h" #include "ui-tree.h" + static void HEAD_fn(struct cgit_context *ctx) + { + cgit_clone_head(ctx); + } + +static void atom_fn(struct cgit_context *ctx) +{ + cgit_print_atom(ctx->qry.head, ctx->qry.path, 10); +} + static void about_fn(struct cgit_context *ctx) { if (ctx->repo) @@@ -51,6 -51,11 +57,11 @@@ static void diff_fn(struct cgit_contex cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path); } + static void info_fn(struct cgit_context *ctx) + { + cgit_clone_info(ctx); + } + static void log_fn(struct cgit_context *ctx) { cgit_print_log(ctx->qry.sha1, ctx->qry.ofs, ctx->cfg.max_commit_count, @@@ -65,6 -70,11 +76,11 @@@ static void ls_cache_fn(struct cgit_con cache_ls(ctx->cfg.cache_root); } + static void objects_fn(struct cgit_context *ctx) + { + cgit_clone_objects(ctx); + } + static void repolist_fn(struct cgit_context *ctx) { cgit_print_repolist(); @@@ -108,13 -118,15 +124,16 @@@ static void tree_fn(struct cgit_contex struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx) { static struct cgit_cmd cmds[] = { + def_cmd(HEAD, 1, 0), + def_cmd(atom, 1, 0), def_cmd(about, 0, 1), def_cmd(blob, 1, 0), def_cmd(commit, 1, 1), def_cmd(diff, 1, 1), + def_cmd(info, 1, 0), def_cmd(log, 1, 1), def_cmd(ls_cache, 0, 0), + def_cmd(objects, 1, 0), def_cmd(patch, 1, 0), def_cmd(refs, 1, 1), def_cmd(repolist, 0, 0),