Thread (3 messages) 3 messages, 3 authors, 2025-03-24

Re: mergetool.vimdiff.layout behavior differs from documentation

From: Fernando Ramos <hidden>
Date: 2025-03-24 22:52:49

On 25/03/24 04:35PM, D. Ben Knoble wrote:
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"
fi
You 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!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help