chiark / gitweb /
dgit: Use GIT_COMMITTER_DATE for automatic patch
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Aug 2016 17:37:59 +0000 (18:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Aug 2016 17:40:07 +0000 (18:40 +0100)
When automatically generating quilt patch, honour GIT_COMMITTER_DATE
for filename creation (makes filename deterministic in test suite).

debian/changelog
dgit

index ce449c7e4b8b47f792202b4f1b0fe7a86961007a..ee5f7d0b5b56748199a6ae383f22ecac7e685669 100644 (file)
@@ -24,6 +24,8 @@ dgit (1.5~~) unstable; urgency=medium
     we rely on --rm-old-changes, or failing that, fail early.
   * When doing quilt linearisation, treat upstream .gitignores not
     in the toplevel the same way we treat ones in the toplevel.
     we rely on --rm-old-changes, or failing that, fail early.
   * When doing quilt linearisation, treat upstream .gitignores not
     in the toplevel the same way we treat ones in the toplevel.
+  * When automatically generating quilt patch, honour GIT_COMMITTER_DATE
+    for filename creation (makes filename deterministic in test suite).
 
   Infrastructure:
   * Better error handling in dgit-repos-policy-debian.
 
   Infrastructure:
   * Better error handling in dgit-repos-policy-debian.
diff --git a/dgit b/dgit
index 352e5b16c21b7b0db4b13fefd3d383db5f214e43..bf0d6398431340e1ff53feea1e478e472f75bb39 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2880,7 +2880,8 @@ sub quiltify ($$$$) {
            die "$quilt_mode ?";
        }
 
            die "$quilt_mode ?";
        }
 
-       my $time = time;
+       my $time = $ENV{'GIT_COMMITTER_DATE'} || time;
+       $time =~ s/\s.*//; # trim timezone from GIT_COMMITTER_DATE
        my $ncommits = 3;
        my $msg = cmdoutput @git, qw(log), "-n$ncommits";
 
        my $ncommits = 3;
        my $msg = cmdoutput @git, qw(log), "-n$ncommits";