{"thread":{"id":"29495","subject":"logging disjoint sets of commits in a single command","startedAt":"2012-02-01T00:15:46Z","lastAt":"2012-02-01T22:01:52Z","messageCount":8,"participants":["Bryan O'Sullivan","Carlos Martín Nieto","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"183444","messageId":"CB4DC432.72D%bryano@fb.com","threadId":"29495","inReplyTo":null,"subject":"logging disjoint sets of commits in a single command","fromName":"Bryan O'Sullivan","fromEmail":"bryano@fb.com","sentAt":"2012-02-01T00:15:46Z","receivedAt":"2012-02-01T00:15:46Z","isPatch":false,"sender":{"key":"bryano@fb.com","avatar":null},"body":"I'm trying to use \"git log\" to display only a handful of commits, where\nthe commits are not necessarily linearly related to each other.\n"},{"id":"183445","messageId":"CB4DC442.72F%bryano@fb.com","threadId":"29495","inReplyTo":"CB4DC432.72D%bryano@fb.com","subject":"Re: logging disjoint sets of commits in a single command","fromName":"Bryan O'Sullivan","fromEmail":"bryano@fb.com","sentAt":"2012-02-01T00:27:06Z","receivedAt":"2012-02-01T00:27:06Z","isPatch":false,"sender":{"key":"bryano@fb.com","avatar":null},"body":"On 2012-01-31 16:15 , \"Bryan O'Sullivan\" <bryano@fb.com> wrote:\n\n>I'm trying to use \"git log\" to display only a handful of commits, where\n>the commits are not necessarily linearly related to each other.\n\nAnd I beautifully fat-fingered the \"send\" key. Oops.\n\nWhat I was *going* to say was that it looks like revision.c:limit_list is\n(whether intentionally or not) getting in the way of this.\n\nHere's a sample command line against a kernel tree:\n\ngit log 373af0c^..373af0c 590dfe2^..590dfe2\n\nI want git to log those two specific commits, but in fact it looks like\nlimit_list is marking 590dfe2 as UNINTERESTING while processing 373af0c,\nand so it gets pruned.\n\nIs there some way around this, or would a patch to fix it be acceptable?\n"},{"id":"183447","messageId":"1328056769.31804.217.camel@centaur.lab.cmartin.tk","threadId":"29495","inReplyTo":"CB4DC442.72F%bryano@fb.com","subject":"Re: logging disjoint sets of commits in a single command","fromName":"Carlos Martín Nieto","fromEmail":"carlos@cmartin.tk","sentAt":"2012-02-01T00:39:29Z","receivedAt":"2012-02-01T00:39:29Z","isPatch":false,"sender":{"key":"carlos@cmartin.tk","avatar":"https://gravatar.com/avatar/956bfe8371004f2960febf266a6af789f60cdc01fbae48bb151ad4c9b532c3a2?d=mp&s=160"},"body":"On Wed, 2012-02-01 at 00:27 +0000, Bryan O'Sullivan wrote:\n> On 2012-01-31 16:15 , \"Bryan O'Sullivan\" <bryano@fb.com> wrote:\n> \n> >I'm trying to use \"git log\" to display only a handful of commits, where\n> >the commits are not necessarily linearly related to each other.\n> \n> And I beautifully fat-fingered the \"send\" key. Oops.\n> \n> What I was *going* to say was that it looks like revision.c:limit_list is\n> (whether intentionally or not) getting in the way of this.\n> \n> Here's a sample command line against a kernel tree:\n> \n> git log 373af0c^..373af0c 590dfe2^..590dfe2\n> \n> I want git to log those two specific commits, but in fact it looks like\n> limit_list is marking 590dfe2 as UNINTERESTING while processing 373af0c,\n> and so it gets pruned.\n> \n> Is there some way around this, or would a patch to fix it be acceptable?\n\nFrom my reading of the manpage (and the way most git commands work) log\naccepts one range of commits. They all get bunched up together.\n\nYou might find cat-file's --batch mode interesting.\n\n    git rev-list 373af0c^..373af0c | git cat-file --batch\n    git rev-list 590dfe2^..590dfe2 | git cat-file --batch\n\nlooks a lot like what you're looking for.\n\n   cmn\n\n"},{"id":"183448","messageId":"7vobtj5qf9.fsf@alter.siamese.dyndns.org","threadId":"29495","inReplyTo":"CB4DC442.72F%bryano@fb.com","subject":"Re: logging disjoint sets of commits in a single command","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-01T00:48:58Z","receivedAt":"2012-02-01T00:48:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Bryan O'Sullivan\" <bryano@fb.com> writes:\n\n> Here's a sample command line against a kernel tree:\n>\n> git log 373af0c^..373af0c 590dfe2^..590dfe2\n\nThis command line is _defined_ to be the same as this.\n\n\tgit log ^373af0c^ 373af0c ^590dfe2^ 590dfe2\n\nHence,\n\n> Is there some way around this, or would a patch to fix it be acceptable?\n\nthe answer to the second question is \"no, that is not a fix but is a\nbreakage for the *current* Git users\".\n\nThe answer to the first question is that you may be able to do something\nlike this:\n\n        (\n            git rev-list 373af0c^..373af0c\n            git rev-list 590dfe2^..590dfe2\n        ) |\n        sort -u |\n        xargs git show\n\nHaving said all that, for users of Git 2.0, giving richer meaning to the\nexplicit range notation to make your original command line work just like\nthe above scripted way would be more intuitive.  While an unconditional\nchange to break the current users would totally be unacceptable, we would\nwant to see somebody come up with a clean migration path toward that goal\nwithout hurting existing users in the longer term.\n"},{"id":"183449","messageId":"20120201005332.GC30969@sigill.intra.peff.net","threadId":"29495","inReplyTo":"1328056769.31804.217.camel@centaur.lab.cmartin.tk","subject":"Re: logging disjoint sets of commits in a single command","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-01T00:53:33Z","receivedAt":"2012-02-01T00:53:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 01, 2012 at 01:39:29AM +0100, Carlos Martín Nieto wrote:\n\n> > Here's a sample command line against a kernel tree:\n> > \n> > git log 373af0c^..373af0c 590dfe2^..590dfe2\n> > \n> > I want git to log those two specific commits, but in fact it looks like\n> > limit_list is marking 590dfe2 as UNINTERESTING while processing 373af0c,\n> > and so it gets pruned.\n> > \n> > Is there some way around this, or would a patch to fix it be acceptable?\n> \n> From my reading of the manpage (and the way most git commands work) log\n> accepts one range of commits. They all get bunched up together.\n\nRight. That command is equivalent to:\n\n  373af0c 590dfe2 --not 373af0c^ 590dfe2^\n\nSo the limiting for one range you're interested in ends up marking part\nof the other as uninteresting, and that's by design. This topic came up\nrecently, and I think the general consensus is that it would be cool to\nbe able to do totally independent ranges, but that would be backwards\nincompatible with the current behavior.\n\nIn the general case, you can emulate this with:\n\n  { git log 373af0c^..373af0c\n    git log 590dfe2^..590dfe2\n  } | $PAGER\n\nwhich is of course slightly more annoying to type. If you're just\ninterested in _single_ commits, though, you can just give the commits\nand turn off walking:\n\n  git log --no-walk 373af0c 590dfe2\n\n> You might find cat-file's --batch mode interesting.\n> \n>     git rev-list 373af0c^..373af0c | git cat-file --batch\n>     git rev-list 590dfe2^..590dfe2 | git cat-file --batch\n> \n> looks a lot like what you're looking for.\n\nI think you could even drop the rev-lists in this case, since he just\nwants a single commit. However, cat-file lacks the niceties of \"log\",\nlike fancy --pretty formatting and automatic diffing against parents.\n\n-Peff\n"},{"id":"183450","messageId":"CB4DCD5C.747%bryano@fb.com","threadId":"29495","inReplyTo":"20120201005332.GC30969@sigill.intra.peff.net","subject":"Re: logging disjoint sets of commits in a single command","fromName":"Bryan O'Sullivan","fromEmail":"bryano@fb.com","sentAt":"2012-02-01T01:02:57Z","receivedAt":"2012-02-01T01:02:57Z","isPatch":false,"sender":{"key":"bryano@fb.com","avatar":null},"body":"On 2012-01-31, \"Jeff King\" <peff@peff.net> wrote:\n\n>This topic came up\n>recently, and I think the general consensus is that it would be cool to\n>be able to do totally independent ranges, but that would be backwards\n>incompatible with the current behavior.\n\nThat's totally sensible. I hadn't been able to tell from inspection\nwhether the behaviour was deliberate or not.\n\n>which is of course slightly more annoying to type. If you're just\n>interested in _single_ commits, though, you can just give the commits\n>and turn off walking:\n>\n>  git log --no-walk 373af0c 590dfe2\n\nOh, nice! I hadn't seen that option.\n\nBy the way, the reason I'm even interested in this in the first place is\nthat the performance of commands like \"git blame\" and \"git log\" on files\nand subtrees has become a problem for us (> 10 seconds per invocation,\nforecast to get much worse), and I wanted to see whether I could feed \"git\nlog\" a specific list of revisions, and if so, whether that could yield\ngood performance.\n\nI have it in mind to build a secondary index (maintained externally) so\nthat I can supply these git commands with precise lists of revisions for\nmuch faster response times.\n\nThanks, guys!\n"},{"id":"183456","messageId":"20120201030300.GA9969@sigill.intra.peff.net","threadId":"29495","inReplyTo":"CB4DCD5C.747%bryano@fb.com","subject":"Re: logging disjoint sets of commits in a single command","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-01T03:03:01Z","receivedAt":"2012-02-01T03:03:01Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 01, 2012 at 01:02:57AM +0000, Bryan O'Sullivan wrote:\n\n> By the way, the reason I'm even interested in this in the first place is\n> that the performance of commands like \"git blame\" and \"git log\" on files\n> and subtrees has become a problem for us (> 10 seconds per invocation,\n> forecast to get much worse), and I wanted to see whether I could feed \"git\n> log\" a specific list of revisions, and if so, whether that could yield\n> good performance.\n\nThat sounds kind of slow. Is your repository really gigantic? Have you packed\neverything? I'm just curious if there's some other way to make things\nfaster. Is the repository publicly available?\n\n-Peff\n"},{"id":"183503","messageId":"CB4EF5E8.7A0%bryano@fb.com","threadId":"29495","inReplyTo":"20120201030300.GA9969@sigill.intra.peff.net","subject":"Re: logging disjoint sets of commits in a single command","fromName":"Bryan O'Sullivan","fromEmail":"bryano@fb.com","sentAt":"2012-02-01T22:01:52Z","receivedAt":"2012-02-01T22:01:52Z","isPatch":false,"sender":{"key":"bryano@fb.com","avatar":null},"body":"On 2012-01-31 19:03 , \"Jeff King\" <peff@peff.net> wrote:\n>\n>That sounds kind of slow. Is your repository really gigantic?\n\nBigger than a kernel tree, but not as many commits. Beyond that, can't say.\n\n> Have you packed\n>everything?\n\nYep.\n\n> I'm just curious if there's some other way to make things\n>faster.\n\nIt would be nice if there was, but the fundamental problem is the lack of\nan index from filename to commit. Walking every commit is the limiting\nfactor, I believe.\n\n> Is the repository publicly available?\n\nNo, sorry.\n"}]}