snapdiff icon indicating copy to clipboard operation
snapdiff copied to clipboard

Define and implement behaviour for hardlinks

Open jotaen opened this issue 1 year ago • 1 comments

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 -R for 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-links for 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.

jotaen avatar Jan 22 '24 20:01 jotaen

Splitting symlinks into its own issue, as it’s actually a separate topic.

jotaen avatar Jan 23 '24 20:01 jotaen