fix(git): inherit stdin for commit and push to preserve SSH signing (#733)#982
Merged
fix(git): inherit stdin for commit and push to preserve SSH signing (#733)#982
Conversation
…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
approved these changes
Apr 3, 2026
Contributor
|
go |
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.
Summary
stdin(Stdio::inherit())togit commitandgit pushsubprocess commandsProblem
Command::output()defaults toStdio::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 bothgit commitandgit pushcommands. stdout/stderr capture still works (only stdin inheritance changes).Fixes #733
Test plan
cargo fmt --all— cleancargo clippy --all-targets— no new warningscargo test git— 175 tests passedrtk git commit -m "test"works correctly