{"thread":{"id":"49783","subject":"[RFC PATCH 0/5] ref-filter: add new formatting options","startedAt":"2018-11-09T07:43:04Z","lastAt":"2019-01-10T18:18:05Z","messageCount":10,"participants":["Оля Тележная","Olga Telezhnaya","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"362780","messageId":"CAL21BmnoZuRih3Ky66_Tk0PweD36eZ6=fbY3jGumRcSJ=Bc_pQ@mail.gmail.com","threadId":"49783","inReplyTo":null,"subject":"[RFC PATCH 0/5] ref-filter: add new formatting options","fromName":"Оля Тележная","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2018-11-09T07:37:58Z","receivedAt":"2018-11-09T07:43:04Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"Add formatting options %(objectsize:disk) and %(deltabase), as in\ncat-file command.\n\nI can not test %(deltabase) properly (I mean, I want to have test with\nmeaningful deltabase in the result - now we have only with zeros). I\ntested it manually on my git repo, and I have not-null deltabases\nthere. We have \"t/t1006-cat-file.sh\" with similar case, but it is\nabout blobs. ref-filter does not work with blobs, I need to write test\nabout refs, and I feel that I can't catch the idea (and it is hard for\nme to write in Shell).\n\nFinally, I want to remove formatting logic in cat-file and use\nfunctions from ref-filter (we are almost there, so many work was done\nfor this). I had an idea to make this migration in this patch (and\nstop worrying about bad tests about deltabase: we already have such\ntest for cat-file and hopefully that could be enough). But I have\nanother question there. cat-file has one more formatting option:\n\"rest\" [1]. Do we want such formatting option in ref-filter? It's\neasier for me to support that in ref-filter than to leave it only\nspecifically for cat-file.\n\nThank you!\n\n[1] https://git-scm.com/docs/git-cat-file#git-cat-file-coderestcode\n"},{"id":"365777","messageId":"CAL21BmnmfxpMgbW_Yz9D=FVZk_AzWF0uyrNZeSGPCs63PH1oag@mail.gmail.com","threadId":"49783","inReplyTo":"CAL21BmnoZuRih3Ky66_Tk0PweD36eZ6=fbY3jGumRcSJ=Bc_pQ@mail.gmail.com","subject":"[PATCH v2 0/5] ref-filter: add new formatting options","fromName":"Оля Тележная","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2018-12-24T13:16:55Z","receivedAt":"2018-12-24T13:23:05Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"пт, 9 нояб. 2018 г. в 10:37, Оля Тележная <olyatelezhnaya@gmail.com>:\n>\n> Add formatting options %(objectsize:disk) and %(deltabase), as in\n> cat-file command.\n>\n> I can not test %(deltabase) properly (I mean, I want to have test with\n> meaningful deltabase in the result - now we have only with zeros). I\n> tested it manually on my git repo, and I have not-null deltabases\n> there. We have \"t/t1006-cat-file.sh\" with similar case, but it is\n> about blobs. ref-filter does not work with blobs, I need to write test\n> about refs, and I feel that I can't catch the idea (and it is hard for\n> me to write in Shell).\n>\n> Finally, I want to remove formatting logic in cat-file and use\n> functions from ref-filter (we are almost there, so many work was done\n> for this). I had an idea to make this migration in this patch (and\n> stop worrying about bad tests about deltabase: we already have such\n> test for cat-file and hopefully that could be enough). But I have\n> another question there. cat-file has one more formatting option:\n> \"rest\" [1]. Do we want such formatting option in ref-filter? It's\n> easier for me to support that in ref-filter than to leave it only\n> specifically for cat-file.\n\nUpdates since previous version:\n1. Fix type cast not to generate warnings/errors in other system\nplatforms (travis CI says that everything is OK now)\n2. Add check for negative object size (BUG if it is negative)\n3. Update documentation (thanks to Junio for better wording)\n\n>\n> Thank you!\n>\n> [1] https://git-scm.com/docs/git-cat-file#git-cat-file-coderestcode\n"},{"id":"366481","messageId":"CAL21Bm=stCR8-yJ-eh396veQ2kAoGwLX5ci_T0N-6femAwk4jA@mail.gmail.com","threadId":"49783","inReplyTo":"CAL21BmnmfxpMgbW_Yz9D=FVZk_AzWF0uyrNZeSGPCs63PH1oag@mail.gmail.com","subject":"Re: [PATCH v2 0/5] ref-filter: add new formatting options","fromName":"Оля Тележная","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2019-01-10T06:25:40Z","receivedAt":"2019-01-10T06:31:05Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"пн, 24 дек. 2018 г. в 16:16, Оля Тележная <olyatelezhnaya@gmail.com>:\n>\n> пт, 9 нояб. 2018 г. в 10:37, Оля Тележная <olyatelezhnaya@gmail.com>:\n> >\n> > Add formatting options %(objectsize:disk) and %(deltabase), as in\n> > cat-file command.\n> >\n> > I can not test %(deltabase) properly (I mean, I want to have test with\n> > meaningful deltabase in the result - now we have only with zeros). I\n> > tested it manually on my git repo, and I have not-null deltabases\n> > there. We have \"t/t1006-cat-file.sh\" with similar case, but it is\n> > about blobs. ref-filter does not work with blobs, I need to write test\n> > about refs, and I feel that I can't catch the idea (and it is hard for\n> > me to write in Shell).\n> >\n> > Finally, I want to remove formatting logic in cat-file and use\n> > functions from ref-filter (we are almost there, so many work was done\n> > for this). I had an idea to make this migration in this patch (and\n> > stop worrying about bad tests about deltabase: we already have such\n> > test for cat-file and hopefully that could be enough). But I have\n> > another question there. cat-file has one more formatting option:\n> > \"rest\" [1]. Do we want such formatting option in ref-filter? It's\n> > easier for me to support that in ref-filter than to leave it only\n> > specifically for cat-file.\n>\n> Updates since previous version:\n> 1. Fix type cast not to generate warnings/errors in other system\n> platforms (travis CI says that everything is OK now)\n> 2. Add check for negative object size (BUG if it is negative)\n> 3. Update documentation (thanks to Junio for better wording)\n\nJust fixed 1 cast from (intmax_t) to (uintmax_t).\n\n>\n> >\n> > Thank you!\n> >\n> > [1] https://git-scm.com/docs/git-cat-file#git-cat-file-coderestcode\n"},{"id":"366482","messageId":"0102016836761b8b-8616fc01-3489-4e53-a5b7-cd4b52e20e01-000000@eu-west-1.amazonses.com","threadId":"49783","inReplyTo":"CAL21Bm=stCR8-yJ-eh396veQ2kAoGwLX5ci_T0N-6femAwk4jA@mail.gmail.com","subject":"[PATCH v3 1/6] ref-filter: add objectsize:disk option","fromName":"Olga Telezhnaya","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2019-01-10T06:32:16Z","receivedAt":"2019-01-10T06:32:19Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"Add new formatting option objectsize:disk to know\nexact size that object takes up on disk.\n\nSigned-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>\n---\n ref-filter.c | 23 ++++++++++++++++-------\n 1 file changed, 16 insertions(+), 7 deletions(-)\n\ndiff --git a/ref-filter.c b/ref-filter.c\nindex 61d75d5c86c64..ecef4b47c751c 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -231,12 +231,18 @@ static int objecttype_atom_parser(const struct ref_format *format, struct used_a\n static int objectsize_atom_parser(const struct ref_format *format, struct used_atom *atom,\n \t\t\t\t  const char *arg, struct strbuf *err)\n {\n-\tif (arg)\n-\t\treturn strbuf_addf_ret(err, -1, _(\"%%(objectsize) does not take arguments\"));\n-\tif (*atom->name == '*')\n-\t\toi_deref.info.sizep = &oi_deref.size;\n-\telse\n-\t\toi.info.sizep = &oi.size;\n+\tif (!arg) {\n+\t\tif (*atom->name == '*')\n+\t\t\toi_deref.info.sizep = &oi_deref.size;\n+\t\telse\n+\t\t\toi.info.sizep = &oi.size;\n+\t} else if (!strcmp(arg, \"disk\")) {\n+\t\tif (*atom->name == '*')\n+\t\t\toi_deref.info.disk_sizep = &oi_deref.disk_size;\n+\t\telse\n+\t\t\toi.info.disk_sizep = &oi.disk_size;\n+\t} else\n+\t\treturn strbuf_addf_ret(err, -1, _(\"unrecognized %%(objectsize) argument: %s\"), arg);\n \treturn 0;\n }\n \n@@ -880,7 +886,10 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_\n \t\t\tname++;\n \t\tif (!strcmp(name, \"objecttype\"))\n \t\t\tv->s = xstrdup(type_name(oi->type));\n-\t\telse if (!strcmp(name, \"objectsize\")) {\n+\t\telse if (!strcmp(name, \"objectsize:disk\")) {\n+\t\t\tv->value = oi->disk_size;\n+\t\t\tv->s = xstrfmt(\"%\"PRIuMAX, (uintmax_t)oi->disk_size);\n+\t\t} else if (!strcmp(name, \"objectsize\")) {\n \t\t\tv->value = oi->size;\n \t\t\tv->s = xstrfmt(\"%\"PRIuMAX , (uintmax_t)oi->size);\n \t\t}\n\n--\nhttps://github.com/git/git/pull/552\n"},{"id":"366483","messageId":"0102016836761cc8-509e62da-385f-4288-9503-ef33f1221ea6-000000@eu-west-1.amazonses.com","threadId":"49783","inReplyTo":"0102016836761b8b-8616fc01-3489-4e53-a5b7-cd4b52e20e01-000000@eu-west-1.amazonses.com","subject":"[PATCH v3 5/6] ref-filter: add tests for deltabase","fromName":"Olga Telezhnaya","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2019-01-10T06:32:16Z","receivedAt":"2019-01-10T06:32:19Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"Test new formatting option deltabase.\n\nSigned-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>\n---\n t/t6300-for-each-ref.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh\nindex 097fdf21fe196..0ffd63071392e 100755\n--- a/t/t6300-for-each-ref.sh\n+++ b/t/t6300-for-each-ref.sh\n@@ -84,6 +84,7 @@ test_atom head push:strip=-1 master\n test_atom head objecttype commit\n test_atom head objectsize 171\n test_atom head objectsize:disk 138\n+test_atom head deltabase 0000000000000000000000000000000000000000\n test_atom head objectname $(git rev-parse refs/heads/master)\n test_atom head objectname:short $(git rev-parse --short refs/heads/master)\n test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/master)\n@@ -127,6 +128,8 @@ test_atom tag objecttype tag\n test_atom tag objectsize 154\n test_atom tag objectsize:disk 138\n test_atom tag '*objectsize:disk' 138\n+test_atom tag deltabase 0000000000000000000000000000000000000000\n+test_atom tag '*deltabase' 0000000000000000000000000000000000000000\n test_atom tag objectname $(git rev-parse refs/tags/testtag)\n test_atom tag objectname:short $(git rev-parse --short refs/tags/testtag)\n test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/master)\n\n--\nhttps://github.com/git/git/pull/552\n"},{"id":"366484","messageId":"0102016836761cc9-d3a542af-7089-45c0-a5ae-413ba6909096-000000@eu-west-1.amazonses.com","threadId":"49783","inReplyTo":"0102016836761b8b-8616fc01-3489-4e53-a5b7-cd4b52e20e01-000000@eu-west-1.amazonses.com","subject":"[PATCH v3 4/6] ref-filter: add deltabase option","fromName":"Olga Telezhnaya","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2019-01-10T06:32:16Z","receivedAt":"2019-01-10T06:32:21Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"Add new formatting option: deltabase.\nIf the object is stored as a delta on-disk, this expands\nto the 40-hex sha1 of the delta base object.\nOtherwise, expands to the null sha1 (40 zeroes).\nWe have same option in cat-file command.\nHopefully, in the end I will remove formatting code from\ncat-file and reuse formatting parts from ref-filter.\n\nSigned-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>\n---\n ref-filter.c | 16 +++++++++++++++-\n 1 file changed, 15 insertions(+), 1 deletion(-)\n\ndiff --git a/ref-filter.c b/ref-filter.c\nindex 57f3789d1040d..422a9c9ae3fd2 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -246,6 +246,18 @@ static int objectsize_atom_parser(const struct ref_format *format, struct used_a\n \treturn 0;\n }\n \n+static int deltabase_atom_parser(const struct ref_format *format, struct used_atom *atom,\n+\t\t\t\t const char *arg, struct strbuf *err)\n+{\n+\tif (arg)\n+\t\treturn strbuf_addf_ret(err, -1, _(\"%%(deltabase) does not take arguments\"));\n+\tif (*atom->name == '*')\n+\t\toi_deref.info.delta_base_sha1 = oi_deref.delta_base_oid.hash;\n+\telse\n+\t\toi.info.delta_base_sha1 = oi.delta_base_oid.hash;\n+\treturn 0;\n+}\n+\n static int body_atom_parser(const struct ref_format *format, struct used_atom *atom,\n \t\t\t    const char *arg, struct strbuf *err)\n {\n@@ -437,6 +449,7 @@ static struct {\n \t{ \"objecttype\", SOURCE_OTHER, FIELD_STR, objecttype_atom_parser },\n \t{ \"objectsize\", SOURCE_OTHER, FIELD_ULONG, objectsize_atom_parser },\n \t{ \"objectname\", SOURCE_OTHER, FIELD_STR, objectname_atom_parser },\n+\t{ \"deltabase\", SOURCE_OTHER, FIELD_STR, deltabase_atom_parser },\n \t{ \"tree\", SOURCE_OBJ },\n \t{ \"parent\", SOURCE_OBJ },\n \t{ \"numparent\", SOURCE_OBJ, FIELD_ULONG },\n@@ -892,7 +905,8 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_\n \t\t} else if (!strcmp(name, \"objectsize\")) {\n \t\t\tv->value = oi->size;\n \t\t\tv->s = xstrfmt(\"%\"PRIuMAX , (uintmax_t)oi->size);\n-\t\t}\n+\t\t} else if (!strcmp(name, \"deltabase\"))\n+\t\t\tv->s = xstrdup(oid_to_hex(&oi->delta_base_oid));\n \t\telse if (deref)\n \t\t\tgrab_objectname(name, &oi->oid, v, &used_atom[i]);\n \t}\n\n--\nhttps://github.com/git/git/pull/552\n"},{"id":"366485","messageId":"0102016836761be3-b35028e3-800e-4f54-b608-55cebf6feaa9-000000@eu-west-1.amazonses.com","threadId":"49783","inReplyTo":"0102016836761b8b-8616fc01-3489-4e53-a5b7-cd4b52e20e01-000000@eu-west-1.amazonses.com","subject":"[PATCH v3 2/6] ref-filter: add check for negative file size","fromName":"Olga Telezhnaya","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2019-01-10T06:32:16Z","receivedAt":"2019-01-10T06:32:23Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"If we have negative file size, we are doing something wrong.\n\nSigned-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>\n---\n ref-filter.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/ref-filter.c b/ref-filter.c\nindex ecef4b47c751c..57f3789d1040d 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -1491,6 +1491,8 @@ static int get_object(struct ref_array_item *ref, int deref, struct object **obj\n \t\t\t\t     OBJECT_INFO_LOOKUP_REPLACE))\n \t\treturn strbuf_addf_ret(err, -1, _(\"missing object %s for %s\"),\n \t\t\t\t       oid_to_hex(&oi->oid), ref->refname);\n+\tif (oi->info.disk_sizep && oi->disk_size < 0)\n+\t\tBUG(\"Object size is less than zero.\");\n \n \tif (oi->info.contentp) {\n \t\t*obj = parse_object_buffer(the_repository, &oi->oid, oi->type, oi->size, oi->content, &eaten);\n\n--\nhttps://github.com/git/git/pull/552\n"},{"id":"366486","messageId":"0102016836761c7a-c5b92b9e-ea5a-4032-bd2d-73c67c5b5fef-000000@eu-west-1.amazonses.com","threadId":"49783","inReplyTo":"0102016836761b8b-8616fc01-3489-4e53-a5b7-cd4b52e20e01-000000@eu-west-1.amazonses.com","subject":"[PATCH v3 6/6] ref-filter: add docs for new options","fromName":"Olga Telezhnaya","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2019-01-10T06:32:16Z","receivedAt":"2019-01-10T06:32:24Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"Add documentation for formatting options objectsize:disk\nand deltabase.\n\nSigned-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>\n---\n Documentation/git-for-each-ref.txt | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt\nindex 901faef1bfdce..774cecc7ede78 100644\n--- a/Documentation/git-for-each-ref.txt\n+++ b/Documentation/git-for-each-ref.txt\n@@ -128,13 +128,18 @@ objecttype::\n \n objectsize::\n \tThe size of the object (the same as 'git cat-file -s' reports).\n-\n+\tAppend `:disk` to get the size, in bytes, that the object takes up on\n+\tdisk. See the note about on-disk sizes in the `CAVEATS` section below.\n objectname::\n \tThe object name (aka SHA-1).\n \tFor a non-ambiguous abbreviation of the object name append `:short`.\n \tFor an abbreviation of the object name with desired length append\n \t`:short=<length>`, where the minimum length is MINIMUM_ABBREV. The\n \tlength may be exceeded to ensure unique object names.\n+deltabase::\n+\tThis expands to the object name of the delta base for the\n+\tgiven object, if it is stored as a delta.  Otherwise it\n+\texpands to the null object name (all zeroes).\n \n upstream::\n \tThe name of a local ref which can be considered ``upstream''\n@@ -361,6 +366,20 @@ This prints the authorname, if present.\n git for-each-ref --format=\"%(refname)%(if)%(authorname)%(then) Authored by: %(authorname)%(end)\"\n ------------\n \n+CAVEATS\n+-------\n+\n+Note that the sizes of objects on disk are reported accurately, but care\n+should be taken in drawing conclusions about which refs or objects are\n+responsible for disk usage. The size of a packed non-delta object may be\n+much larger than the size of objects which delta against it, but the\n+choice of which object is the base and which is the delta is arbitrary\n+and is subject to change during a repack.\n+\n+Note also that multiple copies of an object may be present in the object\n+database; in this case, it is undefined which copy's size or delta base\n+will be reported.\n+\n SEE ALSO\n --------\n linkgit:git-show-ref[1]\n\n--\nhttps://github.com/git/git/pull/552\n"},{"id":"366487","messageId":"0102016836761c52-72d7257e-c341-40e7-8e29-216af7b219f9-000000@eu-west-1.amazonses.com","threadId":"49783","inReplyTo":"0102016836761b8b-8616fc01-3489-4e53-a5b7-cd4b52e20e01-000000@eu-west-1.amazonses.com","subject":"[PATCH v3 3/6] ref-filter: add tests for objectsize:disk","fromName":"Olga Telezhnaya","fromEmail":"olyatelezhnaya@gmail.com","sentAt":"2019-01-10T06:32:16Z","receivedAt":"2019-01-10T06:32:26Z","isPatch":true,"sender":{"key":"olyatelezhnaya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/11246099?v=4"},"body":"Test new formatting atom.\n\nSigned-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>\n---\n t/t6300-for-each-ref.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh\nindex 97bfbee6e8d69..097fdf21fe196 100755\n--- a/t/t6300-for-each-ref.sh\n+++ b/t/t6300-for-each-ref.sh\n@@ -83,6 +83,7 @@ test_atom head push:strip=1 remotes/myfork/master\n test_atom head push:strip=-1 master\n test_atom head objecttype commit\n test_atom head objectsize 171\n+test_atom head objectsize:disk 138\n test_atom head objectname $(git rev-parse refs/heads/master)\n test_atom head objectname:short $(git rev-parse --short refs/heads/master)\n test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/master)\n@@ -124,6 +125,8 @@ test_atom tag upstream ''\n test_atom tag push ''\n test_atom tag objecttype tag\n test_atom tag objectsize 154\n+test_atom tag objectsize:disk 138\n+test_atom tag '*objectsize:disk' 138\n test_atom tag objectname $(git rev-parse refs/tags/testtag)\n test_atom tag objectname:short $(git rev-parse --short refs/tags/testtag)\n test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/master)\n\n--\nhttps://github.com/git/git/pull/552\n"},{"id":"366512","messageId":"xmqqpnt42x7s.fsf@gitster-ct.c.googlers.com","threadId":"49783","inReplyTo":"CAL21Bm=stCR8-yJ-eh396veQ2kAoGwLX5ci_T0N-6femAwk4jA@mail.gmail.com","subject":"Re: [PATCH v2 0/5] ref-filter: add new formatting options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-10T18:17:59Z","receivedAt":"2019-01-10T18:18:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Оля Тележная  <olyatelezhnaya@gmail.com> writes:\n\n> Just fixed 1 cast from (intmax_t) to (uintmax_t).\n\nThanks.\n\nAs the previous one already is in 'next', let's queue this on top of\nit instead.\n\n-- >8 --\nSubject: [PATCH] ref-filter: give uintmax_t to format with %PRIuMAX\n\nAs long as we are casting to a wider type, we should cast to the one\nwith the correct signed-ness.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n ref-filter.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/ref-filter.c b/ref-filter.c\nindex d8d3718abb..b22cab133e 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -897,7 +897,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_\n \t\t\tv->s = xstrdup(type_name(oi->type));\n \t\telse if (!strcmp(name, \"objectsize:disk\")) {\n \t\t\tv->value = oi->disk_size;\n-\t\t\tv->s = xstrfmt(\"%\"PRIuMAX, (intmax_t)oi->disk_size);\n+\t\t\tv->s = xstrfmt(\"%\"PRIuMAX, (uintmax_t)oi->disk_size);\n \t\t} else if (!strcmp(name, \"objectsize\")) {\n \t\t\tv->value = oi->size;\n \t\t\tv->s = xstrfmt(\"%lu\", oi->size);\n-- \n2.20.1-98-gecbdaf0899\n\n"}]}