Show repository sizes in list
`list -a` had sizes because archives are files; repositories are directories, and a long listing reports the inode size for those -- 4096 for every single one. Taking that number would have filled the column with the same meaningless value, so the real disk usage is asked of `du` instead, appended to the same remote command so it still costs one round trip. The column is dropped entirely when no usable sizes come back, rather than showing a column of zeroes, so a server without a working `du` degrades to the previous output. The summary line carries the total. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,14 +134,20 @@ worked-on project sits closest to the prompt:
|
||||
|
||||
```
|
||||
< src > list
|
||||
Betaflight3.0.0 Sep 28 2016
|
||||
website Mar 3 2024
|
||||
notes Jan 3 14:32
|
||||
3 repositories
|
||||
Betaflight3.0.0 Sep 28 2016 181M
|
||||
website Mar 3 2024 2.1M
|
||||
notes Jan 3 14:32 876K
|
||||
3 repositories · 184M
|
||||
```
|
||||
|
||||
`list -a` lists the archives instead, with their sizes; a pattern filters by
|
||||
name (`list note`).
|
||||
The size is the repository's real disk usage on the server, asked of `du` in
|
||||
the same round trip as the listing — a long listing reports the inode size for
|
||||
a directory, which is the same number for every repository and says nothing. If
|
||||
the server produces no usable sizes the column is left out rather than filled
|
||||
with zeroes.
|
||||
|
||||
`list -a` lists the archives instead, whose sizes come from the listing itself;
|
||||
a pattern filters by name (`list note`).
|
||||
|
||||
### Overview
|
||||
|
||||
|
||||
Reference in New Issue
Block a user