Re: [PATCH v2] log: add log.follow config option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 8, 2015, 04:12 UTC
- Message-ID
- <xmqqa8v71e4c.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1436318939.5521.32.camel@twopensource.com>
David Turner <dturner@twopensource.com> writes:
Show 6 quoted lines
>> 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.
Show 21 quoted lines
>
>> 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 no
>
> revs->diffopt.pathspec isn't set up yet then. But prune_data is, so I
> can use that.
>
> Will send a v3.