{"thread":{"id":"42941","subject":"Find a topic branch containing a commit","startedAt":"2016-07-27T17:43:09Z","lastAt":"2016-07-28T15:11:38Z","messageCount":7,"participants":["Duy Nguyen","Stefan Beller","Michael Haggerty","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"292340","messageId":"CACsJy8CMnywB8AdmLxB8LnsznHrMTieoezhaQS=2r1pnM8ONZA@mail.gmail.com","threadId":"42941","inReplyTo":null,"subject":"Find a topic branch containing a commit","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-07-27T17:42:33Z","receivedAt":"2016-07-27T17:43:09Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Before I start doing anything silly because I don't know it can\nalready be done without waving my C wand like a mad man...\n\nI often do this: find a commit of interest, the commit itself is not\nenough so I need a full patch series to figure out what's going, so I\nfire up \"git log --graph --oneline\" and manually search that commit\nand trace back to the merge point, then I can \"git log --patch\". Is\nthere an automatic way to accomplish that? Something like \"git branch\n--contains\" (or \"git merge --contains\")?\n\nPS. Sometimes I wish we could optionally save cover letter in the\nmerge commit. Sometimes the \"big plan\" is hard to see by reading\nindividual commit messages.\n-- \nDuy\n"},{"id":"292342","messageId":"CAGZ79kY5UrjSj8xbjB+MvTE2xUyt+te1RKN6Bf0WiEA23iZ7wg@mail.gmail.com","threadId":"42941","inReplyTo":"CACsJy8CMnywB8AdmLxB8LnsznHrMTieoezhaQS=2r1pnM8ONZA@mail.gmail.com","subject":"Re: Find a topic branch containing a commit","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-07-27T17:50:12Z","receivedAt":"2016-07-27T17:50:22Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Jul 27, 2016 at 10:42 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n> Before I start doing anything silly because I don't know it can\n> already be done without waving my C wand like a mad man...\n>\n> I often do this: find a commit of interest, the commit itself is not\n> enough so I need a full patch series to figure out what's going, so I\n> fire up \"git log --graph --oneline\" and manually search that commit\n> and trace back to the merge point, then I can \"git log --patch\". Is\n> there an automatic way to accomplish that? Something like \"git branch\n> --contains\" (or \"git merge --contains\")?\n\nhttps://github.com/mhagger/git-when-merged ?\n\n>\n> PS. Sometimes I wish we could optionally save cover letter in the\n> merge commit. Sometimes the \"big plan\" is hard to see by reading\n> individual commit messages.\n> --\n> Duy\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"292346","messageId":"CAGZ79kYNFoAUu+5Y0oh221UeyAB3zan_36RgrhZnSi19Oe2vcA@mail.gmail.com","threadId":"42941","inReplyTo":"CAGZ79kY5UrjSj8xbjB+MvTE2xUyt+te1RKN6Bf0WiEA23iZ7wg@mail.gmail.com","subject":"Re: Find a topic branch containing a commit","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-07-27T18:02:48Z","receivedAt":"2016-07-27T18:02:53Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Jul 27, 2016 at 10:50 AM, Stefan Beller <sbeller@google.com> wrote:\n>>\n>> PS. Sometimes I wish we could optionally save cover letter in the\n>> merge commit. Sometimes the \"big plan\" is hard to see by reading\n>> individual commit messages.\n>> --\n\nI had this wish, too. That makes a lot of sense for merge commits,\nalthough it doesn't work well with our current workflow I would presume,\nbecause the merge commit happens at a different time than when Junio\npicks up a patch series. And in the mean time, where would we\nstore the cover letter information to not get lost?\n\nNote there are some external recordings instead of adding\nit to the history itself, e.g. https://github.com/trast/git/tree/notes/gmane\nannotated each commit with pointers to the mailing list archive.\n"},{"id":"292347","messageId":"CACsJy8CKLmjW82TJHUoqrM1smmiP=dcDqvOpN_QDPePEy0ZuJw@mail.gmail.com","threadId":"42941","inReplyTo":"CAGZ79kY5UrjSj8xbjB+MvTE2xUyt+te1RKN6Bf0WiEA23iZ7wg@mail.gmail.com","subject":"Re: Find a topic branch containing a commit","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-07-27T18:03:15Z","receivedAt":"2016-07-27T18:03:49Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Jul 27, 2016 at 7:50 PM, Stefan Beller <sbeller@google.com> wrote:\n> On Wed, Jul 27, 2016 at 10:42 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n>> Before I start doing anything silly because I don't know it can\n>> already be done without waving my C wand like a mad man...\n>>\n>> I often do this: find a commit of interest, the commit itself is not\n>> enough so I need a full patch series to figure out what's going, so I\n>> fire up \"git log --graph --oneline\" and manually search that commit\n>> and trace back to the merge point, then I can \"git log --patch\". Is\n>> there an automatic way to accomplish that? Something like \"git branch\n>> --contains\" (or \"git merge --contains\")?\n>\n> https://github.com/mhagger/git-when-merged ?\n\nBeautiful. If it had an option to show a topic (i.e. git-log from\nmerge base to merge point) I would be ecstatic. Michael, any plans on\nbringing this in C Git? For many topic-based projects this would be\nvery helpful addition, and I think it's not so hard to do it in C\neither.\n-- \nDuy\n"},{"id":"292348","messageId":"CACsJy8AuP-E1qHM_sJ4ZPpZDSk3s1KkuQOLB9B38+OUkobO11g@mail.gmail.com","threadId":"42941","inReplyTo":"CAGZ79kYNFoAUu+5Y0oh221UeyAB3zan_36RgrhZnSi19Oe2vcA@mail.gmail.com","subject":"Re: Find a topic branch containing a commit","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-07-27T18:07:29Z","receivedAt":"2016-07-27T18:08:04Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Jul 27, 2016 at 8:02 PM, Stefan Beller <sbeller@google.com> wrote:\n> On Wed, Jul 27, 2016 at 10:50 AM, Stefan Beller <sbeller@google.com> wrote:\n>>>\n>>> PS. Sometimes I wish we could optionally save cover letter in the\n>>> merge commit. Sometimes the \"big plan\" is hard to see by reading\n>>> individual commit messages.\n>>> --\n>\n> I had this wish, too. That makes a lot of sense for merge commits,\n> although it doesn't work well with our current workflow I would presume,\n> because the merge commit happens at a different time than when Junio\n> picks up a patch series. And in the mean time, where would we\n> store the cover letter information to not get lost?\n\nWe have config branch.xxx.description for that. If we teach git-am to\npick up (a selected portion of) the cover letter and save it in\nbranch.xxx.description (or even a new key like branch.xxx.mergeMsg)\nthen nothing is lost.\n-- \nDuy\n"},{"id":"292406","messageId":"a7cd0ee3-8281-b220-1acc-c9516325ecde@alum.mit.edu","threadId":"42941","inReplyTo":"CACsJy8CKLmjW82TJHUoqrM1smmiP=dcDqvOpN_QDPePEy0ZuJw@mail.gmail.com","subject":"Re: Find a topic branch containing a commit","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2016-07-28T13:46:08Z","receivedAt":"2016-07-28T13:46:36Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 07/27/2016 08:03 PM, Duy Nguyen wrote:\n> On Wed, Jul 27, 2016 at 7:50 PM, Stefan Beller <sbeller@google.com> wrote:\n>> On Wed, Jul 27, 2016 at 10:42 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n>>> Before I start doing anything silly because I don't know it can\n>>> already be done without waving my C wand like a mad man...\n>>>\n>>> I often do this: find a commit of interest, the commit itself is not\n>>> enough so I need a full patch series to figure out what's going, so I\n>>> fire up \"git log --graph --oneline\" and manually search that commit\n>>> and trace back to the merge point, then I can \"git log --patch\". Is\n>>> there an automatic way to accomplish that? Something like \"git branch\n>>> --contains\" (or \"git merge --contains\")?\n>>\n>> https://github.com/mhagger/git-when-merged ?\n> \n> Beautiful. If it had an option to show a topic (i.e. git-log from\n> merge base to merge point) I would be ecstatic.\n\nThat's a good idea. I just created a pull request to add that feature:\n\n    https://github.com/mhagger/git-when-merged/pull/13\n\nLet me know what you think!\n\n> Michael, any plans on\n> bringing this in C Git? For many topic-based projects this would be\n> very helpful addition, and I think it's not so hard to do it in C\n> either.\n\nI had no such plans, and I don't have time to work on that now. But I\ncertainly don't object if somebody else wants to work on it. It might\nmake a nice GSoC-sized project (though I'm not volunteering to be a\nmentor at this time :-P ).\n\nMichael\n\n"},{"id":"292409","messageId":"xmqqa8h1u7a8.fsf@gitster.mtv.corp.google.com","threadId":"42941","inReplyTo":"a7cd0ee3-8281-b220-1acc-c9516325ecde@alum.mit.edu","subject":"Re: Find a topic branch containing a commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-28T15:11:27Z","receivedAt":"2016-07-28T15:11:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Haggerty <mhagger@alum.mit.edu> writes:\n\n> On 07/27/2016 08:03 PM, Duy Nguyen wrote:\n>>>\n>>> https://github.com/mhagger/git-when-merged ?\n>> \n>> Beautiful. If it had an option to show a topic (i.e. git-log from\n>> merge base to merge point) I would be ecstatic.\n>\n> That's a good idea. I just created a pull request to add that feature:\n>\n>     https://github.com/mhagger/git-when-merged/pull/13\n>\n> Let me know what you think!\n\nIt would be nice to have a mode to give the result in a more human\nreadable way.\n\nI use when-merged to find where to queue a follow-on fix to a topic\nthat has already graduated to 'master'.  When the patch fixes an\nearlier mistake of the commit X, \"git when-merged X master\" gives me\nthe merge's 40-hex object name, and the next step is almost always\nto pass it to \"git describe [--contains]\".  This tells me down to\nwhich maintenace track the fix can go.\n\nOf course I can get that information by running a separate \"git\ndescribe [--contains] X\", but when I'll be running \"when-merged\"\nanyway, it is a wasted step.\n\nThen \"git show\" of the found merge tells me where the tip of the\ntopic is and what the topic was called (older topic branches are\nculled sometime after they are merged to 'master' and relevant\nmaintenance tracks), and allows me to queue the patch to the correct\nplace (after re-creating the topic if necessary).\n\n\n    \n"}]}