{"thread":{"id":"28232","subject":"Idea: \"git format-patch\" should get more information out of git","startedAt":"2011-08-27T05:12:32Z","lastAt":"2011-09-01T06:44:37Z","messageCount":12,"participants":["Michael Haggerty","Junio C Hamano","Michael J Gruber","Jeff King","Johan Herland"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"174369","messageId":"4E587CC0.4090508@alum.mit.edu","threadId":"28232","inReplyTo":null,"subject":"Idea: \"git format-patch\" should get more information out of git","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2011-08-27T05:12:32Z","receivedAt":"2011-08-27T05:12:32Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"It is a nuisance that the emails for a patch series have to be\nhand-edited after they are generated by \"git format-patch\".  Some of the\nproblems with this workflow are\n\n1. The extra information typed into the email series is not archived in\nthe git repository, and therefore the emails have to be kept around.\n\n2. If it is discovered between \"git format-patch\" and \"git send-email\"\nthat one of the patches needs a tweak, then the email series has to be\ngenerated anew and all of the hand-edits need to be redone.\n\n3. If a \"v2\" of the patch series has to be created, all of the\nhand-edits have to be done again.\n\n4. There is no place to store the \"additional information\" (the part\nthat comes in patch emails between the \"---\" and the diffstat) while\nworking on the patch series; it all has to be remembered or noted\nsomewhere else until just before sending off the patch emails.\n\nWouldn't it be nice if more of the information needed by \"git\nformat-patch\" could be extracted from the git repository?  For example:\n\n* The subject and body of the cover letter could be written to the log\nmessage of an annotated tag at the tip of the patch series.  \"git\nformat-patch\" could retrieve it if the \"--cover-letter\" option is used.\n\n* The CC and ACK lists could be written as specially-formatted lines in\nthe annotated tag's log message, or perhaps in a git note.\n\n* The \"additional information\" could be written to git notes.\n\nI don't know whether git notes are the right vessel for such\ninformation.  For example, are they carried along when a commit is rebased?\n\nI don't have time to implement any of this, but perhaps somebody thinks\nthis is a good idea and is inspired to work on it.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"174387","messageId":"7vippiaduw.fsf@alter.siamese.dyndns.org","threadId":"28232","inReplyTo":"4E587CC0.4090508@alum.mit.edu","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-27T18:46:12Z","receivedAt":"2011-08-27T18:46:12Z","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> 1. The extra information typed into the email series is not archived in\n> the git repository, and therefore the emails have to be kept around.\n\nThe convention is to have information that is not meant to be kept around\nafter '---', so...\n\n> 2. If it is discovered between \"git format-patch\" and \"git send-email\"\n> that one of the patches needs a tweak, then the email series has to be\n> generated anew and all of the hand-edits need to be redone.\n\nI actually often work this backwards. Tweak the patch files, apply them to\ncommit that they are meant to be applied, retest and then finally send.\nThere is no \"generating anew\" involved.\n\n> 4. There is no place to store the \"additional information\" (the part\n> that comes in patch emails between the \"---\" and the diffstat) while\n> working on the patch series;...\n\nI thought there was a RFC floating around to do this using notes and also\nteach it to \"commit -e\" a few months ago? I vaguelly recall that Peff and\none of the J's were involved, so I am CC'ing them.\n"},{"id":"174394","messageId":"4E595521.7080208@drmicha.warpmail.net","threadId":"28232","inReplyTo":"7vippiaduw.fsf@alter.siamese.dyndns.org","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-08-27T20:35:45Z","receivedAt":"2011-08-27T20:35:45Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 27.08.2011 20:46:\n> Michael Haggerty <mhagger@alum.mit.edu> writes:\n> \n>> 1. The extra information typed into the email series is not archived in\n>> the git repository, and therefore the emails have to be kept around.\n> \n> The convention is to have information that is not meant to be kept around\n> after '---', so...\n> \n>> 2. If it is discovered between \"git format-patch\" and \"git send-email\"\n>> that one of the patches needs a tweak, then the email series has to be\n>> generated anew and all of the hand-edits need to be redone.\n> \n> I actually often work this backwards. Tweak the patch files, apply them to\n> commit that they are meant to be applied, retest and then finally send.\n> There is no \"generating anew\" involved.\n> \n>> 4. There is no place to store the \"additional information\" (the part\n>> that comes in patch emails between the \"---\" and the diffstat) while\n>> working on the patch series;...\n> \n> I thought there was a RFC floating around to do this using notes and also\n> teach it to \"commit -e\" a few months ago? I vaguelly recall that Peff and\n> one of the J's were involved, so I am CC'ing them.\n\nDon't forget the MJ ;)\n\nMy current setup is:\n\nA. I put the additional per commit info in notes. \"git format-patch\n--notes\" takes it from there and adds it where it belongs.\n\nB. I put series title and cover letter text into a ref note. \"git branch\n--notes\" displays them as a branch note, and \"git format-patch --cover\n--notes\" fills in the cover letter for me.\n\nA patch for A has been on the list, but Junio didn't like the additional\n\"---\" which I had for technical reasons, and I haven't had time to\nrevisit that patch yet. (The code would have to store a flag about notes\nhaving been inserted or not.) Nobody has complained about the patches\nI've created with that form, though ;)\n\nThe stuff for B is part of my \"ref notes\" stuff which I haven't\nsubmitted so far. I've been using it for quite a while now, but am still\nunsure about some design aspects.\n\nA is simply my branch \"format-patch-notes\".\n\nB uses these:\nvob/virtual-objects\nvob/refrev-hash\nvob/branch-notes\nvob/format-patch-branch-note\n(Merge in this order. Last one is the most immature.)\n\nNote that I rebase frequently these days because of overlapping work in\nthese areas.\n\nI think Jeff had an interesting patch allowing to edit the note along\nside (OK: at the bottom of) the commit message.\n\nCheers,\nMichael\n\nOh, repo, yes... Any of these:\n\ngit://github.com/gitigit/git.git\ngit://gitorious.org/~mjg/git/mjg.git\ngit://repo.or.cz/git/mjg.git\n"},{"id":"174403","messageId":"4E59DE5D.60906@alum.mit.edu","threadId":"28232","inReplyTo":"4E595521.7080208@drmicha.warpmail.net","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2011-08-28T06:21:17Z","receivedAt":"2011-08-28T06:21:17Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 08/27/2011 10:35 PM, Michael J Gruber wrote:\n> My current setup is:\n> \n> A. I put the additional per commit info in notes. \"git format-patch\n> --notes\" takes it from there and adds it where it belongs.\n> \n> B. I put series title and cover letter text into a ref note. \"git branch\n> --notes\" displays them as a branch note, and \"git format-patch --cover\n> --notes\" fills in the cover letter for me.\n\nVery cool.  I will check this out.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"174406","messageId":"7v1uw69h96.fsf@alter.siamese.dyndns.org","threadId":"28232","inReplyTo":"7vippiaduw.fsf@alter.siamese.dyndns.org","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-28T06:34:13Z","receivedAt":"2011-08-28T06:34:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Michael Haggerty <mhagger@alum.mit.edu> writes:\n>\n>> 4. There is no place to store the \"additional information\" (the part\n>> that comes in patch emails between the \"---\" and the diffstat) while\n>> working on the patch series;...\n>\n> I thought there was a RFC floating around to do this using notes and also\n> teach it to \"commit -e\" a few months ago? I vaguelly recall that Peff and\n> one of the J's were involved, so I am CC'ing them.\n\nAlso, when I prepare a commit to be sent with an additional piece of\ninformation, I often write \"---\" and the additional message after my\nS-o-b: line while preparing the commit log message. Unlike format-patch\nthat strips that off, commit keeps it, which is handy.\n"},{"id":"174475","messageId":"20110829185546.GD756@sigill.intra.peff.net","threadId":"28232","inReplyTo":"7v1uw69h96.fsf@alter.siamese.dyndns.org","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-08-29T18:55:46Z","receivedAt":"2011-08-29T18:55:46Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 27, 2011 at 11:34:13PM -0700, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Michael Haggerty <mhagger@alum.mit.edu> writes:\n> >\n> >> 4. There is no place to store the \"additional information\" (the part\n> >> that comes in patch emails between the \"---\" and the diffstat) while\n> >> working on the patch series;...\n> >\n> > I thought there was a RFC floating around to do this using notes and also\n> > teach it to \"commit -e\" a few months ago? I vaguelly recall that Peff and\n> > one of the J's were involved, so I am CC'ing them.\n> \n> Also, when I prepare a commit to be sent with an additional piece of\n> information, I often write \"---\" and the additional message after my\n> S-o-b: line while preparing the commit log message. Unlike format-patch\n> that strips that off, commit keeps it, which is handy.\n\nAfter playing around a bit with my earlier series, I made the\nrealization (perhaps obvious to others :) ), that if you are in a\npure-patch workflow, keeping the \"---\" in your commit message locally is\nmuch simpler. It follows the commit around through rebases\nautomatically, it gets put into format-patch output automatically, and\nso forth.\n\nThe only real downside is that you can never tell git \"don't show me the\ncover letter cruft\". Which is probably OK for your own local patches.\nBut the point of the \"---\" is that information should never make it into\na repo, which means in any workflow that involves pulling actual git\ncommits, it won't work (after reading Michael's response in another\nthread, though, I think he would be interested in a hybrid\npull-or-apply-via-mail system).\n\n-Peff\n"},{"id":"174547","messageId":"4E5CD5B9.80306@drmicha.warpmail.net","threadId":"28232","inReplyTo":"20110829185546.GD756@sigill.intra.peff.net","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-08-30T12:21:13Z","receivedAt":"2011-08-30T12:21:13Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jeff King venit, vidit, dixit 29.08.2011 20:55:\n> On Sat, Aug 27, 2011 at 11:34:13PM -0700, Junio C Hamano wrote:\n> \n>> Junio C Hamano <gitster@pobox.com> writes:\n>>\n>>> Michael Haggerty <mhagger@alum.mit.edu> writes:\n>>>\n>>>> 4. There is no place to store the \"additional information\" (the part\n>>>> that comes in patch emails between the \"---\" and the diffstat) while\n>>>> working on the patch series;...\n>>>\n>>> I thought there was a RFC floating around to do this using notes and also\n>>> teach it to \"commit -e\" a few months ago? I vaguelly recall that Peff and\n>>> one of the J's were involved, so I am CC'ing them.\n>>\n>> Also, when I prepare a commit to be sent with an additional piece of\n>> information, I often write \"---\" and the additional message after my\n>> S-o-b: line while preparing the commit log message. Unlike format-patch\n>> that strips that off, commit keeps it, which is handy.\n> \n> After playing around a bit with my earlier series, I made the\n> realization (perhaps obvious to others :) ), that if you are in a\n> pure-patch workflow, keeping the \"---\" in your commit message locally is\n> much simpler. It follows the commit around through rebases\n> automatically, it gets put into format-patch output automatically, and\n> so forth.\n\nI'm confused: Does format-patch keep it or strip it as you say above?\n\nAnyways, notes survive rebase etc., and at format-patch time you can\ndecide whether you want to include them or not (with my patch).\n\n> The only real downside is that you can never tell git \"don't show me the\n> cover letter cruft\". Which is probably OK for your own local patches.\n\nYou can with notes...\n\n> But the point of the \"---\" is that information should never make it into\n> a repo, which means in any workflow that involves pulling actual git\n> commits, it won't work (after reading Michael's response in another\n> thread, though, I think he would be interested in a hybrid\n> pull-or-apply-via-mail system).\n\nThe only difficulty would be sharing notes in a push-pull workflow (for\nlack of tool support, though we do have merge support).\n\nCheers,\nMichael\n"},{"id":"174553","messageId":"20110830152217.GA13022@sigill.intra.peff.net","threadId":"28232","inReplyTo":"4E5CD5B9.80306@drmicha.warpmail.net","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-08-30T15:22:17Z","receivedAt":"2011-08-30T15:22:17Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Aug 30, 2011 at 02:21:13PM +0200, Michael J Gruber wrote:\n\n> > After playing around a bit with my earlier series, I made the\n> > realization (perhaps obvious to others :) ), that if you are in a\n> > pure-patch workflow, keeping the \"---\" in your commit message locally is\n> > much simpler. It follows the commit around through rebases\n> > automatically, it gets put into format-patch output automatically, and\n> > so forth.\n> \n> I'm confused: Does format-patch keep it or strip it as you say above?\n\nFormat-patch will include the whole commit message, including \"---\" and\nwhat comes after. But an \"am\" recipient will strip it out of the commit\nmessage. IOW, you locally treat your \"---\" notes as part of the commit\nmessage, but in a pure-patch workflow, upstream treats it as something\nto be stripped out.\n\nSo there is asymmetry in what is in your commit versus what is in\nupstream's commit. But that's OK, because how you treat the commit\n(something to be tweaked and rebased, and then mailed out) and how\nupstream treats it (something to go into the long-term project history)\nare different.\n\nBut that breaks down if you ever want to share actual commit objects\nwith upstream.\n\n> Anyways, notes survive rebase etc.\n\nYou still have to manually configure:\n\n  git config notes.rewriteRef refs/notes/commits\n\nPerhaps that is something that should be changed.\n\n> and at format-patch time you can decide whether you want to include\n> them or not (with my patch).\n\nYeah. Don't get me wrong, I think putting \"---\" notes into git-notes is\nway more flexible. It's just that it's also more complex, and\nunnecessarily so for many use cases.\n\nWe have some patches to hide that complexity, but I was at one point\nwondering if all of the complexity was worthwhile. But as I mentioned\nabove, if you want to build anything more complex than a pure-patch\nworkflow, the simple solution breaks down. So it probably is worth\npursuing.\n\n-Peff\n"},{"id":"174555","messageId":"4E5D048D.4010902@drmicha.warpmail.net","threadId":"28232","inReplyTo":"20110830152217.GA13022@sigill.intra.peff.net","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-08-30T15:41:01Z","receivedAt":"2011-08-30T15:41:01Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jeff King venit, vidit, dixit 30.08.2011 17:22:\n> On Tue, Aug 30, 2011 at 02:21:13PM +0200, Michael J Gruber wrote:\n...\n>> Anyways, notes survive rebase etc.\n> \n> You still have to manually configure:\n> \n>   git config notes.rewriteRef refs/notes/commits\n> \n> Perhaps that is something that should be changed.\n\nRight, I've done that quite a while ago and forgot.\n\n>> and at format-patch time you can decide whether you want to include\n>> them or not (with my patch).\n> \n> Yeah. Don't get me wrong, I think putting \"---\" notes into git-notes is\n> way more flexible. It's just that it's also more complex, and\n> unnecessarily so for many use cases.\n> \n> We have some patches to hide that complexity, but I was at one point\n> wondering if all of the complexity was worthwhile. But as I mentioned\n> above, if you want to build anything more complex than a pure-patch\n> workflow, the simple solution breaks down. So it probably is worth\n> pursuing.\n\nReminds me of the ref namespace restructuring which could help sharing\nnotes... Oh, lots to do before git 3.0!\n\nMichael\n"},{"id":"174565","messageId":"201108301939.53487.johan@herland.net","threadId":"28232","inReplyTo":"4E5D048D.4010902@drmicha.warpmail.net","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2011-08-30T17:39:52Z","receivedAt":"2011-08-30T17:39:52Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Tuesday 30. August 2011, Michael J Gruber wrote:\n> Reminds me of the ref namespace restructuring which could help\n> sharing notes... Oh, lots to do before git 3.0!\n\nIndeed. I am very sorry to not have been able to properly follow up on \nthat proposal (or a couple of other patches for that matter), but I'm \ncurrently in the middle of changing jobs and moving to a new apartment, \nwhich unfortunately leaves little if any spare time for git work. I \ndon't believe I'll find the time to pick this up in the next month or \ntwo, so if someone wants to run with it, you are very welcome to do so.\n\nI will try to participate in discussions where I'm CCed, but the rest of \nthe mailing list is mostly a blur, these days.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"174658","messageId":"4E5F0ACD.8050206@alum.mit.edu","threadId":"28232","inReplyTo":"201108301939.53487.johan@herland.net","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2011-09-01T04:32:13Z","receivedAt":"2011-09-01T04:32:13Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 08/30/2011 07:39 PM, Johan Herland wrote:\n> On Tuesday 30. August 2011, Michael J Gruber wrote:\n>> Reminds me of the ref namespace restructuring which could help\n>> sharing notes... Oh, lots to do before git 3.0!\n> \n> Indeed. I am very sorry to not have been able to properly follow up on \n> that proposal [...]\n\nWhat \"ref rename restructuring\" are you talking about?  Can you give a\nmailing list link?\n\n(I've been working on refs lately and want to know whether your proposal\nis relevant to my work.)\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"174661","messageId":"4E5F29D5.4060205@drmicha.warpmail.net","threadId":"28232","inReplyTo":"4E5F0ACD.8050206@alum.mit.edu","subject":"Re: Idea: \"git format-patch\" should get more information out of git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-01T06:44:37Z","receivedAt":"2011-09-01T06:44:37Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael Haggerty venit, vidit, dixit 01.09.2011 06:32:\n> On 08/30/2011 07:39 PM, Johan Herland wrote:\n>> On Tuesday 30. August 2011, Michael J Gruber wrote:\n>>> Reminds me of the ref namespace restructuring which could help\n>>> sharing notes... Oh, lots to do before git 3.0!\n>>\n>> Indeed. I am very sorry to not have been able to properly follow up on \n>> that proposal [...]\n> \n> What \"ref rename restructuring\" are you talking about?  Can you give a\n> mailing list link?\n> \n> (I've been working on refs lately and want to know whether your proposal\n> is relevant to my work.)\n\nSearching for \"namespace\" in the subject should give you all relevant\nproposals plus the new \"namespaces\" which might affect you also:\n\nhttp://permalink.gmane.org/gmane.comp.version-control.git/140681\nhttp://permalink.gmane.org/gmane.comp.version-control.git/165813\nhttp://permalink.gmane.org/gmane.comp.version-control.git/165799\n\nhttp://permalink.gmane.org/gmane.comp.version-control.git/176808\n\nMichael\n"}]}