{"thread":{"id":"48521","subject":"Fun puzzle: successful merge's contents depends on...commit timestamps?","startedAt":"2018-05-19T03:07:50Z","lastAt":"2018-05-19T03:07:50Z","messageCount":1,"participants":["Elijah Newren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"348030","messageId":"CABPp-BFc1OLYKzS5rauOehvEugPc0oGMJp-NMEAmVMW7QR=4Eg@mail.gmail.com","threadId":"48521","inReplyTo":null,"subject":"Fun puzzle: successful merge's contents depends on...commit timestamps?","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-05-19T03:07:45Z","receivedAt":"2018-05-19T03:07:50Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Check this out; I merge another branch successfully:\n  $ git merge -m F $othersha; echo $?\n  0\n\nThis is just a simple test repo:\n  $ git log --oneline\n  18f5e65 (HEAD -> master) F\n  7472b46 E\n  ea0d801 D\n  4486f96 C\n  7727e3b B\n  ee47c13 A\n\nBelow it is important to note that one commit was made at 1526194997,\nand this value doesn't appear anywhere else in fast-export output:\n  $ git fast-export --no-data master | grep 1526194997\n  author Elijah Newren <newren@gmail.com> 1526194997 -0700\n  committer Elijah Newren <newren@gmail.com> 1526194997 -0700\n\nLet's create a new branch and rewrite history ONLY changing that one timestamp:\n  $ git checkout -b redo\n  $ git fast-export --no-data redo | \\\n       sed -e s/1526194997/1500000000/ | \\\n       git fast-import --quiet --force\n\nAt this point, the trees for 'master' and 'redo' match, as you'd expect:\n  $ git diff --quiet master HEAD; echo $?\n  0\n\nLet's redo that merge, shall we?:\n  $ git checkout --quiet 'redo^1'\n  $ git merge -m newF 'redo^2'; echo $?\n  $ 0\n\nDid we get the same merge result?  Nope:\n  $ git diff --quiet master HEAD; echo $?\n  1\n\n\nI believe there are about half a dozen solutions to this puzzle.  Can you find\nat least one?\n"}]}