snapdiff
snapdiff copied to clipboard
Define and implement behaviour for hardlinks
I also haven’t considered hardlinks so far, so their behaviour is not well-defined.
Hardlinks are quite tricky, because their behaviour depends on how the snapshots were created, or whether you compare two snapshots against each other, or whether you compare one snapshot against the original directory tree.
- If you do
cp -Rfor creating a snapshot, then all hardlinks from the original directory tree are created as individual files in the snapshot. - If you do
rsync -r --hard-linksfor creating a snapshot, then all hardlinks from the original directory tree are cloned (as hardlinks) in the snapshot.
The other issue is that it’s more complex to determine the “redundant” hardlinks within the same snapshot in the first place.
Not sure yet, what the best solution is here. I’m also not sure how common this problem actually is, or whether the additional complexity of solving it is worth the benefit.
Splitting symlinks into its own issue, as it’s actually a separate topic.