{"thread":{"id":"58794","subject":"[Bug report] git log shows a wrong history","startedAt":"2022-11-12T04:26:55Z","lastAt":"2022-11-12T08:31:23Z","messageCount":3,"participants":["Adam Lee","SZEDER Gábor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"467188","messageId":"CABAGCCq-bFYX+9kU-GGWBstjMjOcO1nSQdi6Udugtkd2McO3Tg@mail.gmail.com","threadId":"58794","inReplyTo":null,"subject":"[Bug report] git log shows a wrong history","fromName":"Adam Lee","fromEmail":"adam8157@gmail.com","sentAt":"2022-11-12T04:23:58Z","receivedAt":"2022-11-12T04:26:55Z","isPatch":false,"sender":{"key":"adam8157@gmail.com","avatar":null},"body":"What did you do before the bug happened? (Steps to reproduce your issue)\n\n```\ngit clone https://github.com/greenplum-db/gpdb-postgres-merge.git\ngit_log_reproducer\n\ncd git_log_reproducer/\n\ngit co -b iteration_REL_12_12 origin/iteration_REL_12_12\n\ngit log\n```\n\nWhat did you expect to happen? (Expected behavior)\n\nA part of the history is:\n```\n...\ncommit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f\ncommit fe0a9ddbdd7eee572f7321f9680280044fd5f258\n...\n```\n\nWhat happened instead? (Actual behavior)\n\nThat part of the history is:\n```\n...\ncommit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f\ncommit f9c655d647427b45ae0d7bd9baf3551a013b8ea1\ncommit fe0a9ddbdd7eee572f7321f9680280044fd5f258\n...\n```\n\nWhat's different between what you expected and what actually happened?\n\ncommit f9c655d647427b45ae0d7bd9baf3551a013b8ea1 is at the wrong place.\n\n`git log --graph` is fine.\n\nAnything else you want to add:\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.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC\n2022 x86_64\ncompiler info: gnuc: 11.2\nlibc info: glibc: 2.35\n$SHELL (typically, interactive shell): /bin/bash\n\n[Enabled Hooks]\n\n-- \nAdam\n"},{"id":"467189","messageId":"20221112071313.GE1159673@szeder.dev","threadId":"58794","inReplyTo":"CABAGCCq-bFYX+9kU-GGWBstjMjOcO1nSQdi6Udugtkd2McO3Tg@mail.gmail.com","subject":"Re: [Bug report] git log shows a wrong history","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2022-11-12T07:13:13Z","receivedAt":"2022-11-12T07:13:35Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sat, Nov 12, 2022 at 12:23:58PM +0800, Adam Lee wrote:\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> \n> ```\n> git clone https://github.com/greenplum-db/gpdb-postgres-merge.git\n> git_log_reproducer\n> \n> cd git_log_reproducer/\n> \n> git co -b iteration_REL_12_12 origin/iteration_REL_12_12\n> \n> git log\n> ```\n> \n> What did you expect to happen? (Expected behavior)\n> \n> A part of the history is:\n> ```\n> ...\n> commit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f\n> commit fe0a9ddbdd7eee572f7321f9680280044fd5f258\n> ...\n> ```\n> \n> What happened instead? (Actual behavior)\n> \n> That part of the history is:\n> ```\n> ...\n> commit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f\n> commit f9c655d647427b45ae0d7bd9baf3551a013b8ea1\n> commit fe0a9ddbdd7eee572f7321f9680280044fd5f258\n> ...\n> ```\n> \n> What's different between what you expected and what actually happened?\n> \n> commit f9c655d647427b45ae0d7bd9baf3551a013b8ea1 is at the wrong place.\n\n'git log' shows the commis in reverse chronological order by default,\nwhich means that if development happens on multiple parallel running\nbranches, then commits made on different branches might be shown\nintermixed.\n\nAnd indeed the commit timestamp of f9c655 is between that of the other\ntwo:\n\n  $ git log --format='%H %ct' |grep -A2 ^9ac9a7\n  9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286\n  f9c655d647427b45ae0d7bd9baf3551a013b8ea1 1657195677\n  fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514\n\n(Using the seconds since epoch timestamp format here, because those\nthree commits were made in different time zones, making their ordering\nby simply looking at them not quite that straightforward.)\n\nShowing commits in topographical order \"avoids showing commits on\nmultiple lines of history intermixed\" (quoting the manpage), although\nat the cost of slightly more processing time:\n\n  $ git log --format='%H %ct' --topo-order |grep -A2 ^9ac9a7\n  9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286\n  fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514\n  5a9a4091ad1a187cec9d7da0faafac15b088fe60 1657172979\n\n> `git log --graph` is fine.\n\n'--graph' implies '--topo-order' by default.\n\n"},{"id":"467190","messageId":"CABAGCCpdKesUaNiJmH4w8OqTWbXiPNJ2tRM-XwPs6ndUpzEXbg@mail.gmail.com","threadId":"58794","inReplyTo":"20221112071313.GE1159673@szeder.dev","subject":"Re: [Bug report] git log shows a wrong history","fromName":"Adam Lee","fromEmail":"adam8157@gmail.com","sentAt":"2022-11-12T08:28:26Z","receivedAt":"2022-11-12T08:31:23Z","isPatch":false,"sender":{"key":"adam8157@gmail.com","avatar":null},"body":"On Sat, Nov 12, 2022 at 3:13 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> 'git log' shows the commis in reverse chronological order by default,\n> which means that if development happens on multiple parallel running\n> branches, then commits made on different branches might be shown\n> intermixed.\n>\n> And indeed the commit timestamp of f9c655 is between that of the other\n> two:\n>\n>   $ git log --format='%H %ct' |grep -A2 ^9ac9a7\n>   9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286\n>   f9c655d647427b45ae0d7bd9baf3551a013b8ea1 1657195677\n>   fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514\n>\n> (Using the seconds since epoch timestamp format here, because those\n> three commits were made in different time zones, making their ordering\n> by simply looking at them not quite that straightforward.)\n>\n> Showing commits in topographical order \"avoids showing commits on\n> multiple lines of history intermixed\" (quoting the manpage), although\n> at the cost of slightly more processing time:\n>\n>   $ git log --format='%H %ct' --topo-order |grep -A2 ^9ac9a7\n>   9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286\n>   fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514\n>   5a9a4091ad1a187cec9d7da0faafac15b088fe60 1657172979\n>\n> > `git log --graph` is fine.\n>\n> '--graph' implies '--topo-order' by default.\n>\n\nAh, I see, thanks.\n\nI didn't expect that default behavior, looks so strange to me...\n\n-- \nAdam\n"}]}