[U-Boot,2/8] patman: Don't look for tags inside quotes

Submitted by Simon Glass on March 21, 2013, 2:42 a.m.

Details

Message ID 1363833781-14557-3-git-send-email-sjg@chromium.org
State Superseded, archived
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass March 21, 2013, 2:42 a.m.
At present something like:

   Revert "arm: Add cache operations"

will try to use

   Revert "arm

as a tag. Clearly this is wrong, so fix it.

If the revert is intended to be tagged, then the tag can come before
the revert, perhaps. Alternatively the 'Cc' tag can be used in the commit
messages.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 tools/patman/commit.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Doug Anderson March 21, 2013, 4:50 p.m.
Simon,

On Wed, Mar 20, 2013 at 7:42 PM, Simon Glass <sjg@chromium.org> wrote:
>  # Separates a tag: at the beginning of the subject from the rest of it
> -re_subject_tag = re.compile('([^:]*):\s*(.*)')
> +re_subject_tag = re.compile('([^:"]*):\s*(.*)')

I'd go further and prevent all spaces.
  re_subject_tag = re.compile('([^:\s]*):\s*(.*)')

I ran into a similar problem with my patch I sent up earlier:

  patman: Add Cover-letter-cc: tag to Cc cover letter to people

I "fixed" that by removing the extra colon, but that was sorta lame.
We shouldn't have tags with spaces in them anyway...

  patman: Add Cover-letter-cc tag to Cc cover letter to people


-Doug
Simon Glass March 26, 2013, 10:14 p.m.
Hi Doug,

On Thu, Mar 21, 2013 at 9:50 AM, Doug Anderson <dianders@chromium.org> wrote:
> Simon,
>
> On Wed, Mar 20, 2013 at 7:42 PM, Simon Glass <sjg@chromium.org> wrote:
>>  # Separates a tag: at the beginning of the subject from the rest of it
>> -re_subject_tag = re.compile('([^:]*):\s*(.*)')
>> +re_subject_tag = re.compile('([^:"]*):\s*(.*)')
>
> I'd go further and prevent all spaces.
>   re_subject_tag = re.compile('([^:\s]*):\s*(.*)')
>
> I ran into a similar problem with my patch I sent up earlier:
>
>   patman: Add Cover-letter-cc: tag to Cc cover letter to people
>
> I "fixed" that by removing the extra colon, but that was sorta lame.
> We shouldn't have tags with spaces in them anyway...
>
>   patman: Add Cover-letter-cc tag to Cc cover letter to people

Yes - will update this, thanks.

Regards,
Simon

Patch hide | download patch | download mbox

diff --git a/tools/patman/commit.py b/tools/patman/commit.py
index 7144e54..64baf52 100644
--- a/tools/patman/commit.py
+++ b/tools/patman/commit.py
@@ -22,7 +22,7 @@ 
 import re
 
 # Separates a tag: at the beginning of the subject from the rest of it
-re_subject_tag = re.compile('([^:]*):\s*(.*)')
+re_subject_tag = re.compile('([^:"]*):\s*(.*)')
 
 class Commit:
     """Holds information about a single commit/patch in the series.