feat(git-backup): configurable commit signing via git_backup.gpg_sign (#62)#117
Merged
Conversation
…_sign (#62) The auto-backup hook hardcoded --no-gpg-sign to avoid hanging on passphrase prompts during background commits. This silently overrode users with commit.gpgSign=true (e.g. hardware-key setups). Add git_backup.gpg_sign (default false): when true, drop --no-gpg-sign so git honors the user's own signing config. Default behavior unchanged. Tests use a stub gpg.program for deterministic, key-free signing detection. Closes #62 Co-Authored-By: Max <noreply>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the auto-backup hook's hardcoded
--no-gpg-signconfigurable via a newgit_backup.gpg_signkey (defaultfalse).Why
hooks.d/after_save/50-git-backup.shpassed--no-gpg-signto avoid hanging on passphrase prompts during background commits. This silently overrode users withcommit.gpgSign = true(e.g. hardware-key setups).How
git_backup.gpg_signdefaultfalse→--no-gpg-sign(unchanged, safe default).true→ drop the flag so git honors the user's owncommit.gpgSign."true"gate asallow_remote_change.Tests
TestGitBackupGpgSign— positive + negative, deterministic via a stubgpg.program(no real key, no network). 17 passed, 1 skipped locally.Note
GIT_TERMINAL_PROMPT=0guards push, not commit — a user who opts in with an interactive key could still block the background subshell. Documented in the README ("only with non-interactive signing").Closes #62