{"thread":{"id":"10814","subject":"Obscure commit message formatting issue","startedAt":"2007-11-11T21:28:19Z","lastAt":"2007-11-11T22:50:54Z","messageCount":5,"participants":["Daniel Barkalow","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"59382","messageId":"Pine.LNX.4.64.0711111559220.29952@iabervon.org","threadId":"10814","inReplyTo":null,"subject":"Obscure commit message formatting issue","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-11T21:28:19Z","receivedAt":"2007-11-11T21:28:19Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"The current code drops extra blank lines between the first line of a \ncommit message (the summary line) and the remainder. That is:\n\nThis is the summary\n\n\nThis is another bit\n\n\nThis is a third bit\n\nturns into:\n\nSubject: This is the summary\nOther-Headers:\n\nThis is another bit\n\n\nThis is a third bit\n\n\nThis is an issue if you want to generate an email whose body starts with a \nblank line, and I assume (although I haven't tried), that rebase would \nlose a blank line out of commits formatted like that. We don't seem to \nhave any tests that require that line to get suppressed, and we also don't \nsuppress any other blank lines. Is there some reason to do it?\n\nI'd guess that the \"first\" handling in pp_remainder() was intended to skip \nthe blank line between the summary line and the body, but that line has \nalready been consumed by other code.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"59387","messageId":"7vprygbfwf.fsf@gitster.siamese.dyndns.org","threadId":"10814","inReplyTo":"Pine.LNX.4.64.0711111559220.29952@iabervon.org","subject":"Re: Obscure commit message formatting issue","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-11T22:01:36Z","receivedAt":"2007-11-11T22:01:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> The current code drops extra blank lines between the first line of a \n> commit message (the summary line) and the remainder.\n\nThe patch application side does even more.  It not just strips\noff the leading or trailing blank lines, but duplicate blank\nlines in the middle and trailing whitespaces at the end of each\nline.\n\nI am of two minds about the formatting side.\n\nThe behaviour you found does not go far enough to correct all of\nthe above whitespace breakage the application side will fix up\non the generation side -- it only corrects one of them.  We\nmight want to do more, instead of less that you seem to be\nimplying to favor.\n"},{"id":"59392","messageId":"Pine.LNX.4.64.0711111706490.29952@iabervon.org","threadId":"10814","inReplyTo":"7vprygbfwf.fsf@gitster.siamese.dyndns.org","subject":"Re: Obscure commit message formatting issue","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-11T22:30:20Z","receivedAt":"2007-11-11T22:30:20Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 11 Nov 2007, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> > The current code drops extra blank lines between the first line of a \n> > commit message (the summary line) and the remainder.\n> \n> The patch application side does even more.  It not just strips\n> off the leading or trailing blank lines, but duplicate blank\n> lines in the middle and trailing whitespaces at the end of each\n> line.\n> \n> I am of two minds about the formatting side.\n> \n> The behaviour you found does not go far enough to correct all of\n> the above whitespace breakage the application side will fix up\n> on the generation side -- it only corrects one of them.  We\n> might want to do more, instead of less that you seem to be\n> implying to favor.\n\nWhat I'm actually doing is working on a cover letter implementation. I'd \nlike to use the same code that generates the subject line and message for \npatches to generate the cover letter text from some source material, if \nthere is source material, but have \"insert text here\" markers if there is \nno pre-existing text. But the \"insert text here\" marker for a paragraph \nlooks odd if it's a single line of vertical space, and it's annoying if \nthe space is full of text that has to be removed, and it's again odd if \nthe text isn't centered. So I want it to start with a blank line. But the \ncurrent code can't generate a text like that.\n\nReversability isn't all that important to me in this case, although it \nseems to me to be generally desirable for rebase. For email that actually \ngoes through people, I'd expect it to get further manipulated by humans, \nso it doesn't matter so much there, aside from being able to arrange the \ninput so that you can get the intermediate form you want.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"59395","messageId":"Pine.LNX.4.64.0711112240350.4362@racer.site","threadId":"10814","inReplyTo":"Pine.LNX.4.64.0711111706490.29952@iabervon.org","subject":"Re: Obscure commit message formatting issue","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-11T22:43:10Z","receivedAt":"2007-11-11T22:43:10Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 11 Nov 2007, Daniel Barkalow wrote:\n\n> On Sun, 11 Nov 2007, Junio C Hamano wrote:\n> \n> > Daniel Barkalow <barkalow@iabervon.org> writes:\n> > \n> > > The current code drops extra blank lines between the first line of a \n> > > commit message (the summary line) and the remainder.\n> > \n> > The patch application side does even more.  It not just strips\n> > off the leading or trailing blank lines, but duplicate blank\n> > lines in the middle and trailing whitespaces at the end of each\n> > line.\n> > \n> > I am of two minds about the formatting side.\n> > \n> > The behaviour you found does not go far enough to correct all of\n> > the above whitespace breakage the application side will fix up\n> > on the generation side -- it only corrects one of them.  We\n> > might want to do more, instead of less that you seem to be\n> > implying to favor.\n> \n> What I'm actually doing is working on a cover letter implementation.\n\nFunny.\n\nI am in the middle of cleaning out my personal git branch that has a messy \nhistory, since I never rebased, but always merged.  Now I decided to go \nwith rebasing.\n\nAnd there I found an implementation of a cover letter.  You might want to \nbe interested ;-)\n\n\thttp://repo.or.cz/w/git/dscho.git?a=shortlog;h=cover-letter\n\nCiao,\nDscho\n"},{"id":"59398","messageId":"Pine.LNX.4.64.0711111744090.29952@iabervon.org","threadId":"10814","inReplyTo":"Pine.LNX.4.64.0711112240350.4362@racer.site","subject":"Re: Obscure commit message formatting issue","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-11T22:50:54Z","receivedAt":"2007-11-11T22:50:54Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 11 Nov 2007, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Sun, 11 Nov 2007, Daniel Barkalow wrote:\n> \n> > On Sun, 11 Nov 2007, Junio C Hamano wrote:\n> > \n> > > Daniel Barkalow <barkalow@iabervon.org> writes:\n> > > \n> > > > The current code drops extra blank lines between the first line of a \n> > > > commit message (the summary line) and the remainder.\n> > > \n> > > The patch application side does even more.  It not just strips\n> > > off the leading or trailing blank lines, but duplicate blank\n> > > lines in the middle and trailing whitespaces at the end of each\n> > > line.\n> > > \n> > > I am of two minds about the formatting side.\n> > > \n> > > The behaviour you found does not go far enough to correct all of\n> > > the above whitespace breakage the application side will fix up\n> > > on the generation side -- it only corrects one of them.  We\n> > > might want to do more, instead of less that you seem to be\n> > > implying to favor.\n> > \n> > What I'm actually doing is working on a cover letter implementation.\n> \n> Funny.\n> \n> I am in the middle of cleaning out my personal git branch that has a messy \n> history, since I never rebased, but always merged.  Now I decided to go \n> with rebasing.\n> \n> And there I found an implementation of a cover letter.  You might want to \n> be interested ;-)\n> \n> \thttp://repo.or.cz/w/git/dscho.git?a=shortlog;h=cover-letter\n\nI actually started from the patch you sent me a while back, but using code \nfrom pretty.c instead of generating the message directly. I'll have to \ncheck whether you added anything since the patch I got.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}