Modified Item.pyx to include diffs in ctime and mtime#7335
Modified Item.pyx to include diffs in ctime and mtime#7335ThomasWaldmann merged 4 commits intoborgbackup:masterfrom
Conversation
|
@ThomasWaldmann could use some help with the help text for the diff cmd. |
ThomasWaldmann
left a comment
There was a problem hiding this comment.
Thanks for the PR, some stuff I found...
|
BTW, some tests fail in a not very informative way. Guess this could be improved in a separate commit. |
|
Would like to include this in next borg2 beta if it can be finished soon. @Michael-Girma are you still working on this? |
|
@ThomasWaldmann pushed changes. Take a look when possible. |
|
Windows tests are failing, check why. ctime on windows is creation time, not inode change time as on unix. |
|
@ThomasWaldmann Working with the docs but still struggling to set up a windows dev environment using Cygwin. Is there another preferred method to set it up or at the very least mimic it for the tests? |
|
@Michael-Girma the windows CI works with msys2, not sure if test results are same for cygwin. Maybe @RayyanAnsari can help better with the Windows stuff than me. |
|
@Michael-Girma yes, on Windows we use MSYS2 for the build environment.
@ThomasWaldmann I should probably add this to the documentation, is it just |
|
@RayyanAnsari yes, it would be good to have it in the docs. installation.rst is the end-user stuff and the development section usually builds on that and adds developer instructions. we have also that old windows todo file in the repo root dir, guess it is outdated? |
|
@ThomasWaldmann. Been puzzled by an issue regarding the ctime attribute on windows for the past couple of days. One thing I landed on is that there is a different behavior for temporary dirs. When creating a file manually, a difference in |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #7335 +/- ##
==========================================
- Coverage 83.91% 83.84% -0.08%
==========================================
Files 67 67
Lines 11710 11722 +12
Branches 2133 2134 +1
==========================================
+ Hits 9827 9828 +1
- Misses 1318 1327 +9
- Partials 565 567 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
@Michael-Girma that's strange. like it did not delete the file, but continued with the same one (3rd screenshot). one difference is maybe the fs type you work on:
maybe you could try the same as in 1st screenshot, but manually use /tmp/something. of course, /tmp is also mode +t ("sticky"), but i don't see how what you found could be related to that. ehrm, i was still thinking linux, but you used windows. so what i said might be irrelevant. not sure how msys2 is working, the paths looked like on linux. |
|
@ThomasWaldmann , I thought linux as well. That's why I tried a third archive with the file modified. In that scenario, there would have been a ctime in the last diff output since ctime would change on linux after content manipulation. But the above reasons do seem interesting. I'll have a deeper look. |
|
@ThomasWaldmann after landing on an issue hinting that |
|
@Michael-Girma that 15s thing is interesting, like "wtf did they think when implementing it like that?". the issue you linked to reads rather confusing and i guess we should focus on python https://docs.python.org/3/library/os.html#os.stat_result.st_ctime So, is that "creation time" (as documented) under msys2? Or "metadata change time" as on Unix? Also, whatever you find out should be in a source code comment, so it is easier accessible without having to dig into git / github. There should be a comment explaining it right above that sleep(15). Also: does this explain the different behaviour you found in home and in /tmp (was it just the timing of your manual commands)? Also interesting would be to research whether we get |
|
@ThomasWaldmann I know, crazy idea. Yeah, I'm also getting |
ce32bef to
c580480
Compare
…up#7248 --- - Modified Item.pyx to return ctime and mtime attributes on diff - Modified diff_cmd to sort its JSON output alphabetically
c580480 to
86884ee
Compare
|
@ThomasWaldmann I've added in the comment above sleep and I've also rebased to clean up the commit history, add the issue number and bring in the latest changes from master. |
ThomasWaldmann
left a comment
There was a problem hiding this comment.
some more, sometimes minor, stuff i found.
also the hardlink stuff needs a thorough check as borg is handling these a bit differently in master:
- there is no "source" or "target" any more for hardlinks in the borg item (looks like some comments were wrong before you change already, maybe you could check and fix them)
- hardlinks that originally pointed to same inode have the same "hlid" value in the borg item
|
@ThomasWaldmann Checked the hard-link changes. So what the previous test case was trying to do is create 2 hard-links and then remove one of them. It was expected that this shouldn't change the link that hasn't been removed in any way, which was right since we weren't considering |
|
Ah, good explanation, yes, please add some short comment in the src. |
026dfd4 to
2b97111
Compare
|
Thanks! |
|
If you like, check how easy/hard this is to backport to 1.2-maint. |
|
Okay will do! |
|
@ThomasWaldmann The |
|
@real-yfprojects thanks for the hints, see #7486. |

Modified Item.pyx to include diffs in ctime and mtime. Fixes #7248
Created flag to switch this feature on/off