-
Notifications
You must be signed in to change notification settings - Fork 167
feat: Add support showing size of absent git-annex'ed files #404
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
git-annex encodes the apparent size of files their symlinks. gdu now is capable of extracting those sizes from the broken symlinks to calculate the total size of git-annex repositories. Note: real usage remains zero. gdu needs to be invoked via: gdu --follow-symlinks --show-apparent-size --show-annexed-size
I fully understand, if this PR is a bit out-of-scope for gdu. Maybe other git-annex users might find it useful :) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #404 +/- ##
==========================================
- Coverage 87.64% 87.55% -0.10%
==========================================
Files 44 46 +2
Lines 4329 4386 +57
==========================================
+ Hits 3794 3840 +46
- Misses 460 470 +10
- Partials 75 76 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I have fixed few small issues. Could you cover your logic with tests? |
Hi Daniel, Yes, I can implement some test cases. The use of git-annex stores files in this hierarchy:
Due two-levels of hash directories, and a dedicated directory per link, causes For the purpose of this PR, I am only interested in the |
I have updated the code to contain both It seems to work for me fine. $ go run github.com/dundee/gdu/v5/cmd/gdu -LAan ~/annex
1.1 MiB /.git
@ 923.0 MiB file.mp4
$ go run github.com/dundee/gdu/v5/cmd/gdu -an ~/annex
1.1 MiB /.git
@ 202 B file.mp4 Sorry for taking so long, I wanted to get hands on Git annex. |
Hey @dundee, oh thats great :) Yes, I think this is the best solution. Thanks for looking into it :) I did not expect, that you will look into git-annex :) |
I've also pushed a fix to make golangci-lint happy. |
Great, thanks for your contribution! |
git-annex encodes the apparent size of files their symlinks.
gdu now is capable of extracting those sizes from the broken symlinks to calculate the total size of git-annex repositories.
Reference: https://git-annex.branchable.com/internals/key_format/
Note: real usage remains zero. gdu needs to be invoked via: