{"thread":{"id":"39148","subject":"Odd rev-list behaviour","startedAt":"2015-04-23T23:48:43Z","lastAt":"2015-04-24T01:52:34Z","messageCount":2,"participants":["B M Corser","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"259920","messageId":"CAPR6cbD5uFoCDg73wqSQEPOuUEjsy6963QQsePwofxVTuBW8Ew@mail.gmail.com","threadId":"39148","inReplyTo":null,"subject":"Odd rev-list behaviour","fromName":"B M Corser","fromEmail":"bmcorser@gmail.com","sentAt":"2015-04-23T23:48:43Z","receivedAt":"2015-04-23T23:48:43Z","isPatch":false,"sender":{"key":"bmcorser@gmail.com","avatar":null},"body":"Seeing some weird results out of rev-list, see my demo repo:\nhttps://github.com/bmcorser/rev-list-fail\n\nI was after a one-liner to sort a bunch of commit hashes into\ntopological (or date) order. The commits were made by a script that\nforges the commit time with --date in the hope of seeing stable\nresults.\n\nAny ideas welcome,\n\nBen\n"},{"id":"259926","messageId":"20150424015234.GA2001@peff.net","threadId":"39148","inReplyTo":"CAPR6cbD5uFoCDg73wqSQEPOuUEjsy6963QQsePwofxVTuBW8Ew@mail.gmail.com","subject":"Re: Odd rev-list behaviour","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-04-24T01:52:34Z","receivedAt":"2015-04-24T01:52:34Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 24, 2015 at 12:48:43AM +0100, B M Corser wrote:\n\n> Seeing some weird results out of rev-list, see my demo repo:\n> https://github.com/bmcorser/rev-list-fail\n\nThat repo has a whole bunch of commits with identical committer\ntimestamps. The default order that git displays those in is going to\ndepend on the order you provide them in.\n\n> I was after a one-liner to sort a bunch of commit hashes into\n> topological (or date) order. The commits were made by a script that\n> forges the commit time with --date in the hope of seeing stable\n> results.\n\nUsing \"--date\" will just set the author date. You probably want to set\nGIT_COMMITTER_DATE in the environment if you are scripting imported\ncommits from somewhere else (or better yet, consider using\ngit-fast-import if you have a lot of commits).\n\nEven with identical commit timestamps, we should be able to show the\ncommits in topo-order. Your README.md shows you trying:\n\n  git rev-list --no-walk $(git log --format=%H | shuf)\n\nThat is missing any mention of --topo-order, of course. But even adding\nthat in, it does not seem to work, which is perhaps what you are getting\nat. I am not sure whether \"--no-walk\" plays well with other sorting\noptions, and that may be the problem.\n\nIs there a reason that just:\n\n  git rev-list --topo-order HEAD\n\ndoes not serve your purpose? It's hard to tell what you're trying to\nachieve from this obviously toy repository.\n\nIn the meantime, you can also pipe the output of \"rev-list\" into your\nown sort routine, using --format to get whatever information you need\n(you can topo-sort with the information from --parents).\n\n-Peff\n"}]}