Skip to content

Adding gitaly-gpg binary for gpg signing

John Cai requested to merge jc/gitaly-gpg into master

!4479 (merged) implemented merging without git2go with git-merge-tree(1). This implementation used git-commit-tree(1) to create the actual merge commit. However, the problem was that gpg signing was done manually within the git2go code. Git itself does not support this since it shells out to gpg, which doesn't support passing in the filepath of the key. It only supports retrieving keys from the gpg database.

Once we removed the feature flag, we broke signing.

In order to continue to support signing, we can use Git's gpg.program config option to provide our own binary. When gpg(1) is passed an argument, it is interpreted as the key_id. However, we can customize our own binary to interpret the keyid that gets passed in through the --gpg-sign=<keyid> in git-commit-tree as the path to the key.

Here is the code in Git that passes in --status-fd=2 and -bsau, and a signing_key.

A separate MR will wire up this binary to use with creating commits.

part of: #5335 (closed)

Edited by John Cai

Merge request reports