Skip to content

Add SSH commit signing for HEAD commits#1

Closed
kausters wants to merge 8 commits into
masterfrom
verfied-commits
Closed

Add SSH commit signing for HEAD commits#1
kausters wants to merge 8 commits into
masterfrom
verfied-commits

Conversation

@kausters

@kausters kausters commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds SSH commit signing support for GitUpKit user-facing HEAD commit flows. Repositories configured like the Git CLI with commit.gpgsign=true and gpg.format=ssh now create commits with a gpgsig SSH signature for normal commits, merge commits, amend, and conflict-resolution commits.

The change intentionally supports SSH signing for now. Non-SSH signing formats, including OpenPGP and X.509, continue to produce unsigned GitUp commits rather than blocking existing workflows. History replay/reorder paths also remain unsigned; signing those GitUp-created rewrite commits can be considered separately from signing commits users make directly.

What changed

  • Adds a private GCCommitSigning.m helper that creates the unsigned commit buffer, signs it with SSH, and writes the signed object through libgit2.
  • Resolves SSH signing config from user.signingkey, inline SSH public keys, and gpg.ssh.defaultKeyCommand.
  • Uses gpg.ssh.program or ssh-keygen, launched with GitUp login-shell PATH handling so GUI-launched GitUp can find shell-installed signers.
  • Routes user-facing HEAD commit creation through the signing-aware helper while leaving replay/rewrite helpers unchanged.
  • Adds focused signing tests plus HEAD integration coverage for signed normal, merge, and amended commits.

Tests

  • Focused GitUpKit signing and HEAD integration tests pass.
  • Test coverage includes unsigned behavior when signing is disabled, unsigned behavior for unsupported non-SSH formats, missing key errors, inline key and default key command resolution, key path signing, signer failure, and Git CLI verify-commit verification with an allowed signers file.

Notes

I AGREE TO THE GITUP CONTRIBUTOR LICENSE AGREEMENT

@kausters kausters force-pushed the verfied-commits branch 3 times, most recently from 681af1e to 868a5e8 Compare June 14, 2026 18:36
@kausters kausters closed this Jun 14, 2026
@kausters kausters deleted the verfied-commits branch June 14, 2026 19:10
@kausters

Copy link
Copy Markdown
Owner Author

Moved to #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant