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.