-
-
Notifications
You must be signed in to change notification settings - Fork 794
Add tests for diff output of archives with hard links. #9031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9031 +/- ##
==========================================
+ Coverage 81.13% 81.45% +0.32%
==========================================
Files 77 77
Lines 13515 13515
Branches 2004 2004
==========================================
+ Hits 10965 11009 +44
+ Misses 1884 1853 -31
+ Partials 666 653 -13 ☔ View full report in Codecov by Sentry. |
|
@cr1901 can you install pre-commit, so black runs automatically? https://borgbackup.readthedocs.io/en/latest/development.html#building-a-development-environment |
298fae5 to
a396e7d
Compare
|
Okay, looks like I properly installed the pre-commits and CI is passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Some minor things I found...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Are you finished with this, so I can merge it?
|
Yes, I am finished. Feel free to merge. |
|
Thanks for helping! |
This is a follow-up to #8344. After mulling it over, I generally think
borgis doing the right thing when diffing with hard links, as the changes reported match POSIX semantics for unlinking:An
mtimeandctimechange with no content modification or permission change between the same file in two repos is probably a reasonable hint that a hard link was broken. Similarly, actimechange with no permission change is probably a reasonable hint that the hard link count changed. This is the same infoborgv1 currently reports for a hard link that was broken/hard link count that changed. Additionally, excluding one hard link but not another from a diff seems to work just fine as well, completely sidestepping the need for a fix like #8344 :) in v1.It may be interesting to extend the
diffoutput to be hard-link aware, but not clear to me what this should look like, short of the "primary/secondary" mechanism that required #8344 in the first place :). For now users interested in actual hard link info can supply a--formatlike'{hlid} {path}'toborg-2 listandsort:As long as
borgkeeps track of the info, there shouldn't be much need for end users to worry about hard link diffs (and themtime/ctimehints above are good markers).