Re: [PATCH v2] log: add log.follow config option
From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:42
David Turner [off-list ref] writes:
quoted
IOW, I'd like to know why we need more than something like this change to this file, instead of the above? We didn't muck with revs->diff in the original when FOLLOW_RENAMES was set, but now it does, for example.We did, but we did it earlier. But I can just rearrange the code.
Ah, I see. You don't have to move the existing code for that then. Just insert the "if prune has one element and DEFAULT_ is set" thing before the first use of FOLLOW_RENAMES (i.e. "pick, filter and follow needs diff" piece) and you are done, I think. Thanks.
quoted
diff --git a/revision.c b/revision.c index 3ff8723..f7bd229 100644 --- a/revision.c +++ b/revision.c@@ -2270,6 +2270,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s got_rev_arg = 1; } + if (DIFF_OPT_TST(&revs->diffopt, DEFAULT_FOLLOW_RENAMES) && + revs->diffopt.pathspec.nr == 1) + DIFF_OPT_SET(&revs->diffopt, FOLLOW_RENAMES); + if (prune_data.nr) { /* * If we need to introduce the magic "a lone ':' means norevs->diffopt.pathspec isn't set up yet then. But prune_data is, so I can use that. Will send a v3.