This is due to the trickiest part of libanu: change parsing. The internal representation of changes is tricky, and Pijul used to provide an interactive sequence of questions to make a change. I believe this new scheme offers much more flexibility, but requires (1) a stable text format to describe the changes (the binary format itself is stable), and (2) a parser for it.
Unfortunately, only real-world usage can tell if the text format is good enough. And since I don’t actuvely work on any other project at the moment, Anu itself is a good test case, even if that means going through some of these UI hiccups for the first release.
This particular problem with newlines is fixed in #3EAIT2277UKYK2SGAWNR4GRP3IIJGMH6ANJ3JGBZMKNYRW7OOCVQC.
I have explained in the following blog post how the whole thing works: https://pijul.org/posts/2020-11-07-towards-1.0/
In particular, deleted lines are not part of the change, they’re mostly a decoration here. The only things that matter for deletions are the lines of the form :D, 2.291 -> 2.291:314/2, 2.314 -> 4.121:168/2, 3.803903 -> 4.121:168/4
.
After cloning
anu
, despite seeming to have the fixes from #11 and #5, I still have newlines missing from myCargo.toml
files, socargo build
doesn’t work.Once I add those newlines in again myself and use
anu diff
to see my changes, I see a diff that looks very different than the change I actually made:Here is a session showing steps, along with a manual backup of the file and diff using
diff
:So for some reason, the diff shows three predecessor lines, when there was only one line in the actual file in my working directory, and it shows 3 new lines, two of which match the predecessor lines and one of which is a blank line at the end that I did not add; I added a newline in between the two other lines, to break up the two lines which had gotten merged together somehow.