Merge lp:~jelmer/brz/local-git-key into lp:brz/3.1

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7501
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/local-git-key
Merge into: lp:brz/3.1
Prerequisite: lp:~jelmer/brz/local-git-email
Diff against target: 52 lines (+19/-1)
3 files modified
breezy/git/config.py (+6/-0)
breezy/git/tests/test_blackbox.py (+12/-0)
doc/en/release-notes/brz-3.1.txt (+1/-1)
To merge this branch: bzr merge lp:~jelmer/brz/local-git-key
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+381000@code.launchpad.net

Commit message

Support user.signingkey configuration variable in .git/config.

Description of the change

Support user.signingkey configuration variable in .git/config.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/config.py'
2--- breezy/git/config.py 2020-03-21 21:01:54 +0000
3+++ breezy/git/config.py 2020-03-21 21:01:54 +0000
4@@ -69,6 +69,12 @@
5 except KeyError:
6 return email.decode()
7 return '%s <%s>' % (name.decode(), email.decode())
8+ if name == 'gpg_signing_key':
9+ try:
10+ key = self._config.get((b'user', ), b'signingkey')
11+ except KeyError:
12+ return None
13+ return key.decode()
14 return None
15
16
17
18=== modified file 'breezy/git/tests/test_blackbox.py'
19--- breezy/git/tests/test_blackbox.py 2020-03-21 21:01:54 +0000
20+++ breezy/git/tests/test_blackbox.py 2020-03-21 21:01:54 +0000
21@@ -445,6 +445,18 @@
22 self.assertEqual(out, "some@example.com\n")
23 self.assertEqual(err, "")
24
25+ def test_local_signing_key(self):
26+ r = GitRepo.init("gitr", mkdir=True)
27+ self.build_tree_contents([('gitr/.git/config', """\
28+[user]
29+ email = some@example.com
30+ name = Test User
31+ signingkey = D729A457
32+""")])
33+ out, err = self.run_bzr(["config", "-d", "gitr", "gpg_signing_key"])
34+ self.assertEqual(out, "D729A457\n")
35+ self.assertEqual(err, "")
36+
37
38 class ShallowTests(ExternalBase):
39
40
41=== modified file 'doc/en/release-notes/brz-3.1.txt'
42--- doc/en/release-notes/brz-3.1.txt 2020-03-21 21:01:54 +0000
43+++ doc/en/release-notes/brz-3.1.txt 2020-03-21 21:01:54 +0000
44@@ -115,7 +115,7 @@
45 (Jelmer Vernooij)
46
47 * ``.git/config`` is now consulted to determine the users' identity
48- for commits. (Jelmer Vernooij)
49+ for commits, and the gpg_signing_key. (Jelmer Vernooij)
50
51 Bug Fixes
52 *********

Subscribers

People subscribed via source and target branches