From: Junio C Hamano Date: Wed, 15 Jul 2015 18:41:16 +0000 (-0700) Subject: Merge branch 'jc/do-not-feed-tags-to-clear-commit-marks' into maint X-Git-Tag: v2.4.6~11 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/93eba05b4f0b235dd859d9a9ed6ebb1ed49e1d60?ds=inline;hp=-c Merge branch 'jc/do-not-feed-tags-to-clear-commit-marks' into maint "git format-patch --ignore-if-upstream A..B" did not like to be fed tags as boundary commits. * jc/do-not-feed-tags-to-clear-commit-marks: format-patch: do not feed tags to clear_commit_marks() --- 93eba05b4f0b235dd859d9a9ed6ebb1ed49e1d60 diff --combined builtin/log.c index 4c4e6be28c,39181e239f..7b343c1aaf --- a/builtin/log.c +++ b/builtin/log.c @@@ -38,8 -38,8 +38,8 @@@ static const char *fmt_patch_subject_pr static const char *fmt_pretty; static const char * const builtin_log_usage[] = { - N_("git log [] [] [[--] ...]\n") - N_(" or: git show [options] ..."), + N_("git log [] [] [[--] ...]"), + N_("git show [] ..."), NULL }; @@@ -489,7 -489,7 +489,7 @@@ static int show_tag_object(const unsign } static int show_tree_object(const unsigned char *sha1, - const char *base, int baselen, + struct strbuf *base, const char *pathname, unsigned mode, int stage, void *context) { printf("%s%s\n", pathname, S_ISDIR(mode) ? "/" : ""); @@@ -705,7 -705,7 +705,7 @@@ static int git_format_config(const cha return 0; } if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff") || - !strcmp(var, "color.ui")) { + !strcmp(var, "color.ui") || !strcmp(var, "diff.submodule")) { return 0; } if (!strcmp(var, "format.numbered")) { @@@ -795,7 -795,7 +795,7 @@@ static int reopen_stdout(struct commit static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids) { struct rev_info check_rev; - struct commit *commit; + struct commit *commit, *c1, *c2; struct object *o1, *o2; unsigned flags1, flags2; @@@ -803,9 -803,11 +803,11 @@@ die(_("Need exactly one range.")); o1 = rev->pending.objects[0].item; - flags1 = o1->flags; o2 = rev->pending.objects[1].item; + flags1 = o1->flags; flags2 = o2->flags; + c1 = lookup_commit_reference(o1->sha1); + c2 = lookup_commit_reference(o2->sha1); if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING)) die(_("Not a range.")); @@@ -827,10 -829,8 +829,8 @@@ } /* reset for next revision walk */ - clear_commit_marks((struct commit *)o1, - SEEN | UNINTERESTING | SHOWN | ADDED); - clear_commit_marks((struct commit *)o2, - SEEN | UNINTERESTING | SHOWN | ADDED); + clear_commit_marks(c1, SEEN | UNINTERESTING | SHOWN | ADDED); + clear_commit_marks(c2, SEEN | UNINTERESTING | SHOWN | ADDED); o1->flags = flags1; o2->flags = flags2; } @@@ -1023,7 -1023,7 +1023,7 @@@ static const char *set_outdir(const cha } static const char * const builtin_format_patch_usage[] = { - N_("git format-patch [options] [ | ]"), + N_("git format-patch [] [ | ]"), NULL }; diff --combined t/t4014-format-patch.sh index c39e50028f,2ea12dd088..890db1174f --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@@ -57,6 -57,14 +57,14 @@@ test_expect_success "format-patch --ign ' + test_expect_success "format-patch --ignore-if-in-upstream handles tags" ' + git tag -a v1 -m tag side && + git tag -a v2 -m tag master && + git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 && + cnt=$(grep "^From " patch1 | wc -l) && + test $cnt = 2 + ' + test_expect_success "format-patch doesn't consider merge commits" ' git checkout -b slave master && @@@ -802,7 -810,7 +810,7 @@@ test_expect_success '--no-signature sup ' test_expect_success '--signature-file overrides format.signaturefile' ' - cat >other-mail-signature <<-\EOF + cat >other-mail-signature <<-\EOF && Use this other signature instead of mail-signature. EOF test_config format.signaturefile mail-signature &&