From: Junio C Hamano Date: Fri, 18 Jan 2019 21:49:56 +0000 (-0800) Subject: Merge branch 'ot/ref-filter-object-info' X-Git-Tag: v2.21.0-rc0~79 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/55574bd04ada4dab255dad687665ee7578bc6a32 Merge branch 'ot/ref-filter-object-info' The "--format=" option of for-each-ref, branch and tag learned to show a few more traits of objects that can be learned by the object_info API. * ot/ref-filter-object-info: ref-filter: give uintmax_t to format with %PRIuMAX ref-filter: add docs for new options ref-filter: add tests for deltabase ref-filter: add deltabase option ref-filter: add tests for objectsize:disk ref-filter: add check for negative file size ref-filter: add objectsize:disk option --- 55574bd04ada4dab255dad687665ee7578bc6a32 diff --cc ref-filter.c index 61d75d5c86,b22cab133e..422a9c9ae3 --- a/ref-filter.c +++ b/ref-filter.c @@@ -880,10 -895,14 +899,14 @@@ static void grab_common_values(struct a name++; if (!strcmp(name, "objecttype")) v->s = xstrdup(type_name(oi->type)); - else if (!strcmp(name, "objectsize")) { + else if (!strcmp(name, "objectsize:disk")) { + v->value = oi->disk_size; + v->s = xstrfmt("%"PRIuMAX, (uintmax_t)oi->disk_size); + } else if (!strcmp(name, "objectsize")) { v->value = oi->size; - v->s = xstrfmt("%lu", oi->size); + v->s = xstrfmt("%"PRIuMAX , (uintmax_t)oi->size); - } + } else if (!strcmp(name, "deltabase")) + v->s = xstrdup(oid_to_hex(&oi->delta_base_oid)); else if (deref) grab_objectname(name, &oi->oid, v, &used_atom[i]); }