]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Handle pull requests with random trailing space
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>
Mon, 27 Jan 2020 17:56:19 +0000 (12:56 -0500)
committerStephen Finucane <stephen@that.guru>
Sat, 1 Feb 2020 14:09:44 +0000 (14:09 +0000)
Another fix for copy-pasted pull requests, this time for cases
when something is copy-pasted from a terminal and retains all
the bogus trailing whitespace.

Example:
https://lore.kernel.org/r/043eb5b2-a302-4de6-a3e8-8238e49483b1@ti.com

Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 1633afe5b46042d522777f66b1959a82298d0ab2)

patchwork/parser.py
patchwork/tests/mail/0024-git-pull-request-trailing-space.mbox [new file with mode: 0644]
patchwork/tests/test_parser.py

index 889a3721e0b0752e11ea58260ae6c993c94dadd9..705c0a07fef9d3e69feb5c33dfa1171dd7be6fc3 100644 (file)
@@ -892,7 +892,7 @@ def parse_patch(content):
 def parse_pull_request(content):
     git_re = re.compile(
         r'^The following changes since commit.*'
-        r'^are available in the git repository at:\n'
+        r'^are available in the git repository at:\s*\n'
         r'^\s*([\w+-]+(?:://|@)[\w/.@:~-]+[\s\\]*[\w/._-]*)\s*$',
         re.DOTALL | re.MULTILINE | re.IGNORECASE)
     match = git_re.search(content)
diff --git a/patchwork/tests/mail/0024-git-pull-request-trailing-space.mbox b/patchwork/tests/mail/0024-git-pull-request-trailing-space.mbox
new file mode 100644 (file)
index 0000000..d62d070
--- /dev/null
@@ -0,0 +1,60 @@
+From mboxrd@z Thu Jan  1 00:00:00 1970
+To: Linux ARM Kernel List <linux-arm-kernel@lists.infradead.org>
+From: XXX XXX <xxx@example.com>
+Subject: [GIT PULL] DaVinci SoC updates for v5.6
+Message-ID: <043eb5b2-a302-4de6-a3e8-8238e49483b1@ti.com>
+Date: Tue, 14 Jan 2020 23:48:54 +0530
+Content-Type: text/plain; charset="us-ascii"
+Content-Transfer-Encoding: 7bit
+
+The following changes since commit e42617b825f8073569da76dc4510bfa019b1c35a:    
+                                                                                
+  Linux 5.5-rc1 (2019-12-08 14:57:55 -0800)                                     
+                                                                                
+are available in the Git repository at:                                         
+                                                                                
+  git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git tags/davinci-for-v5.6/soc
+                                                                                
+for you to fetch changes up to 5e06d19694a463a012c2589e29078196eb209448:        
+                                                                                
+  ARM: davinci: dm644x-evm: Add Fixed regulators needed for tlv320aic33 (2020-01-13 17:36:26 +0530)
+                                                                                
+----------------------------------------------------------------                
+DaVinci SoC updates for v5.6 include migrating DM365 SoC to use                 
+drivers/clocksource based driver for timer. This leads to removal               
+of machine specific timer driver.                                               
+                                                                                
+There are two patches adding missing fixed regulators for audio codecs          
+on DM365 and DM644x EVMs.                                                       
+                                                                                
+----------------------------------------------------------------                
+Bartosz Golaszewski (3):                                                        
+      clocksource: davinci: only enable clockevents once tim34 is initialized   
+      ARM: davinci: dm365: switch to using the clocksource driver               
+      ARM: davinci: remove legacy timer support                                 
+                                                                                
+Peter Ujfalusi (2):                                                             
+      ARM: davinci: dm365-evm: Add Fixed regulators needed for tlv320aic3101    
+      ARM: davinci: dm644x-evm: Add Fixed regulators needed for tlv320aic33     
+                                                                                
+ arch/arm/mach-davinci/Makefile              |   3 +-                           
+ arch/arm/mach-davinci/board-dm365-evm.c     |  20 ++                           
+ arch/arm/mach-davinci/board-dm644x-evm.c    |  20 ++                           
+ arch/arm/mach-davinci/devices-da8xx.c       |   1 -                            
+ arch/arm/mach-davinci/devices.c             |  19 --                           
+ arch/arm/mach-davinci/dm365.c               |  22 +-                           
+ arch/arm/mach-davinci/include/mach/common.h |  17 --                           
+ arch/arm/mach-davinci/include/mach/time.h   |  33 ---                          
+ arch/arm/mach-davinci/time.c                | 400 ---------------------------- 
+ drivers/clocksource/timer-davinci.c         |   8 +-                           
+ 10 files changed, 60 insertions(+), 483 deletions(-)                           
+ delete mode 100644 arch/arm/mach-davinci/include/mach/time.h                   
+ delete mode 100644 arch/arm/mach-davinci/time.c                                
+~                                                                                                                                                                                                         
+~                                                                                           
+
+_______________________________________________
+linux-arm-kernel mailing list
+linux-arm-kernel@lists.infradead.org
+http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
+
index 19e391dfa0ee950a292f5eec3d404061cd71e92b..216ab48137c28042fb7e2c01c42538e60ff1163e 100644 (file)
@@ -592,6 +592,15 @@ class PatchParseTest(PatchTest):
             'linux.git/ tags/v5.4-next-soc',
             pull_url)
 
+    def test_git_pull_trailing_space(self):
+        diff, message = self._find_content(
+            '0024-git-pull-request-trailing-space.mbox')
+        pull_url = parse_pull_request(message)
+        self.assertEqual(
+            'git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/'
+            'linux-davinci.git tags/davinci-for-v5.6/soc',
+            pull_url)
+
     def test_git_rename(self):
         diff, _ = self._find_content('0008-git-rename.mbox')
         self.assertTrue(diff is not None)