[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] diff output header/format question
From: |
Randy Dunlap |
Subject: |
Re: [Quilt-dev] diff output header/format question |
Date: |
Mon, 10 Oct 2022 09:33:09 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 |
Hi Jean,
On 10/10/22 08:50, Jean Delvare wrote:
> Hi Randy,
>
> On Fri, 7 Oct 2022 15:01:36 -0700, Randy Dunlap wrote:
>> Search on lore.kernel.org (at least when searching by patchid, commitid)
>> looks for a "^diff" line before the ---/+++ lines in a patch.
>>
>> Can anyone suggest a way to cause or create that line?
>
> As far as I know, quilt can't currently do this. What it can do is
> print an Index header which looks like this:
>
> Index: b/arch/ia64/mm/numa.c
> ===================================================================
>
> If lore.kernel.org is happy with that, then all you need to do is
> ensure that you did not set QUILT_NO_DIFF_INDEX in ~/.quilrc or
> /etc/quilt.quiltrc.
Yes, I know about that one.
I was contemplating a similar option for a "diff header" line.
>> So instead of
>>
>> --- a/arch/ia64/mm/numa.c
>> +++ b/arch/ia64/mm/numa.c
>>
>> at the beginning of a file's patch, it would be 3 lines:
>> (a la git but without the "--git")
>>
>>
>> diff a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
>> --- a/arch/ia64/mm/numa.c
>> +++ b/arch/ia64/mm/numa.c
>
> If there any tool other than git which inserts such lines before the
> actual unified diff? GNU diff does not, unless I missed an option.
>
>> AFAICT quilt has no problem reading patches like this, since
>> whenever I get a (git) patch from other people to test, I apply
>> it with quilt and then rebuild the kernel.
>
> Correct, quilt will ignore the line and be happy with it (just like GNU
> patch).
>
> It shouldn't be too hard to add an option to quilt to optionally
> generate that line. However users will be free to use that option or
> not, so it doesn't really solve the problem at large (we can search for
> your patches, but not random quilt user patches). Shouldn't
> lore.kernel.org be improved to recognize patches without that line
> instead?
Yes, ideally. However, lore is just using a 'git patch-id --stable' command,
which does a SHA-1 sum of the diff to generate the expected patch-id.
I guess that SHA-1 sum (haven't looked at any git source code) includes
the "diff header" line.
I.e., it's git-centric.
Thanks.
--
~Randy