I'm currently focusing on two particular RPCs that we use, addToStore and addTextToStore. In the Nix thesis I only see reference to addToStore. What's the difference between the two? I see that addTextToStore allows specifying references while addToStore doesn't, and addTextToStore is specifically for regular files. What's the motivation for the split? Additionally, the hash part of the resulting path is computed differently for addTextToStore, addToStore, and addToStore with recursive set. This means that there could be three regular files with the exact same contents and the exact same name, but different hash parts. It doesn't violate any store invariants or anything, of course, but I'm wondering why it's done.
Especially puzzling to me is what the purpose of the recursive flag is for addToStore. It causes the path hash to be calculated differently and makes sure that non-regular files cause errors, but why? Thanks in advance for any answers y'all can give. - reepca