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

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"
> 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!
Previous: D. Ben Knoble
Message 3 of 3 in “mergetool.vimdiff.layout behavior differs from documentation”
  1. kawarimidollMar 24, 2025
  2. D. Ben KnobleMar 24, 2025
  3. Fernando RamosMar 24, 2025

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.