Looking at the code, it seems that
Change::read_and_deps parses the dependencies correctly (modulo
unwrapping when reading the hash) but then
pijul::commands::record::Record::record throws all this work away and computes the dependencies from the diff again.
In an elementary test, my change above fixes the issue by just using the dependencies that
read_and_deps returns, but I am not sure whether it’s really that simple.
As far as I understand, your change kills
pijul record --tag which makes the change depend on all the changes that were in the channel.
Additional question: what if some of the dependencies are not in the channel? Should
pijul record error? Or should the changes also be added to the channel as a side-effect? And in that case, should the working directory be updated? (Maybe @pmeunier has an answer on that?)
Thanks, I just applied the change. It was that simple, this mistake results from a rebalancing between the roles of Pijul and Libpijul.
read_and_deps is a new-ish function, and its role was done by
record in the past.
@gThorondsen: if the dependencies are not in the channel, the change
can’t be applied. Oops… it seems Libpijul wasn’t checking for that. Now it does, thanks!