Patchwork Account for mail client line wrapping in pull requests

login
register
mail settings
Submitter Dirk Wallenstein
Date Jan. 17, 2011, 10:40 a.m.
Message ID <1295260843-19477-1-git-send-email-halsmit@t-online.de>
Download mbox | patch
Permalink /patch/79138/
State Accepted
Headers show

Comments

Dirk Wallenstein - Jan. 17, 2011, 10:40 a.m.
If a mail client wraps the line with the sha, there won't necessarily be
a space after 'commit'.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
---
An example is here:
http://lists.freedesktop.org/archives/xorg-devel/2010-November/014836.html

 apps/patchwork/bin/parsemail.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jeremy Kerr - Feb. 11, 2011, 1:54 a.m.
Hi Dirk,

> If a mail client wraps the line with the sha, there won't necessarily be
> a space after 'commit'.

Good idea, applied.

I've also committed a testcase for this.

Cheers,


Jeremy

Patch

diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py
index 0a9daf5..1b73169 100755
--- a/apps/patchwork/bin/parsemail.py
+++ b/apps/patchwork/bin/parsemail.py
@@ -136,7 +136,7 @@  def mail_headers(mail):
                 for (k, v) in mail.items()])
 
 def find_pull_request(content):
-    git_re = re.compile('^The following changes since commit .*' +
+    git_re = re.compile('^The following changes since commit.*' +
                         '^are available in the git repository at:\n'
                         '^\s*(git://[^\n]+)$',
                            re.DOTALL | re.MULTILINE)