Repository navigation
fix(dg): say git-remote-dash is missing before clone or publish runs git - #696
Conversation
Without the helper on PATH, `dg repo clone` passed on git's "'remote-dash' is not a git
command" under a generic E101 ("fix what the clone reported"), and `dg init` / `dg repo create
--push` created the repository on Platform before the push failed the same way. Both now stop
first with E206, naming git-remote-dash and how to install it; `dg doctor` already checked it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Verdict: approve
Windows .exe is handled. helper_installed (crates/dg/src/repo.rs:987) looks for git-remote-dash{EXE_SUFFIX} with is_file(), which follows symlinks. That is git-remote-dash.exe on Windows, the name the release ships. split_paths handles ;, and the forward-slash output of Git for Windows' --exec-path joins fine as a PathBuf.
A helper found only through exec-path is not refused. git --exec-path (:992) runs with the inherited environment, so it reports GIT_EXEC_PATH when that is set. Verified on a sandbox: with PATH=/usr/bin:/bin and a stub git-remote-dash only in a GIT_EXEC_PATH copy, dg repo clone passed the check and git ran the stub. With no helper anywhere, it stopped with the E206 shown in the PR body, and no project/ directory was created.
It runs before any passphrase prompt or spend. In plan() the check (publish.rs:635) comes right after the v2 check and before load_bridge, connect, choose_storage (the interactive storage setup), confirm_plan and connect_with_identity, which is where a sealed key is unlocked. It only fires for Flow::CreatePush/Init, so plain dg repo create is not affected. In clone() (repo.rs:115) it runs after the cheap usage checks and before Report::new or git, and clone never unlocks a key.
Docs. docs/errors.md:138 sits under E206, names all three commands, and quotes git's own message. It points to INSTALL.md and dg doctor, matching the helper_missing cause and fix lines.
Tests. The new integration test passes. With the clone() check removed, it fails with git's 'remote-dash' is not a git command and the generic E101. All 608 dg bin unit tests pass. CI is green except playwright (read-only, testnet), which was still pending and is unrelated.
Non-blocking:
- Both the E206 text and
docs/errors.md:138say "dg doctorchecks it", but doctor only triesgit-remote-dashon PATH (doctor.rs:427). A helper in exec-path alone passes this new check but fails in doctor. That predates this PR; a follow-up could make doctor usehelper_installed(). - When git itself is missing and the helper isn't on PATH, the user now gets E206 "helper missing" rather than a "git not found" message. This is an edge case and the fix still points to
dg doctor, which reports git. - As the PR body says, the
git_dashcallers (dg pr …,repo sync,make-public) still show git's raw message.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
Without
git-remote-dashon PATH:dg repo cloneprints only git's own message, followed by a generic E101:dg initanddg repo create --pushcreate the repository on Platform and pay for it, and only then does the push fail the same way.dg doctoralready reports the missing helper, but nothing points a user there. Found in the mainnet-readiness CLI QA.Both paths now check first with the existing
helper_installed()(PATH plus git's exec-path) and stop with E206 before git runs, before anything is spent, and before a sealed key's passphrase is asked for. The error names git-remote-dash and how to install it.docs/errors.mdE206 describes the new case.Test:
crates/dg/tests/helper_missing.rsruns the realdg repo clonewith a PATH that has git and no helper. It fails without the change and passes with it. Clippy and fmt are clean. Live check with the built binary: bothdg initanddg repo clonestop with the E206 above, and nothing is written.Not covered here: other commands that run
dash://git throughgit_dash(dg pr …,repo sync,make-public) still pass on git's message. That's a follow-up if wanted.🤖 Generated with Claude Code