Repository navigation
fix(doctor): expand a leading tilde in user.signingkey before the readability test - #1551
Merged
Merged
Conversation
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.
Description
just doctorreportedWARN commit signing: incompletefor a correctlyconfigured SSH-signing host whenever
user.signingkeyis a tilde path(
~/.ssh/<key>.pub). The readability guard usedtest -r "$signingkey", andtest -rperforms no tilde expansion — the shell expands~only as anunquoted literal at the start of a word, never the contents of a variable — so
the check tested a relative path literally named
~and always failed. Gititself does expand
~when it consumesuser.signingkey, so signing worked;only the diagnostic was wrong. A false negative from the recipe whose job is to
rule that failure mode out.
Type of Change
fix-- Bug fixModifiers
!)Changes Made
~/against$HOMEinto a separatekeypathvariablebefore the
-rtest, in both copies of the guard: devkit's ownjustfileand the scaffoldedassets/workspace/justfile(which must stay insync —
consumer doctor checks exactly what devkit's doctor checkspinsthat).
PASSline keeps echoing the raw$signingkey, so the output stillmirrors
git configrather than a rewritten path.~/is expanded;~user/...is left alone, and an inlinessh-...key value still takes the existing literal-key branch.Changelog Entry
Testing
TDD, RED confirmed before the fix. Four new bats tests (two per copy of the
recipe), each driving a pinned
HOMEandGIT_CONFIG_GLOBALso host statecannot leak in:
doctor reports PASS for a tilde signing key path/ consumer twin — theregression itself. Both failed on the pre-fix recipe with
WARN commit signing: incomplete (... user.signingkey=~/key.pub).doctor warns when a tilde signing key path does not exist/ consumer twin —pins that expansion does not turn the guard into a rubber stamp: a tilde path
to a missing file must still WARN.
Manual Testing Details
Reproduced on the reporting host (NixOS,
direnvmode, realuser.signingkey=~/.ssh/github.pub):Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Consumers pick this up with their next scaffold/upgrade, since the fix is in the
managed root
justfile(the layer that is regenerated on upgrade), not in thepreserved
justfile.project.Refs: #1546