Skip to content

feat(git-backup): configurable commit signing via git_backup.gpg_sign (#62)#117

Merged
fdaviddpt merged 1 commit into
mainfrom
feat/configurable-gpg-sign-62
Jun 23, 2026
Merged

feat(git-backup): configurable commit signing via git_backup.gpg_sign (#62)#117
fdaviddpt merged 1 commit into
mainfrom
feat/configurable-gpg-sign-62

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

What

Makes the auto-backup hook's hardcoded --no-gpg-sign configurable via a new git_backup.gpg_sign key (default false).

Why

hooks.d/after_save/50-git-backup.sh passed --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).

How

  • git_backup.gpg_sign default false--no-gpg-sign (unchanged, safe default).
  • true → drop the flag so git honors the user's own commit.gpgSign.
  • Empty flag (unquoted) expands to zero args; same string-"true" gate as allow_remote_change.

Tests

TestGitBackupGpgSign — positive + negative, deterministic via a stub gpg.program (no real key, no network). 17 passed, 1 skipped locally.

Note

GIT_TERMINAL_PROMPT=0 guards 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

…_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>
@fdaviddpt fdaviddpt merged commit 1a49542 into main Jun 23, 2026
12 checks passed
@fdaviddpt fdaviddpt deleted the feat/configurable-gpg-sign-62 branch June 23, 2026 08:22
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.

Make --no-gpg-sign in git backup hook configurable

1 participant