The sound distributed version control system

#145 pijul reset --dry-run panics

Closed on December 4, 2020
loewenheim on November 30, 2020

The --dry-run option of pjiul 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?

pmeunier on November 30, 2020

The reason is simple: you can’t meaningfully output multiple files to the standard output.

loewenheim on November 30, 2020

Tbh I would’ve just printed them one after the other, but that may not actually be very useful.

pmeunier on November 30, 2020

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).

pmeunier on November 30, 2020

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.

loewenheim on November 30, 2020

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.

pmeunier on November 30, 2020

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).

loewenheim on November 30, 2020

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?

pmeunier on November 30, 2020

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

loewenheim added a change on November 30, 2020
W5V5TVRD3IDOPMRXOIN2BXIJTCJJ5Z272O7SXDBZ6PBRY24JKOAAC
loewenheim added a change on November 30, 2020
RM3VUZV3THRHPKK4HFZCHC52LJWPCRG5AWHC5DTWU3JV436PFVUQC
loewenheim on November 30, 2020

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.

pmeunier added a change on December 4, 2020
QYY37T6YMICHA57GBXBBR4OYE2A76SFDKXPDKIKSEDDXCNQVC5CAC
main
pmeunier on December 4, 2020

This is fixed, thanks again!

pmeunier closed this discussion on December 4, 2020