feat: Add support showing size of absent git-annex'ed files#404
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.mp4Sorry 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! |
https://build.opensuse.org/request/show/1324629 by user jfkw + anag_factory - Version 5.32.0 * feat: Add --no-spawn-shell flag to disable shell access (gh#dundee/gdu#440) * feat: Add support showing size of absent git-annex'ed files (gh#dundee/gdu#404) * fix: ctrl_z corruption (gh#dundee/gdu#253) by (gh#dundee/gdu#406) * fix: item count for --show-item-count (gh#dundee/gdu#416) * fix: automatically run non-interactive when related flag set (gh#dundee/gdu #418) (forwarded request 1324602 from RN)
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: