#14
Add streamlined clone and diff aliases
Summary
- add
try cloneas the simplest clone entrypoint, sharing arguments and execution withtry repo clone - accept
OWNER/NAMEand Trylle HTTPS references while passing scp-style Trylle SSH URLs unchanged to system Git so explicit or default SSH usernames keep working - add hidden
try reviewandtry raliases alongsidetry dfortry diff - cover both clone entrypoints, all requested repository forms, Git invocation behavior, and hidden aliases
Verification
cargo fmt --all -- --checkcargo test --locked --all-features
Activity
4trylle-botreviewed4mo ago
7fe7b0c into master3mo ago
First-pass review (automated). Not approving or requesting changes — flagging one concrete consistency issue and one naming note for a human to weigh. The change is well-scoped and the test coverage (both entrypoints × all repo forms, hidden-alias checks, scp-URL classifier unit test) is genuinely thorough.
What changed
try clonecommand sharingCloneArgsand execution withtry repo clone; the old inlineRepoCommand::Clone { .. }body is extracted into a sharedrun_clone(src/trylle/mod.rs).run_clonegains a fast path: if the input looks like a Trylle scp-style SSH URL it is passed to system Git verbatim (no API lookup, no credential helper); otherwise the previous OWNER/NAME + Trylle-HTTPS → API-clone-URL flow runs unchanged.review/raliases added todiffalongside the existingd.Risk areas
is_trylle_scp_style_clone_urlhardcodestrylle.com(src/trylle/mod.rs:1209), ignoring the configurable API endpoint. The endpoint is user-configurable viaTRYLLE_API_ENDPOINT/TRYLLE_API_URL/ config file (src/trylle/api.rs:257), and the rest of the clone path honors it —platform_git_http_urlbuilds fromcfg.api_endpoint. The scp classifier does not. Consequence on a custom/self-hosted endpoint: an scp-style SSH URL to that host fails thetrylle.comcheck, so instead of being passed to Git unchanged it falls intoresolve_repo→repo_parts, which strips everything before:and reinterpretshost:owner/nameas plainOWNER/NAME, then clones via the configured API endpoint — silently discarding the user's explicit host and SSH username. That directly undercuts the PR's stated goal that "explicit or default SSH usernames keep working," for any non-default host. The unit test only exercisestrylle.com, so this gap isn't covered.try reviewsemantics (src/config/cli.rs:481):review/rare hidden aliases for the diff viewer, but the CLI already has a PR-review surface (try pr review,pr review-comments). A user typingtry review 14expecting to review PR #14 gets the local diff tool instead. It's hidden so it won't clutter help, but the name overlaps a distinct existing concept — worth a conscious call on whetherreviewshould aliasdiff.Suggested follow-ups
cfg.api_endpoint(or the configured web host) instead of thetrylle.comliteral, and add a classifier/clone test with a non-default endpoint so the custom-host case is pinned.No other correctness concerns spotted in this pass; the refactor preserves the prior credential-helper/token behavior for the API path.