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

git merge a b when a == b but neither == o is always a successful merge?

From
DHDaniel Hagerty <hag@linnaean.org>
Date
Nov 17, 2014, 18:39 UTC
Message-ID
<21610.16623.746985.383838@perdition.linnaean.org>
    Given a repository setup thusly:

$ git --version git version 2.2.0.rc2

git init .
echo '0.0' > version
git add version
git commit -m "master"
for i in a b ; do
  git checkout -b $i master
  echo '0.1' > version
  git commit -a -m "leg $i"
done

git checkout -b c master echo '0.2' > version git commit -a -m "leg c"

git checkout --detach a
"git merge c" produces the expected edit conflict.

"git merge b" produces a successful merge, as both branches perform the "same" work.

For the body of content in question, this is a merge conflict. Git seems to have the hard-coded assumption otherwise. I had to change three source files to get the result I expected, and wasn't seeing any indications of parameterization.

Am I missing some means of getting the results I need?  Thanks!
Next: Jeff King
Message 1 of 6 in “git merge a b when a == b but neither == o is always a successful merge?”
  1. Daniel HagertyNov 17, 2014
  2. Jeff KingNov 17, 2014
  3. Daniel HagertyNov 17, 2014
  4. Jeff KingNov 21, 2014
  5. Junio C HamanoNov 21, 2014
  6. Daniel HagertyNov 24, 2014

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.