git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: David TurnerNext: Junio C Hamano
Message 6 of 7 in “log: add log.follow config option”
  1. log: add log.follow config optionDavid Turner, Jul 7, 2015
  2. Matthieu MoyJul 7, 2015
  3. David TurnerJul 7, 2015
  4. Junio C HamanoJul 7, 2015
  5. David TurnerJul 8, 2015
  6. Junio C HamanoJul 8, 2015
  7. Junio C HamanoJul 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.