Current Behavior
Running chainsaw diff feature/auth --entry src/index.ts fails with a "file not found" error because the slash in feature/auth triggers the path-like heuristic in classify_diff_arg. The function checks for / before attempting git ref resolution, so valid branch names like feature/auth, bugfix/login, or release/v2 are never tried as git refs.
Expected Behavior
Branch names with slashes should be correctly identified as git refs. The function should attempt git ref resolution before the path-like heuristic, or the heuristic should be scoped more narrowly.
Context
Slash-separated branch names are a common convention (feature/x, bugfix/y, release/z). This makes chainsaw diff unusable with these branch naming patterns.
Technical Details
Relevant Code
src/git.rs:30-37 — classify_diff_arg
let looks_like_path = arg.contains('/')
|| arg.contains(std::path::MAIN_SEPARATOR)
|| path.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("json"));
if looks_like_path {
return Err(crate::error::Error::DiffFileNotFound(arg.to_string()));
}
The / check fires before the git rev-parse fallback at line 40.
Current Behavior
Running
chainsaw diff feature/auth --entry src/index.tsfails with a "file not found" error because the slash infeature/authtriggers the path-like heuristic inclassify_diff_arg. The function checks for/before attempting git ref resolution, so valid branch names likefeature/auth,bugfix/login, orrelease/v2are never tried as git refs.Expected Behavior
Branch names with slashes should be correctly identified as git refs. The function should attempt git ref resolution before the path-like heuristic, or the heuristic should be scoped more narrowly.
Context
Slash-separated branch names are a common convention (feature/x, bugfix/y, release/z). This makes
chainsaw diffunusable with these branch naming patterns.Technical Details
Relevant Code
src/git.rs:30-37—classify_diff_argThe
/check fires before the git rev-parse fallback at line 40.