From: Junio C Hamano Date: Fri, 28 Jul 2006 19:23:52 +0000 (-0700) Subject: Merge branch 'jc/diff' X-Git-Tag: v1.4.2-rc3~43 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f789f829933664dc4c3b0af7f1e2c5e37fc8621e?hp=-c Merge branch 'jc/diff' * jc/diff: git-diff A...B to (usually) mean "git-diff `git-merge-base A B` B" --- f789f829933664dc4c3b0af7f1e2c5e37fc8621e diff --combined builtin-diff.c index 7d5ad6271e,efd315240f..dca223235d --- a/builtin-diff.c +++ b/builtin-diff.c @@@ -250,9 -250,8 +250,9 @@@ int cmd_diff(int argc, const char **arg * Other cases are errors. */ - git_config(git_diff_ui_config); init_revisions(&rev); + git_config(git_diff_ui_config); + diff_setup(&rev.diffopt); argc = setup_revisions(argc, argv, &rev, NULL); if (!rev.diffopt.output_format) { @@@ -347,7 -346,15 +347,15 @@@ return builtin_diff_index(&rev, argc, argv); else if (ents == 2) return builtin_diff_tree(&rev, argc, argv, ent); + else if ((ents == 3) && (ent[0].item->flags & UNINTERESTING)) { + /* diff A...B where there is one sane merge base between + * A and B. We have ent[0] == merge-base, ent[1] == A, + * and ent[2] == B. Show diff between the base and B. + */ + return builtin_diff_tree(&rev, argc, argv, ent); + } else - return builtin_diff_combined(&rev, argc, argv, ent, ents); + return builtin_diff_combined(&rev, argc, argv, + ent, ents); usage(builtin_diff_usage); }