chiark / gitweb /
Split brain: Break out $git_authline_re
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 19 Nov 2015 01:10:23 +0000 (01:10 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jul 2016 15:47:47 +0000 (16:47 +0100)
This will make it a bit easier to reuse it.  Actually AFAICT it turns
out (looking at the rest of the branch) that this is not needed, but
it's nicer for the future I think.

dgit

diff --git a/dgit b/dgit
index 7b9aa52d2e39453924f6d2df84a90554e912e7f2..e30a7889fa014710e8436af7e0d0bddaa9f60702 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -70,6 +70,8 @@ our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
 our $suite_re = '[-+.0-9a-z]+';
 our $cleanmode_re = 'dpkg-source(?:-d)?|git|git-ff|check|none';
 
+our $git_authline_re = '^([^<>]+) \<(\S+)\> (\d+ [-+]\d+)$';
+
 our (@git) = qw(git);
 our (@dget) = qw(dget);
 our (@curl) = qw(curl -f);
@@ -1316,7 +1318,7 @@ sub clogp_authline ($) {
     $author =~ s#,.*##ms;
     my $date = cmdoutput qw(date), '+%s %z', qw(-d), getfield($clogp,'Date');
     my $authline = "$author $date";
-    $authline =~ m/^[^<>]+ \<\S+\> \d+ [-+]\d+$/ or
+    $authline =~ m/$git_authline_re/o or
        fail "unexpected commit author line format \`$authline'".
        " (was generated from changelog Maintainer field)";
     return $authline;