mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
builtin/repo: add inflated object info to structure table
Update the table output format for the git-repo(1) structure command to begin printing the total inflated object size info by object type. To be more human-friendly, larger values are scaled down and displayed with the appropriate unit prefix. Output for the keyvalue and nul formats remains unchanged. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
3e114496e4
commit
4d279ae36b
14
strbuf.c
14
strbuf.c
@@ -886,11 +886,15 @@ void humanise_bytes(off_t bytes, char **value, const char **unit,
|
||||
*unit = humanise_rate ? _("KiB/s") : _("KiB");
|
||||
} else {
|
||||
*value = xstrfmt("%u", (unsigned)bytes);
|
||||
*unit = humanise_rate ?
|
||||
/* TRANSLATORS: IEC 80000-13:2008 byte/second */
|
||||
Q_("byte/s", "bytes/s", bytes) :
|
||||
/* TRANSLATORS: IEC 80000-13:2008 byte */
|
||||
Q_("byte", "bytes", bytes);
|
||||
if (flags & HUMANISE_COMPACT)
|
||||
/* TRANSLATORS: IEC 80000-13:2008 byte/second and byte */
|
||||
*unit = humanise_rate ? _("B/s") : _("B");
|
||||
else
|
||||
*unit = humanise_rate ?
|
||||
/* TRANSLATORS: IEC 80000-13:2008 byte/second */
|
||||
Q_("byte/s", "bytes/s", bytes) :
|
||||
/* TRANSLATORS: IEC 80000-13:2008 byte */
|
||||
Q_("byte", "bytes", bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user