diff --git a/.gitignore b/.gitignore index 2f2fe19..ed3f07c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ target # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +# Generated demo output +demo/demo.ascii diff --git a/README.md b/README.md index 902d6bd..c7fb92e 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,7 @@ A keyboard-driven git file manager for the terminal. ## The Problem -When working with git, common workflows like staging files, viewing diffs, and editing changed files require typing full file paths repeatedly. Tab completion helps, but with many changed files it's still slow. -This can be exacerbated by AI driven workflows as the amount of time reviewing grows substantially relative writing code. +AI coding assistants generate changes across many files quickly, shifting the bottleneck from writing code to reviewing it. Staging files, viewing diffs, and editing requires typing full file paths repeatedly. Tab completion helps, but with many changed files it's still slow. ## The Solution diff --git a/crates/f/src/f.rs b/crates/f/src/f.rs index 7d9affa..7744a87 100644 --- a/crates/f/src/f.rs +++ b/crates/f/src/f.rs @@ -189,13 +189,13 @@ fn cmd_diff(id: Option, config: &Config) -> ! { &file.abs_path.to_string_lossy(), ]) } else { - exec_git(&["diff", &file.abs_path.to_string_lossy()]) + exec_git(&["diff", "--", &file.abs_path.to_string_lossy()]) } } fn cmd_staged_diff(id: Option, config: &Config) -> ! { let file = require_file(resolve_file(id, config)); - exec_git(&["diff", "--staged", &file.abs_path.to_string_lossy()]) + exec_git(&["diff", "--staged", "--", &file.abs_path.to_string_lossy()]) } fn cmd_add(id: Option, config: &Config) -> ! { @@ -283,11 +283,11 @@ fn handle_id_first(id: &str, action: Option<&str>, config: &Config) { &file.abs_path.to_string_lossy(), ]); } else { - exec_git(&["diff", &file.abs_path.to_string_lossy()]); + exec_git(&["diff", "--", &file.abs_path.to_string_lossy()]); } } Some("sd" | "staged-diff") => { - exec_git(&["diff", "--staged", &file.abs_path.to_string_lossy()]); + exec_git(&["diff", "--staged", "--", &file.abs_path.to_string_lossy()]); } Some("e" | "v" | "edit") => { exec_editor(&file.abs_path.to_string_lossy(), config); @@ -508,12 +508,12 @@ mod interactive { } 'd' => { let _ = Command::new("git") - .args(["diff", &file.abs_path.to_string_lossy()]) + .args(["diff", "--", &file.abs_path.to_string_lossy()]) .exec(); } 's' => { let _ = Command::new("git") - .args(["diff", "--staged", &file.abs_path.to_string_lossy()]) + .args(["diff", "--staged", "--", &file.abs_path.to_string_lossy()]) .exec(); } 'e' => {