Reasons to Sign Your Repository¶
Breezy can sign revisions using GnuPG, a Free Software implementation of the OpenPGP digital signature format. By signing commits a person wanting to make use of a branch can be confident where the code came from, assuming the GnuPG keys used can be verified. This could for example prevent worry about compromised code in the case where a server hosting Breezy branches has been hacked into. It could also be used to verify that all code is written by a select group of people, such as if contributor agreements are needed.
Signatures are passed around with commits during branch, push, merge and other operations.
Setting up GnuPG¶
To sign commits as they are made turn on the
configuration option in your
create_signatures = always
When you next make a commit it will ask for the pass phrase for your GnuPG key.
If you want GnuPG to remember your password ensure you have
To sign previous commits to a branch use
sign-my-commits. This will go
through all revisions in the branch and sign any which match your
commit name. You can also pass the name of a contributor to
to sign someone else’s commits or if your GnuPG key does not match your Breezy
name and e-mail:
brz sign-my-commits . "Amy Pond <firstname.lastname@example.org>"
It will not sign commits which already have a signature.
To sign a single commit or a range of commits use the (hidden) command
brz re-sign -r 24
re-sign is also useful to change an existing signature.
By default Breezy will tell GnuPG to use a key with the same user
identity as the one set with
whoami. To override this set
gpg_signing_key in breezy.conf or locations.conf.
Signatures can be verified with the
brz verify-signatures command. By
default this will check all commits in the branch and notify that all commits
are signed by known trusted signatures. If not all commits have trusted
signatures it will give a summary of the number of commits which are invalid,
having missing keys or are not signed.
verify-signatures command can be given a comma separated list of key
patters to specify a list of acceptable keys. It can also take a range of
commits to verify in the current branch. Finally using the verbose option will
list each key that is valid or authors for commits which failed:
$brz verify-signatures -kamy -v -r 1..5 1 commit with valid signature Amy Pond <email@example.com> signed 4 commits 0 commits with unknown keys 1 commit not valid 1 commit by author The Doctor <firstname.lastname@example.org> 0 commits not signed
Work in Progress¶
There is still a number of digital signature related features which are hoped to be added to Breezy soon. These include brz explorer integration and setting branches to require signatures.