Skip to content

fix(git): inherit stdin for commit and push to preserve SSH signing (#733)#982

Merged
aeppling merged 1 commit intodevelopfrom
fix/git-commit-ssh-signing
Apr 3, 2026
Merged

fix(git): inherit stdin for commit and push to preserve SSH signing (#733)#982
aeppling merged 1 commit intodevelopfrom
fix/git-commit-ssh-signing

Conversation

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Summary

  • Add stdin(Stdio::inherit()) to git commit and git push subprocess commands
  • Preserves SSH signing, GPG signing, and any tool that needs TTY access

Problem

Command::output() defaults to Stdio::piped() for stdin, creating an empty pipe. SSH signing tools (1Password SSH agent, YubiKey, gpg-agent with pinentry) need the parent's stdin (TTY) for passphrase prompts. Without it, signatures are silently dropped — commits succeed but the gpgsig header is missing. This breaks repos with branch protection requiring verified signatures.

Fix

2 lines: .stdin(Stdio::inherit()) on both git commit and git push commands. stdout/stderr capture still works (only stdin inheritance changes).

Fixes #733

Test plan

  • cargo fmt --all — clean
  • cargo clippy --all-targets — no new warnings
  • cargo test git — 175 tests passed
  • Manual test: rtk git commit -m "test" works correctly

…733)

Command::output() sets stdin to Stdio::piped() by default, creating an
empty pipe instead of inheriting the terminal. SSH signing tools
(1Password, YubiKey, gpg-agent with pinentry) need TTY access on stdin
for passphrase prompts or agent communication. This caused signatures
to be silently dropped — commits succeeded but without gpgsig headers.

Fix: add .stdin(Stdio::inherit()) to git commit and git push commands
so they inherit the parent's stdin (terminal or hook pipe). Output
capture via stdout/stderr pipes is preserved.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
@aeppling
Copy link
Copy Markdown
Contributor

aeppling commented Apr 3, 2026

go

@aeppling aeppling merged commit eefeae4 into develop Apr 3, 2026
10 of 11 checks passed
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.

2 participants