* Obscure commit message formatting issue
@ 2007-11-11 21:28 Daniel Barkalow
2007-11-11 22:01 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Barkalow @ 2007-11-11 21:28 UTC (permalink / raw)
To: Junio C Hamano, git
The current code drops extra blank lines between the first line of a
commit message (the summary line) and the remainder. That is:
This is the summary
This is another bit
This is a third bit
turns into:
Subject: This is the summary
Other-Headers:
This is another bit
This is a third bit
This is an issue if you want to generate an email whose body starts with a
blank line, and I assume (although I haven't tried), that rebase would
lose a blank line out of commits formatted like that. We don't seem to
have any tests that require that line to get suppressed, and we also don't
suppress any other blank lines. Is there some reason to do it?
I'd guess that the "first" handling in pp_remainder() was intended to skip
the blank line between the summary line and the body, but that line has
already been consumed by other code.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Obscure commit message formatting issue
2007-11-11 21:28 Obscure commit message formatting issue Daniel Barkalow
@ 2007-11-11 22:01 ` Junio C Hamano
2007-11-11 22:30 ` Daniel Barkalow
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-11-11 22:01 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: git
Daniel Barkalow <barkalow@iabervon.org> writes:
> The current code drops extra blank lines between the first line of a
> commit message (the summary line) and the remainder.
The patch application side does even more. It not just strips
off the leading or trailing blank lines, but duplicate blank
lines in the middle and trailing whitespaces at the end of each
line.
I am of two minds about the formatting side.
The behaviour you found does not go far enough to correct all of
the above whitespace breakage the application side will fix up
on the generation side -- it only corrects one of them. We
might want to do more, instead of less that you seem to be
implying to favor.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Obscure commit message formatting issue
2007-11-11 22:01 ` Junio C Hamano
@ 2007-11-11 22:30 ` Daniel Barkalow
2007-11-11 22:43 ` Johannes Schindelin
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Barkalow @ 2007-11-11 22:30 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Sun, 11 Nov 2007, Junio C Hamano wrote:
> Daniel Barkalow <barkalow@iabervon.org> writes:
>
> > The current code drops extra blank lines between the first line of a
> > commit message (the summary line) and the remainder.
>
> The patch application side does even more. It not just strips
> off the leading or trailing blank lines, but duplicate blank
> lines in the middle and trailing whitespaces at the end of each
> line.
>
> I am of two minds about the formatting side.
>
> The behaviour you found does not go far enough to correct all of
> the above whitespace breakage the application side will fix up
> on the generation side -- it only corrects one of them. We
> might want to do more, instead of less that you seem to be
> implying to favor.
What I'm actually doing is working on a cover letter implementation. I'd
like to use the same code that generates the subject line and message for
patches to generate the cover letter text from some source material, if
there is source material, but have "insert text here" markers if there is
no pre-existing text. But the "insert text here" marker for a paragraph
looks odd if it's a single line of vertical space, and it's annoying if
the space is full of text that has to be removed, and it's again odd if
the text isn't centered. So I want it to start with a blank line. But the
current code can't generate a text like that.
Reversability isn't all that important to me in this case, although it
seems to me to be generally desirable for rebase. For email that actually
goes through people, I'd expect it to get further manipulated by humans,
so it doesn't matter so much there, aside from being able to arrange the
input so that you can get the intermediate form you want.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Obscure commit message formatting issue
2007-11-11 22:30 ` Daniel Barkalow
@ 2007-11-11 22:43 ` Johannes Schindelin
2007-11-11 22:50 ` Daniel Barkalow
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2007-11-11 22:43 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Junio C Hamano, git
Hi,
On Sun, 11 Nov 2007, Daniel Barkalow wrote:
> On Sun, 11 Nov 2007, Junio C Hamano wrote:
>
> > Daniel Barkalow <barkalow@iabervon.org> writes:
> >
> > > The current code drops extra blank lines between the first line of a
> > > commit message (the summary line) and the remainder.
> >
> > The patch application side does even more. It not just strips
> > off the leading or trailing blank lines, but duplicate blank
> > lines in the middle and trailing whitespaces at the end of each
> > line.
> >
> > I am of two minds about the formatting side.
> >
> > The behaviour you found does not go far enough to correct all of
> > the above whitespace breakage the application side will fix up
> > on the generation side -- it only corrects one of them. We
> > might want to do more, instead of less that you seem to be
> > implying to favor.
>
> What I'm actually doing is working on a cover letter implementation.
Funny.
I am in the middle of cleaning out my personal git branch that has a messy
history, since I never rebased, but always merged. Now I decided to go
with rebasing.
And there I found an implementation of a cover letter. You might want to
be interested ;-)
http://repo.or.cz/w/git/dscho.git?a=shortlog;h=cover-letter
Ciao,
Dscho
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Obscure commit message formatting issue
2007-11-11 22:43 ` Johannes Schindelin
@ 2007-11-11 22:50 ` Daniel Barkalow
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Barkalow @ 2007-11-11 22:50 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
On Sun, 11 Nov 2007, Johannes Schindelin wrote:
> Hi,
>
> On Sun, 11 Nov 2007, Daniel Barkalow wrote:
>
> > On Sun, 11 Nov 2007, Junio C Hamano wrote:
> >
> > > Daniel Barkalow <barkalow@iabervon.org> writes:
> > >
> > > > The current code drops extra blank lines between the first line of a
> > > > commit message (the summary line) and the remainder.
> > >
> > > The patch application side does even more. It not just strips
> > > off the leading or trailing blank lines, but duplicate blank
> > > lines in the middle and trailing whitespaces at the end of each
> > > line.
> > >
> > > I am of two minds about the formatting side.
> > >
> > > The behaviour you found does not go far enough to correct all of
> > > the above whitespace breakage the application side will fix up
> > > on the generation side -- it only corrects one of them. We
> > > might want to do more, instead of less that you seem to be
> > > implying to favor.
> >
> > What I'm actually doing is working on a cover letter implementation.
>
> Funny.
>
> I am in the middle of cleaning out my personal git branch that has a messy
> history, since I never rebased, but always merged. Now I decided to go
> with rebasing.
>
> And there I found an implementation of a cover letter. You might want to
> be interested ;-)
>
> http://repo.or.cz/w/git/dscho.git?a=shortlog;h=cover-letter
I actually started from the patch you sent me a while back, but using code
from pretty.c instead of generating the message directly. I'll have to
check whether you added anything since the patch I got.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-11 22:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-11 21:28 Obscure commit message formatting issue Daniel Barkalow
2007-11-11 22:01 ` Junio C Hamano
2007-11-11 22:30 ` Daniel Barkalow
2007-11-11 22:43 ` Johannes Schindelin
2007-11-11 22:50 ` Daniel Barkalow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).