{"thread":{"id":"62831","subject":"Bug-Report: Git automerge merges in old content not present on the latest commit of both branches.","startedAt":"2025-01-20T08:16:13Z","lastAt":"2025-01-20T20:44:12Z","messageCount":2,"participants":["Postolache Andreas","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"510933","messageId":"AM0PR0702MB3555EE09E6BFD34A1F1429E1D8E72@AM0PR0702MB3555.eurprd07.prod.outlook.com","threadId":"62831","inReplyTo":null,"subject":"Bug-Report: Git automerge merges in old content not present on the latest commit of both branches.","fromName":"Postolache Andreas","fromEmail":"andreas.postolache@pierer-innovation.com","sentAt":"2025-01-20T08:16:08Z","receivedAt":"2025-01-20T08:16:13Z","isPatch":false,"sender":{"key":"andreas.postolache@pierer-innovation.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\nA:I merged our up to date main branch into my working branch.\n\nWhat did you expect to happen? (Expected behavior)\nA:Normal merge, auto-merge to work as expected.\n\nWhat happened instead? (Actual behavior)\nA:During the auto-merge it added Text from an 5 month old commit, that was the 6th newest commit and the 4th oldest.\nThis text was not present on either the up-to date main branch or my working branch.\nThis was text from my first commit on the file, which was an .md file.\n\nWhat's different between what you expected and what actually happened?\nA: I even checked the file manually on both branches before the merge and did not find this text section.\nI became aware of the issue trough a PR comment so I paid attention to it during the process of merging.\n\nAnything else you want to add:\nA: This is the only time I noticed this bug.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.34.1\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64\ncompiler info: gnuc: 11.4\nlibc info: glibc: 2.35\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\npost-checkout\npost-commit\npost-merge\npre-push\n\n\n_______________________________\nDiese Nachricht und allfällige angehängte Dokumente sind vertraulich und nur für den/die Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Adressat sein, ist jede Offenlegung, Weiterleitung oder sonstige Verwendung dieser Information nicht gestattet. In diesem Fall bitten wir, den Absender zu verständigen und die Information zu vernichten. Für Übermittlungsfehler oder sonstige Irrtümer bei Übermittlung besteht keine Haftung.\n_______________________________\nThis message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the material. The sender does not accept liability for any errors or omissions as a result of the transmission. Please consider your environmental responsibility before printing this e-mail.\n"},{"id":"510979","messageId":"e2ab3d74-2218-4a42-a2f5-019b306e185b@kdbg.org","threadId":"62831","inReplyTo":"AM0PR0702MB3555EE09E6BFD34A1F1429E1D8E72@AM0PR0702MB3555.eurprd07.prod.outlook.com","subject":"Re: Bug-Report: Git automerge merges in old content not present on the latest commit of both branches.","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-01-20T20:06:52Z","receivedAt":"2025-01-20T20:44:12Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The behavior is surprising, because I haven't seen git merge do\nsomething wrong since ages if ever.\n\nAm 20.01.25 um 09:16 schrieb Postolache Andreas:\n> A:During the auto-merge it added Text from an 5 month old commit,\n> that was the 6th newest commit and the 4th oldest. This text was not\n> present on either the up-to date main branch or my working branch. \n> This was text from my first commit on the file, which was an .md\n> file.\nWithout concrete data, it is difficult to asses where you started and\nwhat the result should be. Let's start with some `git log` output so\nthat we all know what the shape of the commit graph is. We'll have to\nwork from there or maybe you already know what is going on when you\nprepare it.\n\nShow the output of\n\ngit log --graph --oneline --decorate --boundary main...mybranch -- file.md\n\nReplace \"main\" by the branch name that you called \"the up-to-date main\nbranch\", \"mybranch\" by \"my working branch\", and \"file.md\" by the\npath(spec) of the file in question. Mind the three dots and the dash-dash.\n\n-- Hannes\n\n"}]}