Re: [PATCH 5/7] xdiff: rename XDL_MERGE_STYLE_DIFF3
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 11, 2021, 03:17 UTC
- Message-ID
- <xmqq5yyl5buz.fsf@gitster.g>
- In-Reply-To
- <3168eb15-25a6-a3eb-a498-8effa0c79855@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> The subject would make more sense as 'xdiff: rename XDL_MERGE_DIFF3 to > XDL_MERGE_STYLE_DIFF3' rather than using the new name of the constant > alone.
True.
Show 6 quoted lines
>> If we don't specify we are talking about a style, XDL_MERGE_MINIMAL >> could be confused with a valid value instead of XDL_MERGE_DIFF3, which >> it isn't. > > I don't object to the rename but what is the source of the confusion > with XDL_MERGE_MINIMAL?
I do not see any confusion, either, but the current XDL_MERGE_DIFF3 being a boolean (i.e. if false, use the output style of the 'merge' command) and our lack of an enumeration constant for 'merge' means that a future addition of the third output style would require us to add XDL_MERGE_$STYLE for both the new style and the traditional 'merge' style. And If we would end up with XDL_MERGE_DIFF3, XDL_MERGE_MERGE and XDL_MERGE_FOO for that third output style.
The 'merge' one simply looks strange in that context. And from that point of view, this change might be a good way to futureproof the codebase.
Thanks.