Repository navigation
feat: offer git-profile pairing on add and use - #9
Merged
Merged
Conversation
When the companion git-profile binary is installed, `git-ssh add <name>` and `git-ssh use <name>` now ask whether to hand off to git-profile so the same profile name carries both the SSH identity and the git identity. The pairing is best-effort and keeps the two tools fully separate: - detection is exec.LookPath only, no config coupling - `add` hands off to interactive `git-profile add` (stdin/stdout passthrough) - `use` runs `git-profile use <name>` in the current repo - the prompt only fires on an interactive terminal; a decline or a git-profile failure never fails the git-ssh command Adds internal/gitprofile with an injectable Runner (default Linker, Skip for tests/CI), ui.Confirm, and TTY-gated offers wired into add and use. Signed-off-by: kuyacarlo <106532351+kuyacarlo@users.noreply.github.com>
kuyacarlo
force-pushed
the
feat/git-profile-pairing
branch
from
August 15, 2026 23:57
ea58456 to
7802dc5
Compare
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.
Closes #8
What
When the companion
git-profilebinary is installed and the command runs on aninteractive terminal,
git-ssh add <name>andgit-ssh use <name>now askwhether to hand off to git-profile so the same profile name carries both
identities.
add→ interactivegit-profile add(stdin/stdout passthrough; fills identityfields for the same-named profile). git-profile's add-on-existing-profile
behavior is accepted as intended.
use→git-profile use <name>in the current repo.git-ssh command. Prompt is TTY-gated, so scripts/CI never see it.
Design
internal/gitprofile:Runnerinterface (Available,RunAdd,RunUse),default
Linker(exec-based),Skipfor tests/CI. No coupling togit-profile's config format.
ui.Confirm: huh-based yes/no prompt.add(both forms) anduse; terminal check + confirm +runner are all injectable on
Rootfor testability.Verification
go test ./... -count=1— all packages ok (incl. new gitprofile + cmd wiringtests).
go vet ./...— clean.(beeabdf); none introduced by this change.
git-ssh add <name> </dev/null(non-terminal) saves profile withno prompt; TTY prompt covered by injected tests.
Red/green: this is net-new behavior; the new tests exercise the added paths.