Not that related but… in case of a syntax error (in that file at the very least), it keeps re-opening the editor until you Ctrl-C pijul
. It is quite annoying. Is it possible to continue from where you left off[1] if you Ctrl-C? If so, then there should not be any need to keep re-opening the editor upon syntax error. If there is no way to continue from where you left off, then consider this a FEATURE REQUEST.
You may want to heavily read into file locking (flock
, fcntl
, etc.), journaling, and write-ahead logging. A version control system must be as resistant as possible to power outages and so forth. Ultimately you are still relying on the kernel and the hardware, but you have to do everything in your power to ensure atomicity or the ability to detect failure and the ability to continue or rollback. git
implements it, you may want to take a look at its source code.
Is recording atomic? I did realize that you are using temporary files which is a good start. Make sure to check for hard link counts as well, it is an old trick.
[1] Similar to git {merge,rebase} --abort
or git {merge,rebase} --continue
.
pijul record
crashed with:I believe this is related to editors trimming whitespace:
records fine while
crashes (note the difference between
+
and+
).This I assume is theoretically fixed by T4VEIGHRHLIEFURXDJH76NITPFXQLFP4SJUXOIKDPDQMWLIG2IKAC, but that hasn’t hit nix unstable yet, so I haven’t been able to confirm this is a non-issue for the next release. If someone with a version that includes that change can test and confirm its fixed, I will close this. :-)