* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
@ 2015-03-31 1:54 Josh Wu
2015-04-01 2:04 ` Simon Glass
0 siblings, 1 reply; 8+ messages in thread
From: Josh Wu @ 2015-03-31 1:54 UTC (permalink / raw)
To: u-boot
Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
tools/patman/patchstream.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 8c3a0ec..4bfb1e9 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
prefix = series.GetPatchPrefix()
for line in lines:
if line.startswith('Subject:'):
- # TODO: if more than 10 patches this should save 00/xx, not 0/xx
- line = 'Subject: [%s 0/%d] %s\n' % (prefix, count, text[0])
+ # if more than 10 patches this should save 00/xx, not 0/xx
+ zero_repeat = 1
+ while (count / (10 ** zero_repeat) > 0):
+ zero_repeat = zero_repeat + 1
+
+ zero = '0' * zero_repeat
+ line = 'Subject: [%s %s/%d] %s\n' % (prefix, zero, count, text[0])
# Insert our cover letter
elif line.startswith('*** BLURB HERE ***'):
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
2015-03-31 1:54 [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches Josh Wu
@ 2015-04-01 2:04 ` Simon Glass
2015-04-01 2:54 ` Josh Wu
0 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2015-04-01 2:04 UTC (permalink / raw)
To: u-boot
Hi Josh,
On 30 March 2015 at 19:54, Josh Wu <josh.wu@atmel.com> wrote:
> Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
This is a quirk of patman that I've grown comfortable with. Still, we
should fix it. Thanks for the patch.
>
> tools/patman/patchstream.py | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
> index 8c3a0ec..4bfb1e9 100644
> --- a/tools/patman/patchstream.py
> +++ b/tools/patman/patchstream.py
> @@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
> prefix = series.GetPatchPrefix()
> for line in lines:
> if line.startswith('Subject:'):
> - # TODO: if more than 10 patches this should save 00/xx, not 0/xx
> - line = 'Subject: [%s 0/%d] %s\n' % (prefix, count, text[0])
> + # if more than 10 patches this should save 00/xx, not 0/xx
s/save/say/
(my typo, I think)
> + zero_repeat = 1
> + while (count / (10 ** zero_repeat) > 0):
> + zero_repeat = zero_repeat + 1
How about:
zero_repeat = int(math.log10(count)) + 1
?
> +
> + zero = '0' * zero_repeat
> + line = 'Subject: [%s %s/%d] %s\n' % (prefix, zero, count, text[0])
>
> # Insert our cover letter
> elif line.startswith('*** BLURB HERE ***'):
> --
> 1.9.1
Regards,
Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
2015-04-01 2:04 ` Simon Glass
@ 2015-04-01 2:54 ` Josh Wu
2015-04-05 18:31 ` Simon Glass
0 siblings, 1 reply; 8+ messages in thread
From: Josh Wu @ 2015-04-01 2:54 UTC (permalink / raw)
To: u-boot
Hi, Simon
On 4/1/2015 10:04 AM, Simon Glass wrote:
> Hi Josh,
>
> On 30 March 2015 at 19:54, Josh Wu <josh.wu@atmel.com> wrote:
>> Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
>>
>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>> ---
> This is a quirk of patman that I've grown comfortable with. Still, we
> should fix it. Thanks for the patch.
>
>> tools/patman/patchstream.py | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
>> index 8c3a0ec..4bfb1e9 100644
>> --- a/tools/patman/patchstream.py
>> +++ b/tools/patman/patchstream.py
>> @@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
>> prefix = series.GetPatchPrefix()
>> for line in lines:
>> if line.startswith('Subject:'):
>> - # TODO: if more than 10 patches this should save 00/xx, not 0/xx
>> - line = 'Subject: [%s 0/%d] %s\n' % (prefix, count, text[0])
>> + # if more than 10 patches this should save 00/xx, not 0/xx
> s/save/say/
>
> (my typo, I think)
;-) I'll fix this.
>
>> + zero_repeat = 1
>> + while (count / (10 ** zero_repeat) > 0):
>> + zero_repeat = zero_repeat + 1
> How about:
>
> zero_repeat = int(math.log10(count)) + 1
>
> ?
yes, it's better. just need to import the match lib.
I will change to this and sent v2 patch. Thanks.
BTW: speak of patman, I get an issue of using the "Series-prefix".
When I use Series-prefix like following in the commit:
Series-prefix: U-Boot][
Then I get the patman generated patch like:
[U-Boot][ PATCH]
^ a space here.
A space is before the 'PATCH', that annoys me. But I don't see you have
such space in your patches. Any advice to avoid the extra space?
Thanks in advance.
Best Regards,
Josh Wu
>
>> +
>> + zero = '0' * zero_repeat
>> + line = 'Subject: [%s %s/%d] %s\n' % (prefix, zero, count, text[0])
>>
>> # Insert our cover letter
>> elif line.startswith('*** BLURB HERE ***'):
>> --
>> 1.9.1
> Regards,
> Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
2015-04-01 2:54 ` Josh Wu
@ 2015-04-05 18:31 ` Simon Glass
2015-04-07 2:31 ` Josh Wu
0 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2015-04-05 18:31 UTC (permalink / raw)
To: u-boot
Hi Josh,
On 31 March 2015 at 20:54, Josh Wu <josh.wu@atmel.com> wrote:
> Hi, Simon
>
> On 4/1/2015 10:04 AM, Simon Glass wrote:
>>
>> Hi Josh,
>>
>> On 30 March 2015 at 19:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>
>>> Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
>>>
>>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>>> ---
>>
>> This is a quirk of patman that I've grown comfortable with. Still, we
>> should fix it. Thanks for the patch.
>>
>>> tools/patman/patchstream.py | 9 +++++++--
>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
>>> index 8c3a0ec..4bfb1e9 100644
>>> --- a/tools/patman/patchstream.py
>>> +++ b/tools/patman/patchstream.py
>>> @@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
>>> prefix = series.GetPatchPrefix()
>>> for line in lines:
>>> if line.startswith('Subject:'):
>>> - # TODO: if more than 10 patches this should save 00/xx, not
>>> 0/xx
>>> - line = 'Subject: [%s 0/%d] %s\n' % (prefix, count, text[0])
>>> + # if more than 10 patches this should save 00/xx, not 0/xx
>>
>> s/save/say/
>>
>> (my typo, I think)
>
> ;-) I'll fix this.
>>
>>
>>> + zero_repeat = 1
>>> + while (count / (10 ** zero_repeat) > 0):
>>> + zero_repeat = zero_repeat + 1
>>
>> How about:
>>
>> zero_repeat = int(math.log10(count)) + 1
>>
>> ?
>
> yes, it's better. just need to import the match lib.
> I will change to this and sent v2 patch. Thanks.
>
> BTW: speak of patman, I get an issue of using the "Series-prefix".
>
> When I use Series-prefix like following in the commit:
> Series-prefix: U-Boot][
> Then I get the patman generated patch like:
> [U-Boot][ PATCH]
> ^ a space here.
>
> A space is before the 'PATCH', that annoys me. But I don't see you have such
> space in your patches. Any advice to avoid the extra space?
> Thanks in advance.
This is intentional, since if you use a prefix of 'RFC' we want to get
'RFC PATCH v2' instead of 'RFCPATCH v2'. See GetPatchPrefix(). Why do
you want [U-Boot] anyway? That sounds more like the project than a
patch prefix. Perhaps you could add an option to prepend the project
in square brackets?
Regards,
Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
2015-04-05 18:31 ` Simon Glass
@ 2015-04-07 2:31 ` Josh Wu
2015-04-07 20:49 ` Simon Glass
0 siblings, 1 reply; 8+ messages in thread
From: Josh Wu @ 2015-04-07 2:31 UTC (permalink / raw)
To: u-boot
HI, Simon
Thanks for the feedback.
On 4/6/2015 2:31 AM, Simon Glass wrote:
> Hi Josh,
>
> On 31 March 2015 at 20:54, Josh Wu <josh.wu@atmel.com> wrote:
>> Hi, Simon
>>
>> On 4/1/2015 10:04 AM, Simon Glass wrote:
>>> Hi Josh,
>>>
>>> On 30 March 2015 at 19:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>> Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
>>>>
>>>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>>>> ---
>>> This is a quirk of patman that I've grown comfortable with. Still, we
>>> should fix it. Thanks for the patch.
>>>
>>>> tools/patman/patchstream.py | 9 +++++++--
>>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
>>>> index 8c3a0ec..4bfb1e9 100644
>>>> --- a/tools/patman/patchstream.py
>>>> +++ b/tools/patman/patchstream.py
>>>> @@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
>>>> prefix = series.GetPatchPrefix()
>>>> for line in lines:
>>>> if line.startswith('Subject:'):
>>>> - # TODO: if more than 10 patches this should save 00/xx, not
>>>> 0/xx
>>>> - line = 'Subject: [%s 0/%d] %s\n' % (prefix, count, text[0])
>>>> + # if more than 10 patches this should save 00/xx, not 0/xx
>>> s/save/say/
>>>
>>> (my typo, I think)
>> ;-) I'll fix this.
>>>
>>>> + zero_repeat = 1
>>>> + while (count / (10 ** zero_repeat) > 0):
>>>> + zero_repeat = zero_repeat + 1
>>> How about:
>>>
>>> zero_repeat = int(math.log10(count)) + 1
>>>
>>> ?
>> yes, it's better. just need to import the match lib.
>> I will change to this and sent v2 patch. Thanks.
>>
>> BTW: speak of patman, I get an issue of using the "Series-prefix".
>>
>> When I use Series-prefix like following in the commit:
>> Series-prefix: U-Boot][
>> Then I get the patman generated patch like:
>> [U-Boot][ PATCH]
>> ^ a space here.
>>
>> A space is before the 'PATCH', that annoys me. But I don't see you have such
>> space in your patches. Any advice to avoid the extra space?
>> Thanks in advance.
> This is intentional, since if you use a prefix of 'RFC' we want to get
> 'RFC PATCH v2' instead of 'RFCPATCH v2'. See GetPatchPrefix().
yes, understood.
> Why do
> you want [U-Boot] anyway? That sounds more like the project than a
> patch prefix. Perhaps you could add an option to prepend the project
> in square brackets?
I tried a the project prefix, and that works for the format-patch
command. But it not work for patman.
here is my steps:
git config format.subjectprefix "U-Boot"
Now, when I run git format-patch, the generated patch will have
"[U-Boot]" prefix. But if I run "patman -c1 -n", the [U-Boot] prefix is
gone.
It seems patman overide the format.subjectprefix option of git. Do you
have an idea about what is the difference between the run "git
format-patch -1" and "patman -c1"?
thanks.
Best Regards,
Josh Wu
>
> Regards,
> Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
2015-04-07 2:31 ` Josh Wu
@ 2015-04-07 20:49 ` Simon Glass
2015-04-08 2:38 ` Josh Wu
0 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2015-04-07 20:49 UTC (permalink / raw)
To: u-boot
Hi Josh,
On 6 April 2015 at 20:31, Josh Wu <josh.wu@atmel.com> wrote:
> HI, Simon
>
> Thanks for the feedback.
>
>
> On 4/6/2015 2:31 AM, Simon Glass wrote:
>>
>> Hi Josh,
>>
>> On 31 March 2015 at 20:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>
>>> Hi, Simon
>>>
>>> On 4/1/2015 10:04 AM, Simon Glass wrote:
>>>>
>>>> Hi Josh,
>>>>
>>>> On 30 March 2015 at 19:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>>>
>>>>> Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
>>>>>
>>>>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>>>>> ---
>>>>
>>>> This is a quirk of patman that I've grown comfortable with. Still, we
>>>> should fix it. Thanks for the patch.
>>>>
>>>>> tools/patman/patchstream.py | 9 +++++++--
>>>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
>>>>> index 8c3a0ec..4bfb1e9 100644
>>>>> --- a/tools/patman/patchstream.py
>>>>> +++ b/tools/patman/patchstream.py
>>>>> @@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
>>>>> prefix = series.GetPatchPrefix()
>>>>> for line in lines:
>>>>> if line.startswith('Subject:'):
>>>>> - # TODO: if more than 10 patches this should save 00/xx,
>>>>> not
>>>>> 0/xx
>>>>> - line = 'Subject: [%s 0/%d] %s\n' % (prefix, count,
>>>>> text[0])
>>>>> + # if more than 10 patches this should save 00/xx, not 0/xx
>>>>
>>>> s/save/say/
>>>>
>>>> (my typo, I think)
>>>
>>> ;-) I'll fix this.
>>>>
>>>>
>>>>> + zero_repeat = 1
>>>>> + while (count / (10 ** zero_repeat) > 0):
>>>>> + zero_repeat = zero_repeat + 1
>>>>
>>>> How about:
>>>>
>>>> zero_repeat = int(math.log10(count)) + 1
>>>>
>>>> ?
>>>
>>> yes, it's better. just need to import the match lib.
>>> I will change to this and sent v2 patch. Thanks.
>>>
>>> BTW: speak of patman, I get an issue of using the "Series-prefix".
>>>
>>> When I use Series-prefix like following in the commit:
>>> Series-prefix: U-Boot][
>>> Then I get the patman generated patch like:
>>> [U-Boot][ PATCH]
>>> ^ a space here.
>>>
>>> A space is before the 'PATCH', that annoys me. But I don't see you have
>>> such
>>> space in your patches. Any advice to avoid the extra space?
>>> Thanks in advance.
>>
>> This is intentional, since if you use a prefix of 'RFC' we want to get
>> 'RFC PATCH v2' instead of 'RFCPATCH v2'. See GetPatchPrefix().
>
> yes, understood.
>
>> Why do
>> you want [U-Boot] anyway? That sounds more like the project than a
>> patch prefix. Perhaps you could add an option to prepend the project
>> in square brackets?
>
> I tried a the project prefix, and that works for the format-patch command.
> But it not work for patman.
>
> here is my steps:
> git config format.subjectprefix "U-Boot"
>
> Now, when I run git format-patch, the generated patch will have "[U-Boot]"
> prefix. But if I run "patman -c1 -n", the [U-Boot] prefix is gone.
> It seems patman overide the format.subjectprefix option of git. Do you have
> an idea about what is the difference between the run "git format-patch -1"
> and "patman -c1"?
> thanks.
Why do you want [U-Boot] anyway?
I suggest you add an option to prepend the patman project name (in
square brackets) to patches, from the -p option.
Patman has to set up its own prefix when generating patches. See
CreatePatches().
Regards,
Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
2015-04-07 20:49 ` Simon Glass
@ 2015-04-08 2:38 ` Josh Wu
2015-04-08 2:41 ` Simon Glass
0 siblings, 1 reply; 8+ messages in thread
From: Josh Wu @ 2015-04-08 2:38 UTC (permalink / raw)
To: u-boot
On 4/8/2015 4:49 AM, Simon Glass wrote:
> Hi Josh,
>
> On 6 April 2015 at 20:31, Josh Wu <josh.wu@atmel.com> wrote:
>> HI, Simon
>>
>> Thanks for the feedback.
>>
>>
>> On 4/6/2015 2:31 AM, Simon Glass wrote:
>>> Hi Josh,
>>>
>>> On 31 March 2015 at 20:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>> Hi, Simon
>>>>
>>>> On 4/1/2015 10:04 AM, Simon Glass wrote:
>>>>> Hi Josh,
>>>>>
>>>>> On 30 March 2015 at 19:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>>>> Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
>>>>>>
>>>>>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>>>>>> ---
>>>>> This is a quirk of patman that I've grown comfortable with. Still, we
>>>>> should fix it. Thanks for the patch.
>>>>>
>>>>>> tools/patman/patchstream.py | 9 +++++++--
>>>>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
>>>>>> index 8c3a0ec..4bfb1e9 100644
>>>>>> --- a/tools/patman/patchstream.py
>>>>>> +++ b/tools/patman/patchstream.py
>>>>>> @@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
>>>>>> prefix = series.GetPatchPrefix()
>>>>>> for line in lines:
>>>>>> if line.startswith('Subject:'):
>>>>>> - # TODO: if more than 10 patches this should save 00/xx,
>>>>>> not
>>>>>> 0/xx
>>>>>> - line = 'Subject: [%s 0/%d] %s\n' % (prefix, count,
>>>>>> text[0])
>>>>>> + # if more than 10 patches this should save 00/xx, not 0/xx
>>>>> s/save/say/
>>>>>
>>>>> (my typo, I think)
>>>> ;-) I'll fix this.
>>>>>
>>>>>> + zero_repeat = 1
>>>>>> + while (count / (10 ** zero_repeat) > 0):
>>>>>> + zero_repeat = zero_repeat + 1
>>>>> How about:
>>>>>
>>>>> zero_repeat = int(math.log10(count)) + 1
>>>>>
>>>>> ?
>>>> yes, it's better. just need to import the match lib.
>>>> I will change to this and sent v2 patch. Thanks.
>>>>
>>>> BTW: speak of patman, I get an issue of using the "Series-prefix".
>>>>
>>>> When I use Series-prefix like following in the commit:
>>>> Series-prefix: U-Boot][
>>>> Then I get the patman generated patch like:
>>>> [U-Boot][ PATCH]
>>>> ^ a space here.
>>>>
>>>> A space is before the 'PATCH', that annoys me. But I don't see you have
>>>> such
>>>> space in your patches. Any advice to avoid the extra space?
>>>> Thanks in advance.
>>> This is intentional, since if you use a prefix of 'RFC' we want to get
>>> 'RFC PATCH v2' instead of 'RFCPATCH v2'. See GetPatchPrefix().
>> yes, understood.
>>
>>> Why do
>>> you want [U-Boot] anyway? That sounds more like the project than a
>>> patch prefix. Perhaps you could add an option to prepend the project
>>> in square brackets?
>> I tried a the project prefix, and that works for the format-patch command.
>> But it not work for patman.
>>
>> here is my steps:
>> git config format.subjectprefix "U-Boot"
>>
>> Now, when I run git format-patch, the generated patch will have "[U-Boot]"
>> prefix. But if I run "patman -c1 -n", the [U-Boot] prefix is gone.
>> It seems patman overide the format.subjectprefix option of git. Do you have
>> an idea about what is the difference between the run "git format-patch -1"
>> and "patman -c1"?
>> thanks.
> Why do you want [U-Boot] anyway?
I always send the u-boot patch with title like "[U-Boot][PATCH]xxxxx".
Is "[U-Boot]" string not needed?
>
> I suggest you add an option to prepend the patman project name (in
> square brackets) to patches, from the -p option.
hmm, it's better to get the prefix by 'git config format.subjectprefix',
then add this to CreatePatches().
>
> Patman has to set up its own prefix when generating patches. See
> CreatePatches().
okay, I'll try this, if it works nice then I will send a patch out.
Thanks a lot.
Best Regards,
Josh Wu
>
> Regards,
> Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
2015-04-08 2:38 ` Josh Wu
@ 2015-04-08 2:41 ` Simon Glass
0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2015-04-08 2:41 UTC (permalink / raw)
To: u-boot
Hi Josh,
On 7 April 2015 at 20:38, Josh Wu <josh.wu@atmel.com> wrote:
>
> On 4/8/2015 4:49 AM, Simon Glass wrote:
>>
>> Hi Josh,
>>
>> On 6 April 2015 at 20:31, Josh Wu <josh.wu@atmel.com> wrote:
>>>
>>> HI, Simon
>>>
>>> Thanks for the feedback.
>>>
>>>
>>> On 4/6/2015 2:31 AM, Simon Glass wrote:
>>>>
>>>> Hi Josh,
>>>>
>>>> On 31 March 2015 at 20:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>>>
>>>>> Hi, Simon
>>>>>
>>>>> On 4/1/2015 10:04 AM, Simon Glass wrote:
>>>>>>
>>>>>> Hi Josh,
>>>>>>
>>>>>> On 30 March 2015 at 19:54, Josh Wu <josh.wu@atmel.com> wrote:
>>>>>>>
>>>>>>> Make cover letter shows like 0/x, 00/xx and 000/xxx etc.
>>>>>>>
>>>>>>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>>>>>>> ---
>>>>>>
>>>>>> This is a quirk of patman that I've grown comfortable with. Still, we
>>>>>> should fix it. Thanks for the patch.
>>>>>>
>>>>>>> tools/patman/patchstream.py | 9 +++++++--
>>>>>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>>>>>
>>>>>>> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
>>>>>>> index 8c3a0ec..4bfb1e9 100644
>>>>>>> --- a/tools/patman/patchstream.py
>>>>>>> +++ b/tools/patman/patchstream.py
>>>>>>> @@ -468,8 +468,13 @@ def InsertCoverLetter(fname, series, count):
>>>>>>> prefix = series.GetPatchPrefix()
>>>>>>> for line in lines:
>>>>>>> if line.startswith('Subject:'):
>>>>>>> - # TODO: if more than 10 patches this should save 00/xx,
>>>>>>> not
>>>>>>> 0/xx
>>>>>>> - line = 'Subject: [%s 0/%d] %s\n' % (prefix, count,
>>>>>>> text[0])
>>>>>>> + # if more than 10 patches this should save 00/xx, not 0/xx
>>>>>>
>>>>>> s/save/say/
>>>>>>
>>>>>> (my typo, I think)
>>>>>
>>>>> ;-) I'll fix this.
>>>>>>
>>>>>>
>>>>>>> + zero_repeat = 1
>>>>>>> + while (count / (10 ** zero_repeat) > 0):
>>>>>>> + zero_repeat = zero_repeat + 1
>>>>>>
>>>>>> How about:
>>>>>>
>>>>>> zero_repeat = int(math.log10(count)) + 1
>>>>>>
>>>>>> ?
>>>>>
>>>>> yes, it's better. just need to import the match lib.
>>>>> I will change to this and sent v2 patch. Thanks.
>>>>>
>>>>> BTW: speak of patman, I get an issue of using the "Series-prefix".
>>>>>
>>>>> When I use Series-prefix like following in the commit:
>>>>> Series-prefix: U-Boot][
>>>>> Then I get the patman generated patch like:
>>>>> [U-Boot][ PATCH]
>>>>> ^ a space here.
>>>>>
>>>>> A space is before the 'PATCH', that annoys me. But I don't see you have
>>>>> such
>>>>> space in your patches. Any advice to avoid the extra space?
>>>>> Thanks in advance.
>>>>
>>>> This is intentional, since if you use a prefix of 'RFC' we want to get
>>>> 'RFC PATCH v2' instead of 'RFCPATCH v2'. See GetPatchPrefix().
>>>
>>> yes, understood.
>>>
>>>> Why do
>>>> you want [U-Boot] anyway? That sounds more like the project than a
>>>> patch prefix. Perhaps you could add an option to prepend the project
>>>> in square brackets?
>>>
>>> I tried a the project prefix, and that works for the format-patch command.
>>> But it not work for patman.
>>>
>>> here is my steps:
>>> git config format.subjectprefix "U-Boot"
>>>
>>> Now, when I run git format-patch, the generated patch will have "[U-Boot]"
>>> prefix. But if I run "patman -c1 -n", the [U-Boot] prefix is gone.
>>> It seems patman overide the format.subjectprefix option of git. Do you have
>>> an idea about what is the difference between the run "git format-patch -1"
>>> and "patman -c1"?
>>> thanks.
>>
>> Why do you want [U-Boot] anyway?
>
> I always send the u-boot patch with title like "[U-Boot][PATCH]xxxxx".
> Is "[U-Boot]" string not needed?
Nope.
>
>>
>> I suggest you add an option to prepend the patman project name (in
>> square brackets) to patches, from the -p option.
>
> hmm, it's better to get the prefix by 'git config format.subjectprefix', then add this to CreatePatches().
You could certainly do that.
>
>>
>> Patman has to set up its own prefix when generating patches. See
>> CreatePatches().
>
> okay, I'll try this, if it works nice then I will send a patch out.
>
> Thanks a lot.
OK sounds good.
Regards,
Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-04-08 2:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-31 1:54 [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches Josh Wu
2015-04-01 2:04 ` Simon Glass
2015-04-01 2:54 ` Josh Wu
2015-04-05 18:31 ` Simon Glass
2015-04-07 2:31 ` Josh Wu
2015-04-07 20:49 ` Simon Glass
2015-04-08 2:38 ` Josh Wu
2015-04-08 2:41 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox