You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't count the same hard link multiple times in du #1317
Is your feature request related to a problem? Please describe.
The builtin du counts hard links multiple times.
Describe the solution you'd like
I would like du to only count the same hard link once in computing disk usage. This could be either via a flag or by default.
One problem to figure out: if the same hard link exists multiple times, who do we attribute the disk usage to? Do we attribute it to all directories, but have a top-level sum that has the real usage?
Describe alternatives you've considered
Keeping the current behaviour, which may overestimate actual disk usage.
I think when in doubt, do what du does. In this case, first one found wins, subsequent entries are skipped unless a flag not to do inode tracking is set.
Ignoring precedent, an argument could be made for double-counting in apparent, because that's how big the directories appear to be, but the question is which is more useful and which is less surprising.
but the question is which is more useful and which is less surprising.
Agree that this is probably the best question to ask. When I think du, I think "disk usage", and more me that sounds a lot like "how much disk space am I actually using" 🙂
I think it might be worth reworking this to use a single ignore loop. It can handle most of the heavy-lifting and keep the traversal in one place where both the inode and ctrl-c checks can go (currently broken except in the most trivial of cases).
This will also enable easily adding features like supporting .gitgnore and even multithreaded traversal.
This issue has been marked stale for more than 10 days without activity. Closing this issue, but if you find that the issue is still valid, please reopen.
Activity
Freaky commentedon Feb 10, 2020
I think when in doubt, do what
dudoes. In this case, first one found wins, subsequent entries are skipped unless a flag not to do inode tracking is set.Ignoring precedent, an argument could be made for double-counting in
apparent, because that's how big the directories appear to be, but the question is which is more useful and which is less surprising.thegedge commentedon Feb 11, 2020
Agree that this is probably the best question to ask. When I think
du, I think "disk usage", and more me that sounds a lot like "how much disk space am I actually using" 🙂Freaky commentedon Feb 11, 2020
I think it might be worth reworking this to use a single
ignoreloop. It can handle most of the heavy-lifting and keep the traversal in one place where both the inode and ctrl-c checks can go (currently broken except in the most trivial of cases).This will also enable easily adding features like supporting
.gitgnoreand even multithreaded traversal.github-actions commentedon Jun 24, 2021
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
github-actions commentedon Jul 7, 2021
This issue has been marked stale for more than 10 days without activity. Closing this issue, but if you find that the issue is still valid, please reopen.