pijul diff
does a bit of that.
S2OKPMVWVXXJ4J2VX4Y5TL7WN2JQO3FHRC7OWGP32YJ4X45B4BXAC
A short addition of diff --short
that is sort of like git status
and for a darcs like approach of aliasing pijul status
to pijul diff --short
. Has some issues like:
Yeah, will try to replicate it on this new version as soon as possible.
In the meantime this was the patch on the old format:
message = 'Add `diff --short` that lists changes without showing them'
timestamp = '2020-11-09T22:09:28.370335728Z'
[[authors]]
name = 'fabian'
full_name = 'Fabián Heredia Montiel'
# Dependencies
[2] Y67GBRYQ6WCAKFJKZJYNCSON7AMN2KRH5T745MQ3OMZCUA2SM5UAC
# Changes
1. Edit in pijul/src/commands/diff.rs:16 2.910327
up 2.910730, new 0:49, down 2.910730
+ #[clap(long = "short")]
+ pub short: bool,
2. Edit in pijul/src/commands/diff.rs:85 2.910327
up 2.913311, new 50:1633, down 2.913311
+ } else if self.short {
+ let mut changes = Vec::new();
+ for ch in change.changes.iter() {
+ changes.push(match ch {
+ Record::FileMove { path, .. } =>
+ format!("MV {}\n", path),
+ Record::FileDel { path, .. } =>
+ format!("D {}\n", path),
+ Record::FileUndel { path, .. } =>
+ format!("UD {}\n", path),
+ Record::FileAdd { path, .. } =>
+ format!("A {}", path),
+ Record::SolveNameConflict { path, .. } =>
+ format!("SC {}", path),
+ Record::UnsolveNameConflict { path, .. } =>
+ format!("UC {}", path),
+ Record::Edit { local: Local { path, .. }, .. } =>
+ format!("M {}", path),
+ Record::Replacement { local: Local { path, .. }, .. } =>
+ format!("R {}", path),
+ Record::SolveOrderConflict { local: Local { path, .. }, .. } =>
+ format!("SC {}", path),
+ Record::UnsolveOrderConflict { local: Local { path, .. }, .. } =>
+ format!("UC {}", path),
+ Record::ResurrectZombies { local: Local { path, .. }, .. } =>
+ format!("RZ {}", path),
+ });
+ }
+ changes.sort_unstable();
+ changes.dedup();
+ for ch in changes { println!("{}", ch); }
3. Edit in libpijul/src/working_copy/filesystem.rs:114 2.10770
:D, 2.14558 -> 2.14558:14622/2
- eprintln!("Adding {:?}", path);
4. Edit in libpijul/src/working_copy/filesystem.rs:126 2.10770
:D, 2.15242 -> 2.15242:15298/2
- eprintln!("Adding {:?}", path);
XVEWUDNJGUCCWOYQ7VTU2XNCFIORHQFWUH5WLJ2SV2LDZQJCDD4AC
Just to make it a little easier on you, @fabian, I ported your patch to the new format above. I didn’t remove the Adding {:?}
eprintln
s, however.
EDIT: In the future, I think it’d be nice to have the moved files show as MV old -> new
, but this would require a change in the Record::FileMove
enum (e.g. to store that old path)… Related to #40.
YDKNUL6B4EFM5U2GG36SSEKXHS6XK4OLIWUVE4BUAJ5VYJFHAOIQC
It would be a great addition to be able to see the status of the working tree akin to
git status
. I don’t know if all of the same concepts will transfer (e.g. untracked files), but I’d like to see the files that have been changed without needing to actually see the changes.