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

Logical bug during MERGE or REBASE

From
Sskottkuk@wp.pl <skottkuk@wp.pl>
Date
Jul 2, 2021, 16:25 UTC
Message-ID
<1932019063.20210702192555@wp.pl>
Hello.
I got a strange result in the process of "merge" and/or "rebase".

I'm not a git professional, so maybe this is not a bug, but a feature. But as for me, it would be logical to consider the construction inside {} as something whole, and not just put all the changes into one heap with notification what all OK, no conflicts.

All the details are inside the git-bugreport-2021-07-02-1737.txt. I hope this log will be useful. Feel free to write me for extra details.

Best regards, Skott

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
I did:
$git init
$git add Program.cs
Inside:
{
 Console.Writeline("1");
 Console.Readline();
}
$git commit -m "Init commit"
$git checkout -b dev
Did this changes in Program.cs:
{
 Console.Writeline("1");
 Console.Readline();
 Console.Readline();
 Console.Readline();
}
$git commit -a -m "dev commit"
$git checkout master
Did this changes in Program.cs:
{
 Console.Writeline("1");
 Console.Writeline("2");
 Console.Readline();
 Console.Readline();
}
$git commit -a -m "master commit"
And I get a logical bug inside Program.cs when I want merge or rebase:
1)git merge dev
OR
2)git rebase dev
 
What did you expect to happen? (Expected behavior)
I expected conflict in my Program.cs like:
{
 Console.Writeline("1");
<<<<<<< HEAD
 Console.Writeline("2");
=======
 Console.Readline();
>>>>>>> dev
 Console.Readline();
 Console.Readline();
}
What happened instead? (Actual behavior)
Just sum of 2 commits without any conflicts:
{
 Console.Writeline("1");
 Console.Writeline("2");
 Console.Readline();
 Console.Readline();
 Console.Readline();
 Console.Readline();
}

What's different between what you expected and what actually happened? Extra lines was added in "silent" mode without any notification.

Anything else you want to add: Now necessary to revice all lines, even if there are no any conflicts :(

[System Info] git version: git version 2.32.0.windows.1 cpu: x86_64 built from commit: 4c204998d0e156d13d81abe1d1963051b1418fc0 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 6.1 7601 compiler info: gnuc: 10.3 libc info: no libc information available $SHELL (typically, interactive shell): <unset>

[Enabled Hooks]
Next: Atharva Raykar
Message 1 of 6 in “Logical bug during MERGE or REBASE”
  1. skottkuk@wp.plJul 2, 2021
  2. Atharva RaykarJul 3, 2021
  3. Bagas SanjayaJul 4, 2021
  4. Atharva RaykarJul 4, 2021
  5. Ævar Arnfjörð BjarmasonJul 3, 2021
  6. martinJul 3, 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.