From: Junio C Hamano Date: Mon, 28 Oct 2013 17:43:16 +0000 (-0700) Subject: Merge branch 'jc/revision-range-unpeel' X-Git-Tag: v1.8.5-rc0~24 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2d99baab2f054926a1b26f7854fc50b701151bd7 Merge branch 'jc/revision-range-unpeel' "git rev-list --objects ^v1.0^ v1.0" gave v1.0 tag itself in the output, but "git rev-list --objects v1.0^..v1.0" did not. * jc/revision-range-unpeel: revision: do not peel tags used in range notation --- 2d99baab2f054926a1b26f7854fc50b701151bd7 diff --cc revision.c index 0173e0148b,7010aff817..7e03e154f4 --- a/revision.c +++ b/revision.c @@@ -1438,11 -1164,34 +1426,37 @@@ int handle_revision_arg(const char *arg verify_non_filename(revs->prefix, arg); } - if (symmetric) { + a_obj = parse_object(from_sha1); + b_obj = parse_object(sha1); + if (!a_obj || !b_obj) { + missing: + if (revs->ignore_missing) + return 0; + die(symmetric + ? "Invalid symmetric difference expression %s" + : "Invalid revision range %s", arg); + } + + if (!symmetric) { + /* just A..B */ + a_flags = flags_exclude; + } else { + /* A...B -- find merge bases between the two */ + struct commit *a, *b; + struct commit_list *exclude; + + a = (a_obj->type == OBJ_COMMIT + ? (struct commit *)a_obj + : lookup_commit_reference(a_obj->sha1)); + b = (b_obj->type == OBJ_COMMIT + ? (struct commit *)b_obj + : lookup_commit_reference(b_obj->sha1)); + if (!a || !b) + goto missing; exclude = get_merge_bases(a, b, 1); + add_rev_cmdline_list(revs, exclude, + REV_CMD_MERGE_BASE, + flags_exclude); add_pending_commit_list(revs, exclude, flags_exclude); free_commit_list(exclude);