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

Re: Possible merge bug

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Nov 11, 2021, 14:28 UTC
Message-ID
<da873a08-c73a-cc30-6b7d-dd5cd3bacb22@gmail.com>
In-Reply-To
<5aa1fb67-6bd8-6de3-8271-369722b6ebef@gmail.com>
Hi Michael,
Le 2021-11-11 à 06:20, Saksham Mittal a écrit :
> Hello there,
> 
> I wrote a small script as well that automates testing this use case as well, but I don't really know what the policy is on attachments in git, seeing as how it's my first time contributing to git.

I used the script from Saksham (slightly modified to not depend on any Git configuration) and could not reproduce either with Git built from the same commit as you. Maybe some setting in your ~/.gitconfig is at play ?

For the record, my edited version of the reproducer:

--- 8< --- #!/bin/sh

export PATH="/path/to/built/git/bin-wrappers:$PATH" export GIT_AUTHOR_NAME=J export GIT_AUTHOR_EMAIL=j@l.com export GIT_COMMITTER_NAME=J export GIT_COMMITTER_EMAIL=j@l.com export HOME=

git --version --build-options

rm -rf sample mkdir sample cd sample git init echo -e "a\nb\nc\n" > test git add . git commit -m "abc"

git branch b1 git switch b1

echo -e "b\na\nc" > test git add . git commit -m "bac"

git switch master git branch b2 git switch b2

echo -e "b\nc\na" > test git add . git commit -m "bca"

git switch master echo "----- Merging b1 -----" git merge b1 cat test echo "----- Merging b2 -----" git merge b2 echo "----- Content of test -----" cat test --- 8< ---

Running it ends with this output:
----- Merging b1 -----
Updating 5e00de3..02910cf
Fast-forward
  test | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
b
a
c
----- Merging b2 -----
Auto-merging test
CONFLICT (content): Merge conflict in test
Automatic merge failed; fix conflicts and then commit the result.
----- Content of test -----
b
a
c
<<<<<<< HEAD
=======
a
>>>>>>> b2

Cheers, Philippe.

Previous: Saksham MittalNext: Michael Schiff
Message 3 of 5 in “Possible merge bug”
  1. Michael SchiffNov 2, 2021
  2. Saksham MittalNov 11, 2021
  3. Philippe BlainNov 11, 2021
  4. Michael SchiffNov 13, 2021
  5. Johannes SixtNov 13, 2021

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.