The reason is simple: you can’t meaningfully output multiple files to the standard output.
Tbh I would’ve just printed them one after the other, but that may not actually be very useful.
I’ve never used --dry-run
, and I’m not sure we need it actually. Maybe it would even be worth removing, in order to avoid “command line bloat” (aka the Git design).
Just after writing this, I thought that maybe pijul git
deserves to have as many arguments as possible, and a different, random set of useless arguments at each run.
I actually used it just earlier, I couldn’t figure out where I had deleted a line from a file. I find it kind of hard to see where a change happened in the diff output, I don’t know what the various numbers mean.
The numbered lines are of the form 1. /path/to/my/file:line_number x.y
, where x.y
is a reference to the change that introduced the file (x
is a reference to a change in the “Dependencies” section, and y
is a byte offset in that change).
I see, that helps a lot. What do you think about showing a few lines of context on either side of changes?
Oh, and while I’m asking questions: How do I manually add a dependency?
We could show a few lines indeed, but that would make the command non-deterministic: the change you see in pijul record
might not be the same one as the one you see in pijul change
, for example if there have insertions around the line since that change.
You can add a dependency by adding a line of the following form in the dependencies section:
[] FULLHASHOFTHECHANGE
For example:
[] T6VEW6IHRIM6YVB27OEXMOA6UYX5GJTYDTOU23DX6O7E7EIUA6NQC
W5V5TVRD3IDOPMRXOIN2BXIJTCJJ5Z272O7SXDBZ6PBRY24JKOAAC
RM3VUZV3THRHPKK4HFZCHC52LJWPCRG5AWHC5DTWU3JV436PFVUQC
We could show a few lines indeed, but that would make the command non-deterministic: the change you see in pijul record might not be the same one as the one you see in pijul change, for example if there have insertions around the line since that change.
Ah yes, I hadn’t thought of that. Although, doesn’t the same apply to the line numbers displayed in the diffs?
EDIT: Sorry, I confused this discussion with another.
QYY37T6YMICHA57GBXBBR4OYE2A76SFDKXPDKIKSEDDXCNQVC5CAC
This is fixed, thanks again!
The
--dry-run
option ofpjiul reset
says in its help message that it only works for single files. It correctly checks whether more than one path has been supplied, but panics if no files are supplied. This is easy to fix, but I’m wondering about the rationale behind only allowing a single file. Should this be generalized?