chiark / gitweb /
Test suite: quilt: Test that our patch makes it through dgit and gbp pq
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Oct 2016 00:13:41 +0000 (01:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Oct 2016 00:01:10 +0000 (01:01 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/quilt

index a6f78cd70812fc1d2f9599bf0411344aa6f2e921..4988b2b917ea871e6e436a5257c4dfe288d27351 100755 (executable)
@@ -52,4 +52,45 @@ done
 t-822-field ../${p}_${v}_*.changes Changes |
  grep -Fx 'ruby-rails-3.2 (3.2.6-2~dummy1) unstable; urgency=low'
 
+t-git-next-date
+
+# Now we are going to check that our dgit-generated patches round
+# trip to similar git commits when imported by gbp pq:
+
+git clean -xdf
+
+# We need to make a patches-unapplied version
+unpa=$(git-log --pretty=format:'%H' --grep '^\[dgit import unpatched')
+git checkout -b for-gbp
+git reset "$unpa" .
+git reset HEAD debian
+git commit -m UNAPPY
+git reset --hard
+git clean -xdf
+
+export GIT_AUTHOR_NAME='Someone Else'
+export GIT_AUTHOR_EMAIL='else@example.com'
+export GIT_COMMITTER_NAME='Someone Else'
+export GIT_COMMITTER_EMAIL='else@example.com'
+
+gbp pq import
+
+for compare in $(git log --pretty='format:%H' \
+       --grep 'Change something in the upstream yml')
+do
+       git cat-file commit $compare >../this.cmp
+       # normalise
+       perl -i~$compare~ -0777 -pe '
+               s/\n+$//; $_ .= "\n";
+               s/^(?:committer|parent|tree) .*\n//gm;
+               s/\n+(\(cherry picked from .*\)\n)\n*/\n\n/m
+                       and s/$/$1/;
+               s/\n+$//; $_ .= "\n";
+       ' ../this.cmp
+       if test -f ../last.cmp; then
+               diff -u ../last.cmp ../this.cmp
+       fi
+       mv ../this.cmp ../last.cmp
+done
+
 echo ok.