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

Re: [PATCH 3/3] diff: Introduce --diff-algorithm command line option

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2013, 19:12 UTC
Message-ID
<7vtxqja8a5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vsj63bo4n.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 23 quoted lines
> Michal Privoznik <mprivozn@redhat.com> writes:
> ...
>> diff --git a/merge-recursive.c b/merge-recursive.c
>> index d882060..53d8feb 100644
>> --- a/merge-recursive.c
>> +++ b/merge-recursive.c
>> @@ -2068,6 +2068,12 @@ int parse_merge_opt(struct merge_options *o, const char *s)
>>  		o->xdl_opts = DIFF_WITH_ALG(o, PATIENCE_DIFF);
>>  	else if (!strcmp(s, "histogram"))
>>  		o->xdl_opts = DIFF_WITH_ALG(o, HISTOGRAM_DIFF);
>> +	else if (!strcmp(s, "diff-algorithm=")) {
>> +		long value = parse_algorithm_value(s+15);
>> +		if (value < 0)
>> +			return -1;
>> +		o->xdl_opts |= value;
>
> Isn't this new hunk wrong?  DIFF_WITH_ALG() removes the previously
> chosen algorithm choice before OR'ing the new one in, so that
>
> 	diff --histogram --patience
>
> would not end up with a value PATIENCE|HISTOGRAM OR'ed together in
> the algo field.

I misspoke; this is not "diff", but "merge-recursive". The issue may be the same here, though.

Previous: Junio C Hamano
Message 7 of 7 in “Rework git-diff algorithm selection”
  1. 0/3 Rework git-diff algorithm selectionMichal Privoznik, Jan 12, 2013
  2. 1/3 git-completion.bash: Autocomplete --minimal and --histogram for git-diffMichal Privoznik, Jan 12, 2013
  3. 2/3 config: Introduce diff.algorithm variableMichal Privoznik, Jan 12, 2013
  4. Junio C HamanoJan 14, 2013
  5. 3/3 diff: Introduce --diff-algorithm command line optionMichal Privoznik, Jan 12, 2013
  6. Junio C HamanoJan 14, 2013
  7. Junio C HamanoJan 14, 2013

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.