{"thread":{"id":"27836","subject":"Getting a list of commits between 2 points without upstream changes","startedAt":"2011-07-17T23:49:57Z","lastAt":"2011-07-18T01:28:44Z","messageCount":4,"participants":["Chris Packham","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"171527","messageId":"CAFOYHZC5hQ9JV8a5d20AaPR_eYFDViama+4148MPumvvJ-n6wQ@mail.gmail.com","threadId":"27836","inReplyTo":null,"subject":"Getting a list of commits between 2 points without upstream changes","fromName":"Chris Packham","fromEmail":"judge.packham@gmail.com","sentAt":"2011-07-17T23:49:57Z","receivedAt":"2011-07-17T23:49:57Z","isPatch":false,"sender":{"key":"judge.packham@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155667?v=4"},"body":"Hi List,\n\nI'm trying to send round an incremental changelog for my project which\ncontains just my changes without changes that have been made upstream.\nThe history look something like this.\n\n---o--o--o--o--o--o--o--o-- upstream\n    \\          \\        \\\n     \\-m--A--m--B--m--C--D-- topic\n\nWhat I want is a changelog with just B, C and D in it (i.e. no merge\ncommits and no commits already in upstream). I know if I wanted A,B,C\nand D I could just do 'git log --no-merges upstream..topic'. If I do\n'git log --no-merges B..topic' I get the merged commits from upstream.\nIn set-speak what I think want is the union of upstream..topic and\nB..topic.\n\nIs there any existing way to achieve this? I'm happy to hack something\nup using git rev-list if necessary.\n\nThanks,\nChris\n"},{"id":"171530","messageId":"20110718001749.GA706@sigill.intra.peff.net","threadId":"27836","inReplyTo":"CAFOYHZC5hQ9JV8a5d20AaPR_eYFDViama+4148MPumvvJ-n6wQ@mail.gmail.com","subject":"Re: Getting a list of commits between 2 points without upstream changes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-18T00:17:49Z","receivedAt":"2011-07-18T00:17:49Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jul 18, 2011 at 11:49:57AM +1200, Chris Packham wrote:\n\n> I'm trying to send round an incremental changelog for my project which\n> contains just my changes without changes that have been made upstream.\n> The history look something like this.\n> \n> ---o--o--o--o--o--o--o--o-- upstream\n>     \\          \\        \\\n>      \\-m--A--m--B--m--C--D-- topic\n> \n> What I want is a changelog with just B, C and D in it (i.e. no merge\n> commits and no commits already in upstream). I know if I wanted A,B,C\n> and D I could just do 'git log --no-merges upstream..topic'. If I do\n> 'git log --no-merges B..topic' I get the merged commits from upstream.\n> In set-speak what I think want is the union of upstream..topic and\n> B..topic.\n\nI'm not clear on what makes \"B\" more special than \"A\" in the graph\nabove. But assuming you know A, don't you just want:\n\n  git log --no-merges topic ^upstream ^A\n\n? That is, \"everything in topic, but not in upstream, nor in the parent\nof A\". Or if you know A and not B, you can use \"^B^!\" (which means \"do\nnot include commits that are in any parent of B\").\n\n-Peff\n"},{"id":"171531","messageId":"CAFOYHZDUyQpVc5m4w9jcDsmed+UR8a_zxzR0mBAjPf7_A80MQg@mail.gmail.com","threadId":"27836","inReplyTo":"20110718001749.GA706@sigill.intra.peff.net","subject":"Re: Getting a list of commits between 2 points without upstream changes","fromName":"Chris Packham","fromEmail":"judge.packham@gmail.com","sentAt":"2011-07-18T00:33:27Z","receivedAt":"2011-07-18T00:33:27Z","isPatch":false,"sender":{"key":"judge.packham@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155667?v=4"},"body":"On Mon, Jul 18, 2011 at 12:17 PM, Jeff King <peff@peff.net> wrote:\n> On Mon, Jul 18, 2011 at 11:49:57AM +1200, Chris Packham wrote:\n>\n>> I'm trying to send round an incremental changelog for my project which\n>> contains just my changes without changes that have been made upstream.\n>> The history look something like this.\n>>\n>> ---o--o--o--o--o--o--o--o-- upstream\n>>     \\          \\        \\\n>>      \\-m--A--m--B--m--C--D-- topic\n>>\n>> What I want is a changelog with just B, C and D in it (i.e. no merge\n>> commits and no commits already in upstream). I know if I wanted A,B,C\n>> and D I could just do 'git log --no-merges upstream..topic'. If I do\n>> 'git log --no-merges B..topic' I get the merged commits from upstream.\n>> In set-speak what I think want is the union of upstream..topic and\n>> B..topic.\n>\n> I'm not clear on what makes \"B\" more special than \"A\" in the graph\n> above. But assuming you know A, don't you just want:\n\nWhat makes A special in this case is that commits up to and including\nA have been reviewed, regression tested etc. My use-case is really\nabout telling people what has been worked on since the last time the\ncode was reviewed.\n\n>\n>  git log --no-merges topic ^upstream ^A\n>\n> ? That is, \"everything in topic, but not in upstream, nor in the parent\n> of A\". Or if you know A and not B, you can use \"^B^!\" (which means \"do\n> not include commits that are in any parent of B\").\n\nBrilliant, that's exactly what I wanted. Thanks.\n\n>\n> -Peff\n>\n"},{"id":"171532","messageId":"20110718012844.GA2112@sigill.intra.peff.net","threadId":"27836","inReplyTo":"CAFOYHZDUyQpVc5m4w9jcDsmed+UR8a_zxzR0mBAjPf7_A80MQg@mail.gmail.com","subject":"Re: Getting a list of commits between 2 points without upstream changes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-18T01:28:44Z","receivedAt":"2011-07-18T01:28:44Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jul 18, 2011 at 12:33:27PM +1200, Chris Packham wrote:\n\n> > I'm not clear on what makes \"B\" more special than \"A\" in the graph\n> > above. But assuming you know A, don't you just want:\n> \n> What makes A special in this case is that commits up to and including\n> A have been reviewed, regression tested etc. My use-case is really\n> about telling people what has been worked on since the last time the\n> code was reviewed.\n\nOK, that makes sense.\n\n> >  git log --no-merges topic ^upstream ^A\n> >\n> > ? That is, \"everything in topic, but not in upstream, nor in the parent\n> > of A\". Or if you know A and not B, you can use \"^B^!\" (which means \"do\n> > not include commits that are in any parent of B\").\n> \n> Brilliant, that's exactly what I wanted. Thanks.\n\nOops, I mis-stated it above. It would be \"everything in topic, but not\nin upstream, nor in A\". Which I think is what you actually want (I had\noriginally written it as \"^B^!\", but forgot to change the text when I\nswitched it to the more-readable \"^A\").\n\n-Peff\n"}]}