group diffs by file name
[?]
Mar 27, 2025, 8:40 PM
W4LFX7IHQ7SDX67ATSGWDB5IN6472ZJDBKY2XZ54SBJEYD5GAT5QCDependencies
- [2]
SWWE2R6Mdisplay basic repo stuff - [3]
WT3GA27Padd cursor with selection - [4]
EC3TVL4Xadd untracked files - [5]
KT5UYXGKfix selection after adding file, add changed file diffs - [6]
YBJRDOTCmake all repo actions async - [7]
A5YBC77Vrecord! - [8]
D7A7MSIHallow to defer or abandon record, add buttons - [9]
UCBNZULEmake changed files paths optional (no path for root) - [10]
4WO3ZJM2show untracked files' contents - [11]
CFYW3HGZwip: display changed files - [12]
W7IUT3ZVstart recording impl - [13]
DVKSPF7Rtrack selected file path together with an index - [14]
UB2ITZJSrefresh changed files on FS changes - [15]
S2NVIFXRallow to enter record msg - [16]
ELG3UDT6allow to rm added files - [*]
6YZAVBWUInitial commit
Change contents
- replacement in crates/libflowers_client/src/repo.rs at line 30
pub changed_files: BTreeSet<ChangedFile>,pub changed_files: ChangedFiles, - replacement in crates/libflowers_client/src/repo.rs at line 39
pub changed_files: BTreeSet<ChangedFile>,pub changed_files: ChangedFiles, - replacement in crates/libflowers_client/src/repo.rs at line 42
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]pub struct ChangedFile {pub path: Option<String>,pub diff: ChangedFileDiff,}pub type ChangedFiles = BTreeMap<String, ChangedFile>;pub type ChangedFile = BTreeSet<ChangedFileDiff>;pub const ROOT_FILE: &str = "."; - replacement in crates/libflowers_client/src/repo.rs at line 89
changed_files: BTreeSet<ChangedFile>,changed_files: ChangedFiles, - replacement in crates/libflowers_client/src/repo.rs at line 436[5.1700]→[10.396:491](∅→∅),[10.491]→[2.2949:2982](∅→∅),[5.1757]→[2.2949:2982](∅→∅),[2.2949]→[2.2949:2982](∅→∅),[2.2982]→[10.492:535](∅→∅)
fn changed_files(diff: &Diff,repo_changes: &FileSystem,) -> BTreeSet<ChangedFile> {diff.changes.iter().map(|change| match dbg!(change) {fn changed_files(diff: &Diff, repo_changes: &FileSystem) -> ChangedFiles {let mut changes: ChangedFiles = BTreeMap::new();for change in diff.changes.iter() {match dbg!(change) { - replacement in crates/libflowers_client/src/repo.rs at line 444[5.1861]→[5.1861:1892](∅→∅),[5.1892]→[9.40:82](∅→∅),[9.82]→[5.1928:1988](∅→∅),[5.1928]→[5.1928:1988](∅→∅)
} => ChangedFile {path: Some(path.clone()),diff: ChangedFileDiff::Move,},} => {changes.entry(path.clone()).or_default().insert(ChangedFileDiff::Move);} - replacement in crates/libflowers_client/src/repo.rs at line 455[5.2072]→[5.2072:2103](∅→∅),[5.2103]→[9.83:125](∅→∅),[9.125]→[5.2139:2198](∅→∅),[5.2139]→[5.2139:2198](∅→∅)
} => ChangedFile {path: Some(path.clone()),diff: ChangedFileDiff::Del,},} => {changes.entry(path.clone()).or_default().insert(ChangedFileDiff::Del);} - replacement in crates/libflowers_client/src/repo.rs at line 466[5.2284]→[5.2284:2315](∅→∅),[5.2315]→[9.126:168](∅→∅),[9.168]→[5.2351:2412](∅→∅),[5.2351]→[5.2351:2412](∅→∅)
} => ChangedFile {path: Some(path.clone()),diff: ChangedFileDiff::Undel,},} => {changes.entry(path.clone()).or_default().insert(ChangedFileDiff::Undel);} - replacement in crates/libflowers_client/src/repo.rs at line 478[5.2530]→[5.2530:2561](∅→∅),[5.2561]→[9.169:211](∅→∅),[9.211]→[5.2597:2731](∅→∅),[5.2597]→[5.2597:2731](∅→∅),[5.2731]→[9.212:254](∅→∅),[9.254]→[5.2767:2917](∅→∅),[5.2767]→[5.2767:2917](∅→∅),[5.2917]→[9.255:297](∅→∅),[9.297]→[5.2953:3028](∅→∅),[5.2953]→[5.2953:3028](∅→∅)
} => ChangedFile {path: Some(path.clone()),diff: ChangedFileDiff::Add,},BaseHunk::SolveNameConflict { name: _, path } => ChangedFile {path: Some(path.clone()),diff: ChangedFileDiff::SolveNameConflict,},BaseHunk::UnsolveNameConflict { name: _, path } => ChangedFile {path: Some(path.clone()),diff: ChangedFileDiff::UnsolveNameConflict,},} => {changes.entry(path.clone()).or_default().insert(ChangedFileDiff::Add);}BaseHunk::SolveNameConflict { name: _, path } => {changes.entry(path.clone()).or_default().insert(ChangedFileDiff::SolveNameConflict);}BaseHunk::UnsolveNameConflict { name: _, path } => {changes.entry(path.clone()).or_default().insert(ChangedFileDiff::UnsolveNameConflict);} - edit in crates/libflowers_client/src/repo.rs at line 501
let path = Some(local.path.clone()); - replacement in crates/libflowers_client/src/repo.rs at line 515
ChangedFile {path,diff: ChangedFileDiff::Edit {changes.entry(local.path.clone()).or_default().insert(ChangedFileDiff::Edit { - replacement in crates/libflowers_client/src/repo.rs at line 521
}); - replacement in crates/libflowers_client/src/repo.rs at line 528[5.3308]→[5.3308:3339](∅→∅),[5.3339]→[9.347:395](∅→∅),[9.395]→[5.3381:3527](∅→∅),[5.3381]→[5.3381:3527](∅→∅),[5.3527]→[9.396:444](∅→∅),[9.444]→[5.3569:3643](∅→∅),[5.3569]→[5.3569:3643](∅→∅)
} => ChangedFile {path: Some(local.path.clone()),diff: ChangedFileDiff::Replacement,},BaseHunk::SolveOrderConflict { change: _, local } => ChangedFile {path: Some(local.path.clone()),diff: ChangedFileDiff::SolveOrderConflict,},} => {changes.entry(local.path.clone()).or_default().insert(ChangedFileDiff::Replacement);}BaseHunk::SolveOrderConflict { change: _, local } => {changes.entry(local.path.clone()).or_default().insert(ChangedFileDiff::SolveOrderConflict);} - replacement in crates/libflowers_client/src/repo.rs at line 541[5.3712]→[5.3712:3742](∅→∅),[5.3742]→[9.445:497](∅→∅),[9.497]→[5.3788:3871](∅→∅),[5.3788]→[5.3788:3871](∅→∅)
ChangedFile {path: Some(local.path.clone()),diff: ChangedFileDiff::UnsolveOrderConflict,}changes.entry(local.path.clone()).or_default().insert(ChangedFileDiff::UnsolveOrderConflict); - replacement in crates/libflowers_client/src/repo.rs at line 550[5.3943]→[5.3943:3974](∅→∅),[5.3974]→[9.498:546](∅→∅),[9.546]→[5.4016:4215](∅→∅),[5.4016]→[5.4016:4215](∅→∅),[5.4215]→[9.547:575](∅→∅),[9.575]→[5.4254:4443](∅→∅),[5.4254]→[5.4254:4443](∅→∅),[5.4443]→[9.576:604](∅→∅),[9.604]→[5.4482:4545](∅→∅),[5.4482]→[5.4482:4545](∅→∅),[5.4545]→[4.544:574](∅→∅),[2.4415]→[4.544:574](∅→∅)
} => ChangedFile {path: Some(local.path.clone()),diff: ChangedFileDiff::ResurrectZombines,},BaseHunk::AddRoot { name: _, inode: _ } => ChangedFile {// TODO: maybe they don't all have path?path: None,diff: ChangedFileDiff::AddRoot,},BaseHunk::DelRoot { name: _, inode: _ } => ChangedFile {// TODO: maybe they don't all have path?path: None,diff: ChangedFileDiff::DelRoot,},}).collect()} => {changes.entry(local.path.clone()).or_default().insert(ChangedFileDiff::ResurrectZombines);}BaseHunk::AddRoot { name: _, inode: _ } => {changes.entry(ROOT_FILE.to_string()).or_default().insert(ChangedFileDiff::AddRoot);}BaseHunk::DelRoot { name: _, inode: _ } => {changes.entry(ROOT_FILE.to_string()).or_default().insert(ChangedFileDiff::DelRoot);}}}changes - replacement in crates/libflowers_client/src/cursor.rs at line 9
ChangedFile { ix: usize, path: Option<String> },ChangedFile { ix: usize, path: String }, - edit in crates/flowers_ui/src/main.rs at line 16
use std::collections::BTreeSet; - replacement in crates/flowers_ui/src/main.rs at line 175
let path = repo.changed_files.iter().nth(ix).unwrap().path.clone();let path = repo.changed_files.iter().nth(ix).map(|(k, _v)| k).unwrap().clone(); - replacement in crates/flowers_ui/src/main.rs at line 384[6.11860]→[6.11860:11911](∅→∅),[6.11911]→[9.675:725](∅→∅),[9.725]→[6.11955:12089](∅→∅),[6.11955]→[6.11955:12089](∅→∅)
let file = repo::ChangedFile {path: Some(path.clone()),diff: repo::ChangedFileDiff::Add,};repo.changed_files.insert(file);repo.changed_files.entry(path.clone()).or_default().insert(repo::ChangedFileDiff::Add); - replacement in crates/flowers_ui/src/main.rs at line 410
let file = repo.changed_files.iter().nth(*ix).unwrap();if let repo::ChangedFileDiff::Add = &file.diff {let diffs = repo.changed_files.get(path).unwrap();if diffs.iter().any(|diff| matches!(diff, repo::ChangedFileDiff::Add)){ - replacement in crates/flowers_ui/src/main.rs at line 418
path: path.clone().expect("Added file must have a path"),path: path.clone(), - edit in crates/flowers_ui/src/main.rs at line 422
let file = file.clone(); - replacement in crates/flowers_ui/src/main.rs at line 423
let removed = repo.changed_files.remove(&file);let removed = repo.changed_files.remove(path); - replacement in crates/flowers_ui/src/main.rs at line 425
removed,removed.is_some(), - replacement in crates/flowers_ui/src/main.rs at line 427
file, repo.changed_filespath,repo.changed_files - replacement in crates/flowers_ui/src/main.rs at line 431
if let Some(file_path) = file.path {repo.untracked_files.insert(file_path);}repo.untracked_files.insert(path.clone()); - replacement in crates/flowers_ui/src/main.rs at line 499
BTreeSet::new();repo::ChangedFiles::default(); - replacement in crates/flowers_ui/src/main.rs at line 649
.find(|(_ix, file)| &file.path == path).map(|(ix, file)| cursor::Selection::ChangedFile {ix,path: file.path.clone(),.find(|(_ix, (file_path, _diffs))| file_path == &path).map(|(ix, (file_path, _diffs))| {cursor::Selection::ChangedFile {ix,path: file_path.clone(),} - replacement in crates/flowers_ui/src/main.rs at line 740
|(ix, file)| {|(ix, (file_path, _diffs))| { - replacement in crates/flowers_ui/src/main.rs at line 746
match &file.path {Some(file_path) => text(format!("{}: {}", file.diff, file_path)),None => text(format!("{}", file.diff)),})text(format!("{}", file_path))) - replacement in crates/flowers_ui/src/main.rs at line 748
cursor::Selection::ChangedFile{ix, path: file.path.clone()},cursor::Selection::ChangedFile{ix, path: file_path.clone()}, - edit in crates/flowers_ui/src/main.rs at line 791
let path = if let Some(path) = path {path.as_str()} else {"root"};