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

Fwd: $LOCAL and $REMOTE swapped for rebase mergetool

From
Noam Raphael <noamraph@gmail.com>
Date
Feb 6, 2022, 19:38 UTC
Message-ID
<CAO8o=D4yuKheOO1UL7o0u89i=yp3c4KjhLjKPGBptE3-NXObEg@mail.gmail.com>
In-Reply-To
<CAO8o=D7LKUp_Bf54hbVNumhpNKnDO3UKgyOMU_0d0Er87a2zJQ@mail.gmail.com>
Hi,

When using `git mergetool` with `git merge`, the variables $BASE, $REMOTE, $LOCAL and $MERGED behave as I would expect.

However, when using `git rebase` instead of `git merge`, $LOCAL and $REMOTE are swapped - instead of $LOCAL being the local content before the commit and $REMOTE being the content being rebased, it's the other way round. This doesn't seem consistent with the git-mergetool man page.

This causes 3-way diff tools to swap the meaning of what's on the left pane and what's on the right pane. I had to work around this with the new 4-way diff tool that I wrote (https://github.com/noamraph/meld, check it out!) since it assumes the diff between BASE and REMOTE should be applied to LOCAL, and this doesn't hold.

I think that at least the documentation should be updated. Or perhaps the behavior should change - this actually seems to me like a bug.

Cheers, Noam

Message 1 of 1 in “Fwd: $LOCAL and $REMOTE swapped for rebase mergetool”
  1. Noam RaphaelFeb 6, 2022

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.