From: Gabriel Filion Date: Sun, 24 Feb 2019 01:03:41 +0000 (-0500) Subject: Disable PGP signatures when retrieving list of commits X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34b9da1de902be0f4e43fd99d0fcb7e278bedbd9;p=tools%2Fgit-buildpackage.git 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. Closes: #923087 --- 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"