The sound distributed version control system

#158 record: Dependencies specified in the editor are ignored

Closed on December 4, 2020
gThorondorsen on December 3, 2020

(Also discovered by @loewenheim in discussion 134.)

Looking at the code, it seems that libpijul’s 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.

loewenheim added a change on December 4, 2020
NGSZJPOB2OVJ6BGCC5BWQUWAXHXIFWCENI4ULBGIEEUWQBHG7J6QC
main
loewenheim on December 4, 2020

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.

gThorondorsen on December 4, 2020

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

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

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!

pmeunier closed this discussion on December 4, 2020
loewenheim added a change on December 5, 2020
4VBKN3YRF34Y5YBFCTDALRFC3JA7PJV6FOFW7ID7PIYYDQHC36TQC