Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions crates/f/src/f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ fn cmd_diff(id: Option<String>, 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<String>, 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<String>, config: &Config) -> ! {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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' => {
Expand Down