public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Josh Wu <josh.wu@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [ PATCH] patman: cover letter shows like 00/xx if more than 10 patches
Date: Wed, 1 Apr 2015 10:54:43 +0800	[thread overview]
Message-ID: <551B5DF3.1050303@atmel.com> (raw)
In-Reply-To: <CAPnjgZ3RANFwkDa=yo8VYWx+bRbhT7Aaj24J5ZurQXU_tu8okQ@mail.gmail.com>

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

  reply	other threads:[~2015-04-01  2:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551B5DF3.1050303@atmel.com \
    --to=josh.wu@atmel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox