I've formatted a patch for upstream that fixes this behaviour. See file
attached
From 42582015feef85b760932c05e802e2f65418a19c Mon Sep 17 00:00:00 2001
From: Gabriel Filion <[email protected]>
Date: Sat, 23 Feb 2019 20:03:41 -0500
Subject: [PATCH] Disable PGP signatures when retrieving list of commits

gbp dch errors out with the following output if the "log.showSignature"
git config is enabled:

$ gbp dch --verbose
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/master']
gbp:debug: ['git', 'tag', '-l', 'debian/2.7.3-2']
gbp:debug: ['git', 'tag', '-l', 'debian/2.7.3-2']
gbp:debug: ['git', 'log', '--pretty=format:%H', '-1', '--', 'debian/changelog']
gbp:info: Changelog last touched at 'gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST'
gbp:debug: ['git', 'log', '--pretty=format:%H', 'gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST..HEAD', '--no-merges', '--']
fatal: bad revision 'gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST..HEAD'
gbp:error: Error getting commits gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST..HEAD

This is caused by gbp dch receiving unexpected output for the PGP
signatures and trying to use this unexpected output.

To avoid any surprises, let's disable signatures being output when we
list commits.

Also, when collecting a shortlog-like output from commit objects, the
same unexpected PGP signature output is sprayed all over the changelog.
We'll avoid this by also disable showing signatures when showing each
commit's first line.
---
 gbp/git/repository.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index a44c71e1..dfc8e556 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1613,7 +1613,7 @@ class GitRepository(object):
                              merge commit
         @type first_parent: C{bool}
         """
-        args = GitArgs('--pretty=format:%H')
+        args = GitArgs('--pretty=format:%H', '--no-show-signature')
         args.add_true(num, '-%d' % num)
         args.add_true(first_parent, '--first-parent')
         if since:
@@ -1694,7 +1694,7 @@ class GitRepository(object):
         commit_sha1 = self.rev_parse("%s^0" % commitish)
         args = GitArgs('--pretty=format:%an%x00%ae%x00%ad%x00%cn%x00%ce%x00%cd%x00%s%x00%f%x00%b%x00',
                        '-z', '--date=raw', '--no-renames', '--name-status',
-                       commit_sha1)
+                       '--no-show-signature', commit_sha1)
         out, err, ret = self._git_inout('show', args.args)
         if ret:
             raise GitRepositoryError("Unable to retrieve commit info for %s"
-- 
2.20.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to