[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] Re: Separating patch header from body
From: |
Andreas Gruenbacher |
Subject: |
[Quilt-dev] Re: Separating patch header from body |
Date: |
Sat, 14 Jan 2006 21:18:27 +0100 |
User-agent: |
KMail/1.8 |
On Saturday 14 January 2006 20:36, Linus Torvalds wrote:
> On Sat, 14 Jan 2006, Andreas Gruenbacher wrote:
> > We need to change our heuristic to work well with git extended patches.
> > My first approach would be to check for the first line that matches the
> > following regular expression, and assume that the patch begins here:
> >
> > /^(diff|---|\*\*\*)[ \t]+[^ \t]/
>
> It would be great if quilt used the same heuristics as my patch
> application scripts, if only because then there would never be any case
> where we do things differently.
Quilt refresh and those scripts don't do the same thing, that's the problem
here.
> My "dotest" rules (which predate git, although they've changed a bit) are
> basically that there are three things that mark the boundary between
> "description" and "patch":
>
> - a line that starts with "diff -"
>
> This is the traditional diff header, even before git (ie we do not want
> things like that in the description)
>
> - a line that starts with "---"
>
> This is either the "unified diff" marker, or it's a user separator (And
> my patch applicator scripts don't even require spaces at the end: a
> line with 50 '-' characters will break too)
>
> - a line that starts with "Index: "
>
> This is CVS diff format.
>
> I don't personally break on "***". There's no point. Nobody uses
> traditional diffs. But I don't think it's wrong to do that.
Quilt is not kernel specific, and in other projects there sometimes are
context diffs. Yes it's weird ;)
> So your pattern is _almost_ ok. A line with _only_ "---" on it doesn't
> trigger your test (because you require it to be followed by whitespace).
>
> > Andrew Morton's The Perfect Patch document at
> > http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt mentions that
> > ^--- is often used as the separator. In quilt's case we want to keep
> > diffstat sections in the header: quilt knows how to refresh them.
>
> It's not just diffstat. People use them for personal messages, ie they'll
> have the real "patch description", and then a "---" and then they'll have
> an explanation for me saying something like "please apply before 2.6.xx
> because this is holding up that other thing".
>
> So the "diffstat" is just an _example_ of something that doesn't belong in
> the actual changelog, and that I prefer seeing.
Yes, and that's why quilt refresh should not cut off at ^--- markers, or else
such comments would disappear with each refresh, and wouldn't get to you.
Paul Jackson reported this problem before, see
http://lkml.org/lkml/2005/10/3/147.
So how about /^(diff -|(Index:|---|\*\*\*)[ \t])/ instead? I'm not totally
sure that 'diff -' will always match, but it does in the cases I can come up
with right now.
Thanks,
Andreas
- [Quilt-dev] Re: Separating patch header from body,
Andreas Gruenbacher <=