Re: mergetool.vimdiff.layout behavior differs from documentation
- From
Fernando Ramos <greenfoo@u92.eu>
- Date
- Mar 24, 2025, 22:51 UTC
- Message-ID
- <Z-HiDODocZftrtgL@x395.localdomain>
- In-Reply-To
- <CALnO6CD=ghMyWm6s8u3=iH4neRMWnTTAQWUAokcgM1HOBqNC6A@mail.gmail.com>
On 25/03/24 04:35PM, D. Ben Knoble wrote:
Show 17 quoted lines
> I've CC'd the author of most of that mergetool for some help, but the
> issue is likely here (lines 298–310 of the script mergetools/vimdiff
> on 683c54c999 (Git 2.49, 2025-03-14)):
>
> # Search for a "@" in one of the files identifiers ("LOCAL", "BASE",
> # "REMOTE", "MERGED"). If not found, use "MERGE" as the default file
> # where changes will be saved.
>
> if echo "$LAYOUT" | grep @LOCAL >/dev/null
> then
> FINAL_TARGET="LOCAL"
> elif echo "$LAYOUT" | grep @BASE >/dev/null
> then
> FINAL_TARGET="BASE"
> else
> FINAL_TARGET="MERGED"
> fiYou are completely right. This is a bug which can probably be fixed by simply adding one extra "elif":
if echo "$LAYOUT" | grep @LOCAL >/dev/null
then
FINAL_TARGET="LOCAL"
elif echo "$LAYOUT" | grep @BASE >/dev/null
then
FINAL_TARGET="BASE"
+elif echo "$LAYOUT" | grep @REMOTE >/dev/null
+then
+FINAL_TARGET="REMOTE"
else
FINAL_TARGET="MERGED"
fi
If you can test it and prepare a patch, that would be great. Otherwise I will
try to do it myself in a few days.Thanks!