{"thread":{"id":"35028","subject":"Question about \"git log --cherry\"","startedAt":"2013-09-26T16:35:57Z","lastAt":"2013-09-27T09:52:28Z","messageCount":7,"participants":["Francis Moreau","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"228279","messageId":"CAC9WiBjLqdqSKgLv_M6FPx3a2J-+ZKAQnk9OGn3h5SfqSpiT3g@mail.gmail.com","threadId":"35028","inReplyTo":null,"subject":"Question about \"git log --cherry\"","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2013-09-26T16:35:57Z","receivedAt":"2013-09-26T16:35:57Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"Hello,\n\nI'm trying to use \"git log --cherry ...\" in order to display new, kept\nand removed commits between two branches A and B.\n\nSo commits which are only in B are considered new and should be marked\nwith '+'. Commits which are in both branches are marked with '=' but\nonly commit in branch B are shown. Eventually commits which are in A\nbut not in B anymore should be marked with '-'.\n\nSo far I found this solution:\n\n  $ git log --cherry-mark --right-only A...B\n  $ git log --cherry-pick  --left-only   A...B\n\nbut I have to call twice git-log. This can be annoying since depending\non A and B, calling git-log can take time.\n\nIs there another option that I'm missing which would do the job but\nwith only one call to git-log ?\n\nThanks\n-- \nFrancis\n"},{"id":"228288","messageId":"20130926202153.GC27238@serenity.lan","threadId":"35028","inReplyTo":"CAC9WiBjLqdqSKgLv_M6FPx3a2J-+ZKAQnk9OGn3h5SfqSpiT3g@mail.gmail.com","subject":"Re: Question about \"git log --cherry\"","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-09-26T20:21:53Z","receivedAt":"2013-09-26T20:21:53Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, Sep 26, 2013 at 06:35:57PM +0200, Francis Moreau wrote:\n> I'm trying to use \"git log --cherry ...\" in order to display new, kept\n> and removed commits between two branches A and B.\n> \n> So commits which are only in B are considered new and should be marked\n> with '+'. Commits which are in both branches are marked with '=' but\n> only commit in branch B are shown. Eventually commits which are in A\n> but not in B anymore should be marked with '-'.\n> \n> So far I found this solution:\n> \n>   $ git log --cherry-mark --right-only A...B\n>   $ git log --cherry-pick  --left-only   A...B\n> \n> but I have to call twice git-log. This can be annoying since depending\n> on A and B, calling git-log can take time.\n> \n> Is there another option that I'm missing which would do the job but\n> with only one call to git-log ?\n\nDoes this do what you want?\n\n    git log --cherry-mark --left-right A...B |\n    sed -e '/^commit / {\n        y/<>/-+/\n    }'\n"},{"id":"228299","messageId":"CAC9WiBjykt5qj2sRtTK=VHp0B5x===7oqVP7VRC6BOdCMTn9yg@mail.gmail.com","threadId":"35028","inReplyTo":"20130926202153.GC27238@serenity.lan","subject":"Re: Question about \"git log --cherry\"","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2013-09-27T05:09:03Z","receivedAt":"2013-09-27T05:09:03Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"Hi,\n\nOn Thu, Sep 26, 2013 at 10:21 PM, John Keeping <john@keeping.me.uk> wrote:\n> On Thu, Sep 26, 2013 at 06:35:57PM +0200, Francis Moreau wrote:\n>> I'm trying to use \"git log --cherry ...\" in order to display new, kept\n>> and removed commits between two branches A and B.\n>>\n>> So commits which are only in B are considered new and should be marked\n>> with '+'. Commits which are in both branches are marked with '=' but\n>> only commit in branch B are shown. Eventually commits which are in A\n>> but not in B anymore should be marked with '-'.\n>>\n>> So far I found this solution:\n>>\n>>   $ git log --cherry-mark --right-only A...B\n>>   $ git log --cherry-pick  --left-only   A...B\n>>\n>> but I have to call twice git-log. This can be annoying since depending\n>> on A and B, calling git-log can take time.\n>>\n>> Is there another option that I'm missing which would do the job but\n>> with only one call to git-log ?\n>\n> Does this do what you want?\n>\n>     git log --cherry-mark --left-right A...B |\n>     sed -e '/^commit / {\n>         y/<>/-+/\n>     }'\n\nNope because --left-right shows common commits (with '=' mark) that\nbelong to A *and* B, and I'd like to have only the ones in B.\n\nThanks\n-- \nFrancis\n"},{"id":"228300","messageId":"20130927081113.GE27238@serenity.lan","threadId":"35028","inReplyTo":"CAC9WiBjykt5qj2sRtTK=VHp0B5x===7oqVP7VRC6BOdCMTn9yg@mail.gmail.com","subject":"Re: Question about \"git log --cherry\"","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-09-27T08:11:13Z","receivedAt":"2013-09-27T08:11:13Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Fri, Sep 27, 2013 at 07:09:03AM +0200, Francis Moreau wrote:\n> Hi,\n> \n> On Thu, Sep 26, 2013 at 10:21 PM, John Keeping <john@keeping.me.uk> wrote:\n> > On Thu, Sep 26, 2013 at 06:35:57PM +0200, Francis Moreau wrote:\n> >> I'm trying to use \"git log --cherry ...\" in order to display new, kept\n> >> and removed commits between two branches A and B.\n> >>\n> >> So commits which are only in B are considered new and should be marked\n> >> with '+'. Commits which are in both branches are marked with '=' but\n> >> only commit in branch B are shown. Eventually commits which are in A\n> >> but not in B anymore should be marked with '-'.\n> >>\n> >> So far I found this solution:\n> >>\n> >>   $ git log --cherry-mark --right-only A...B\n> >>   $ git log --cherry-pick  --left-only   A...B\n> >>\n> >> but I have to call twice git-log. This can be annoying since depending\n> >> on A and B, calling git-log can take time.\n> >>\n> >> Is there another option that I'm missing which would do the job but\n> >> with only one call to git-log ?\n> >\n> > Does this do what you want?\n> >\n> >     git log --cherry-mark --left-right A...B |\n> >     sed -e '/^commit / {\n> >         y/<>/-+/\n> >     }'\n> \n> Nope because --left-right shows common commits (with '=' mark) that\n> belong to A *and* B, and I'd like to have only the ones in B.\n\nI think the only way you can address this is to post-process the result,\nI don't know any way to remove a left side commit only if it is\npatch-identical to a right side commit.\n\nIt should be relatively easy to filter out any '=' commits that are in\nthe output of \"git rev-list --left-only A...B\".\n"},{"id":"228303","messageId":"CAC9WiBgzWXhoEuD1adwD+SwFScSwH+JFBLRq=26G5k8JxFysEg@mail.gmail.com","threadId":"35028","inReplyTo":"20130927081113.GE27238@serenity.lan","subject":"Re: Question about \"git log --cherry\"","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2013-09-27T08:28:05Z","receivedAt":"2013-09-27T08:28:05Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"On Fri, Sep 27, 2013 at 10:11 AM, John Keeping <john@keeping.me.uk> wrote:\n> On Fri, Sep 27, 2013 at 07:09:03AM +0200, Francis Moreau wrote:\n>> Hi,\n>>\n>> On Thu, Sep 26, 2013 at 10:21 PM, John Keeping <john@keeping.me.uk> wrote:\n>> > On Thu, Sep 26, 2013 at 06:35:57PM +0200, Francis Moreau wrote:\n>> >> I'm trying to use \"git log --cherry ...\" in order to display new, kept\n>> >> and removed commits between two branches A and B.\n>> >>\n>> >> So commits which are only in B are considered new and should be marked\n>> >> with '+'. Commits which are in both branches are marked with '=' but\n>> >> only commit in branch B are shown. Eventually commits which are in A\n>> >> but not in B anymore should be marked with '-'.\n>> >>\n>> >> So far I found this solution:\n>> >>\n>> >>   $ git log --cherry-mark --right-only A...B\n>> >>   $ git log --cherry-pick  --left-only   A...B\n>> >>\n>> >> but I have to call twice git-log. This can be annoying since depending\n>> >> on A and B, calling git-log can take time.\n>> >>\n>> >> Is there another option that I'm missing which would do the job but\n>> >> with only one call to git-log ?\n>> >\n>> > Does this do what you want?\n>> >\n>> >     git log --cherry-mark --left-right A...B |\n>> >     sed -e '/^commit / {\n>> >         y/<>/-+/\n>> >     }'\n>>\n>> Nope because --left-right shows common commits (with '=' mark) that\n>> belong to A *and* B, and I'd like to have only the ones in B.\n>\n> I think the only way you can address this is to post-process the result,\n> I don't know any way to remove a left side commit only if it is\n> patch-identical to a right side commit.\n>\n> It should be relatively easy to filter out any '=' commits that are in\n> the output of \"git rev-list --left-only A...B\".\n\nyes that's what I'm doing but I was wondering if that's possible to do\nthat with only one run of git-log/git-rev-list.\n\nThanks\n-- \nFrancis\n"},{"id":"228307","messageId":"20130927091402.GF27238@serenity.lan","threadId":"35028","inReplyTo":"CAC9WiBgzWXhoEuD1adwD+SwFScSwH+JFBLRq=26G5k8JxFysEg@mail.gmail.com","subject":"Re: Question about \"git log --cherry\"","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-09-27T09:14:02Z","receivedAt":"2013-09-27T09:14:02Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Fri, Sep 27, 2013 at 10:28:05AM +0200, Francis Moreau wrote:\n> On Fri, Sep 27, 2013 at 10:11 AM, John Keeping <john@keeping.me.uk> wrote:\n> > On Fri, Sep 27, 2013 at 07:09:03AM +0200, Francis Moreau wrote:\n> >> Hi,\n> >>\n> >> On Thu, Sep 26, 2013 at 10:21 PM, John Keeping <john@keeping.me.uk> wrote:\n> >> > On Thu, Sep 26, 2013 at 06:35:57PM +0200, Francis Moreau wrote:\n> >> >> I'm trying to use \"git log --cherry ...\" in order to display new, kept\n> >> >> and removed commits between two branches A and B.\n> >> >>\n> >> >> So commits which are only in B are considered new and should be marked\n> >> >> with '+'. Commits which are in both branches are marked with '=' but\n> >> >> only commit in branch B are shown. Eventually commits which are in A\n> >> >> but not in B anymore should be marked with '-'.\n> >> >>\n> >> >> So far I found this solution:\n> >> >>\n> >> >>   $ git log --cherry-mark --right-only A...B\n> >> >>   $ git log --cherry-pick  --left-only   A...B\n> >> >>\n> >> >> but I have to call twice git-log. This can be annoying since depending\n> >> >> on A and B, calling git-log can take time.\n> >> >>\n> >> >> Is there another option that I'm missing which would do the job but\n> >> >> with only one call to git-log ?\n> >> >\n> >> > Does this do what you want?\n> >> >\n> >> >     git log --cherry-mark --left-right A...B |\n> >> >     sed -e '/^commit / {\n> >> >         y/<>/-+/\n> >> >     }'\n> >>\n> >> Nope because --left-right shows common commits (with '=' mark) that\n> >> belong to A *and* B, and I'd like to have only the ones in B.\n> >\n> > I think the only way you can address this is to post-process the result,\n> > I don't know any way to remove a left side commit only if it is\n> > patch-identical to a right side commit.\n> >\n> > It should be relatively easy to filter out any '=' commits that are in\n> > the output of \"git rev-list --left-only A...B\".\n> \n> yes that's what I'm doing but I was wondering if that's possible to do\n> that with only one run of git-log/git-rev-list.\n\nI don't think it is.  But you only need to use the --cherry-mark option\nwith one of the runs, so the other one should be very quick - the added\nwork of calculating patch IDs slows down \"git log\" a lot.\n"},{"id":"228308","messageId":"CAC9WiBjponU=gKZ26oG7pOhGJk5=XxxGzGm9A4Y6qbNEcUw=PQ@mail.gmail.com","threadId":"35028","inReplyTo":"20130927091402.GF27238@serenity.lan","subject":"Re: Question about \"git log --cherry\"","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2013-09-27T09:52:28Z","receivedAt":"2013-09-27T09:52:28Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"On Fri, Sep 27, 2013 at 11:14 AM, John Keeping <john@keeping.me.uk> wrote:\n> On Fri, Sep 27, 2013 at 10:28:05AM +0200, Francis Moreau wrote:\n>> On Fri, Sep 27, 2013 at 10:11 AM, John Keeping <john@keeping.me.uk> wrote:\n>> > On Fri, Sep 27, 2013 at 07:09:03AM +0200, Francis Moreau wrote:\n>> >> Hi,\n>> >>\n>> >> On Thu, Sep 26, 2013 at 10:21 PM, John Keeping <john@keeping.me.uk> wrote:\n>> >> > On Thu, Sep 26, 2013 at 06:35:57PM +0200, Francis Moreau wrote:\n>> >> >> I'm trying to use \"git log --cherry ...\" in order to display new, kept\n>> >> >> and removed commits between two branches A and B.\n>> >> >>\n>> >> >> So commits which are only in B are considered new and should be marked\n>> >> >> with '+'. Commits which are in both branches are marked with '=' but\n>> >> >> only commit in branch B are shown. Eventually commits which are in A\n>> >> >> but not in B anymore should be marked with '-'.\n>> >> >>\n>> >> >> So far I found this solution:\n>> >> >>\n>> >> >>   $ git log --cherry-mark --right-only A...B\n>> >> >>   $ git log --cherry-pick  --left-only   A...B\n>> >> >>\n>> >> >> but I have to call twice git-log. This can be annoying since depending\n>> >> >> on A and B, calling git-log can take time.\n>> >> >>\n>> >> >> Is there another option that I'm missing which would do the job but\n>> >> >> with only one call to git-log ?\n>> >> >\n>> >> > Does this do what you want?\n>> >> >\n>> >> >     git log --cherry-mark --left-right A...B |\n>> >> >     sed -e '/^commit / {\n>> >> >         y/<>/-+/\n>> >> >     }'\n>> >>\n>> >> Nope because --left-right shows common commits (with '=' mark) that\n>> >> belong to A *and* B, and I'd like to have only the ones in B.\n>> >\n>> > I think the only way you can address this is to post-process the result,\n>> > I don't know any way to remove a left side commit only if it is\n>> > patch-identical to a right side commit.\n>> >\n>> > It should be relatively easy to filter out any '=' commits that are in\n>> > the output of \"git rev-list --left-only A...B\".\n>>\n>> yes that's what I'm doing but I was wondering if that's possible to do\n>> that with only one run of git-log/git-rev-list.\n>\n> I don't think it is.  But you only need to use the --cherry-mark option\n> with one of the runs, so the other one should be very quick - the added\n> work of calculating patch IDs slows down \"git log\" a lot.\n\nThat's true, rev-list should be way faster. I think I'll do that.\n\nThanks.\n-- \nFrancis\n"}]}