[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] [PATCH RFC] Add option --preamble to diff and refresh

From: Randy Dunlap
Subject: Re: [Quilt-dev] [PATCH RFC] Add option --preamble to diff and refresh
Date: Mon, 17 Oct 2022 16:11:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1

Hi Jean,

On 10/13/22 05:34, Jean Delvare wrote:
> Option --preamble can be used to let quilt generate extra lines
> before the actual diff. For now one preamble format is supported,
> "diff", which will generate a line like:
>> diff -- a/dir/file b/dir/file
> This is meant to help other tools recognize the beginning of the
> patch body, namely lore.kernel.org.
> Suggested-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> ---
> Randy, this is a tentative implementation of the feature you requested.
> Please give it a try and let me know if it works for you.
> Note that I made the line start with "diff --" rather than just "diff".
> The reason is that just matching for "^diff " could easily lead to
> false positives as this pattern could legitimately appear in the patch
> header. This is compatible with the way quilt currently detects the
> start of body for git-generated patches.
> I am moderately happy with the implementation, somehow it feels like
> --no-index and --preamble should be merged into a single option, but it
> seems difficult to do that without breaking backward compatibility. But
> I don't know if we care.

Thanks for the patch. It is working for me in my limited testing.
I also submitted a patch that uses it:

I did create a similar patch but it has a bug in which the first diff header
line in a patch file is repeated and added each time that the patch is
refreshed, but only for the first file in the patch. Other files in the
same patch file do not have the diff header (preamble) line repeated.
If it didn't have that flaw, I would have posted it.

>  doc/quilt.1.in            |    8 ++++++++
>  quilt/diff.in             |    8 +++++++-
>  quilt/refresh.in          |    8 +++++++-
>  quilt/scripts/patchfns.in |   14 ++++++++++----
>  4 files changed, 32 insertions(+), 6 deletions(-)

Thanks again.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]