How is `pijul log` output sorted?

Of course it’s basically in reverse chronological order. But is it sorted by the creation date of the change, or the time it was added to the channel that’s being logged? (These will be the same if you only ever have one channel, but if you pull changes from one channel to another, they will be different.)

Good question. It is sorted by application time. You can check that for yourself if you create a repo with just one patch, then clone it, edit something in both copies and then pull from the other copy.

Your two copies will have four patches: the first two ones (repo init + initial patch), plus [A, B] in the first repo, and [B, A] in the other.

1 Like

That’s handy. I had assumed that because changes in Pijul aren’t inherently ordered, there would be no way to view the history of a channel in the order that it happened. But since pijul log preserves the order that changes were applied, it gives us a nice “linear history”, just like Git users strive for. (Although it’s not quite accurate if a change was removed with unrecord.)

I haven’t had time to write up the details, but I’d like to see something akin to a pijul timeline feature. Thinking about it, state-based VCSs are good for managing files like a backup, representing known good states and keeping track of what we do and when, whilst the change-based model of pijul is far superior for managing source code and tracking semantic changes and functionality.