From: Junio C Hamano Date: Sat, 29 Apr 2006 08:33:16 +0000 (-0700) Subject: Merge branch 'jc/diff' into next X-Git-Tag: v1.4.1-rc1~164 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a0c5081a78bef2167d9663fe0847b757a6a797f5?hp=-c Merge branch 'jc/diff' into next * jc/diff: built-in diff: assorted updates. built-in diff. --- a0c5081a78bef2167d9663fe0847b757a6a797f5 diff --combined Makefile index 576067fafb,277c1ac079..895e6a1e4a --- a/Makefile +++ b/Makefile @@@ -204,7 -204,7 +204,7 @@@ DIFF_OBJS = diffcore-delta.o log-tree.o LIB_OBJS = \ - blob.o commit.o connect.o csum-file.o \ + blob.o commit.o connect.o csum-file.o cache-tree.o \ date.o diff-delta.o entry.o exec_cmd.o ident.o index.o \ object.o pack-check.o patch-delta.o path.o pkt-line.o \ quote.o read-cache.o refs.o run-command.o \ @@@ -214,7 -214,7 +214,7 @@@ $(DIFF_OBJS) BUILTIN_OBJS = \ - builtin-log.o builtin-help.o builtin-count.o - builtin-log.o builtin-help.o builtin-diff.o ++ builtin-log.o builtin-help.o builtin-count.o builtin-diff.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) LIBS = $(GITLIBS) -lz @@@ -609,10 -609,7 +609,10 @@@ test-date$X: test-date.c date.o ctype. $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) test-date.c date.o ctype.o test-delta$X: test-delta.c diff-delta.o patch-delta.o - $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^ -lz + $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^ + +test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS) + $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) check: for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done diff --combined builtin.h index 15bb313ee2,52ffa526f8..bf310dda9e --- a/builtin.h +++ b/builtin.h @@@ -19,7 -19,6 +19,8 @@@ extern int cmd_version(int argc, const extern int cmd_whatchanged(int argc, const char **argv, char **envp); extern int cmd_show(int argc, const char **argv, char **envp); extern int cmd_log(int argc, const char **argv, char **envp); +extern int cmd_format_patch(int argc, const char **argv, char **envp); +extern int cmd_count_objects(int argc, const char **argv, char **envp); + extern int cmd_diff(int argc, const char **argv, char **envp); #endif diff --combined git.c index 6d030b01cc,ff9b87abbc..a6ec3bcbe5 --- a/git.c +++ b/git.c @@@ -46,8 -46,7 +46,9 @@@ static void handle_internal_command(in { "log", cmd_log }, { "whatchanged", cmd_whatchanged }, { "show", cmd_show }, + { "fmt-patch", cmd_format_patch }, + { "count-objects", cmd_count_objects }, + { "diffn", cmd_diff }, }; int i; diff --combined revision.c index b6ed0149a5,4381d455e4..3545df6119 --- a/revision.c +++ b/revision.c @@@ -664,6 -664,7 +664,7 @@@ int setup_revisions(int argc, const cha } if (!strcmp(arg, "-c")) { revs->diff = 1; + revs->dense_combined_merges = 0; revs->combine_merges = 1; continue; } @@@ -740,11 -741,6 +741,11 @@@ include = get_reference(revs, next, sha1, flags); if (!exclude || !include) die("Invalid revision range %s..%s", arg, next); + + if (!seen_dashdash) { + *dotdot = '.'; + verify_non_filename(revs->prefix, arg); + } add_pending_object(revs, exclude, this); add_pending_object(revs, include, next); continue; @@@ -762,20 -758,13 +763,20 @@@ if (seen_dashdash || local_flags) die("bad revision '%s'", arg); - /* If we didn't have a "--", all filenames must exist */ + /* If we didn't have a "--": + * (1) all filenames must exist; + * (2) all rev-args must not be interpretable + * as a valid filename. + * but the latter we have checked in the main loop. + */ for (j = i; j < argc; j++) verify_filename(revs->prefix, argv[j]); revs->prune_data = get_pathspec(revs->prefix, argv + i); break; } + if (!seen_dashdash) + verify_non_filename(revs->prefix, arg); object = get_reference(revs, arg, sha1, flags ^ local_flags); add_pending_object(revs, object, arg); }