{"thread":{"id":"65018","subject":"[PATCH 0/8] repo: refactoring leftover nits","startedAt":"2026-02-18T21:19:55Z","lastAt":"2026-02-25T19:51:19Z","messageCount":24,"participants":["Lucas Seiki Oshiro","Eric Sunshine","Patrick Steinhardt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"536334","messageId":"20260218211845.96009-1-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":null,"subject":"[PATCH 0/8] repo: refactoring leftover nits","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:36Z","receivedAt":"2026-02-18T21:19:55Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Hi!\n\nThis patchset refactors git-repo-info after some suggestions and after the\nintroduction of git-repo-structure. These changes were made:\n\n1. CodingGuidelines now contains a instruction for naming arrays in\n   singular (based on [1])\n\n2. Rename a variable to its singular form in repo.c (based on [1])\n\n3. Replace the function `get_value_fn_for_key` by a new function\n   `get_repo_info_field` and make the structure of the function `print_fields` closer to the\n   function `print_all_fields` (based on [1])\n\n4. Rename the struct `field` to `repo_info_field` (after git-repo-structure)\n\n5. Rename t1900-repo to t1900-repo-info (after git-repo-structure)\n\n6. Use `tr` in output instead of the expected value (based on [2])\n\n7. Replace `NUL` by `_NUL_` in the documentation (based on [3])\n\n8. Capitalize some paragraphs in the documentation (based on [4])\n\nThis patch is based on top of master 59438b41ab (Merge branch 'master' of\ngithub.com:git/git, 2026-02-18) with lo/repo-info-keys merged.\n\n[1] xmqqh5usiizp.fsf@gitster.g\n[2] xmqqh5txfv7b.fsf@gitster.g\n[3] 12814829.O9o76ZdvQC@piment-oiseau\n[4] aXhiIQXBvMhzkFy9@pks.im\n\nLucas Seiki Oshiro (8):\n  CodingGuidelines: instruct to name arrays in singular\n  repo: rename repo_info_fields to repo_info_field\n  repo: replace get_value_fn_for_key by get_repo_info_field\n  repo: rename struct field to repo_info_field\n  t1900: rename t1900-repo to t1900-repo-info\n  t1901: use tr in git repo structure output instead of expected value\n  Documentation/git-repo: replace 'NUL' with '_NUL_'\n  Documentation/git-repo: capitalize format descriptions\n\n Documentation/CodingGuidelines          |  8 +++++\n Documentation/git-repo.adoc             |  8 ++---\n builtin/repo.c                          | 44 ++++++++++++-------------\n t/meson.build                           |  2 +-\n t/{t1900-repo.sh => t1900-repo-info.sh} |  0\n t/t1901-repo-structure.sh               |  8 ++---\n 6 files changed, 39 insertions(+), 31 deletions(-)\n rename t/{t1900-repo.sh => t1900-repo-info.sh} (100%)\n\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536335","messageId":"20260218211845.96009-2-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 1/8] CodingGuidelines: instruct to name arrays in singular","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:37Z","receivedAt":"2026-02-18T21:19:58Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Arrays should be named in the singular form, ensuring that when\naccessing an element within an array (e.g. dog[0]) it's clear that\nwe're referring to an element instead of a collection.\n\nAdd a new rule to CodingGuidelines asking for arrays to be named in\nsingular instead of plural.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n Documentation/CodingGuidelines | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex df72fe0177..0158c57277 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -656,6 +656,14 @@ For C programs:\n    unsigned other_field:1;\n    unsigned field_with_longer_name:1;\n \n+ - Array names should be named in the singular form. E.g.:\n+\n+         char *dog[] = ...;\n+\n+   and not:\n+\n+         char *dogs[] = ...;\n+\n For Perl programs:\n \n  - Most of the C guidelines above apply.\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536336","messageId":"20260218211845.96009-3-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 2/8] repo: rename repo_info_fields to repo_info_field","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:38Z","receivedAt":"2026-02-18T21:20:01Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Rename repo_info_fields as repo_info_field, following the CodingGuidelines rule\nfor naming arrays in singular. Rename all the references to that array\naccordingly.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/repo.c | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex 6a62a6020a..aa9a154cd2 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -62,15 +62,15 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)\n \treturn 0;\n }\n \n-/* repo_info_fields keys must be in lexicographical order */\n-static const struct field repo_info_fields[] = {\n+/* repo_info_field keys must be in lexicographical order */\n+static const struct field repo_info_field[] = {\n \t{ \"layout.bare\", get_layout_bare },\n \t{ \"layout.shallow\", get_layout_shallow },\n \t{ \"object.format\", get_object_format },\n \t{ \"references.format\", get_references_format },\n };\n \n-static int repo_info_fields_cmp(const void *va, const void *vb)\n+static int repo_info_field_cmp(const void *va, const void *vb)\n {\n \tconst struct field *a = va;\n \tconst struct field *b = vb;\n@@ -81,10 +81,10 @@ static int repo_info_fields_cmp(const void *va, const void *vb)\n static get_value_fn *get_value_fn_for_key(const char *key)\n {\n \tconst struct field search_key = { key, NULL };\n-\tconst struct field *found = bsearch(&search_key, repo_info_fields,\n-\t\t\t\t\t    ARRAY_SIZE(repo_info_fields),\n+\tconst struct field *found = bsearch(&search_key, repo_info_field,\n+\t\t\t\t\t    ARRAY_SIZE(repo_info_field),\n \t\t\t\t\t    sizeof(*found),\n-\t\t\t\t\t    repo_info_fields_cmp);\n+\t\t\t\t\t    repo_info_field_cmp);\n \treturn found ? found->get_value : NULL;\n }\n \n@@ -137,8 +137,8 @@ static int print_all_fields(struct repository *repo,\n {\n \tstruct strbuf valbuf = STRBUF_INIT;\n \n-\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {\n-\t\tconst struct field *field = &repo_info_fields[i];\n+\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n+\t\tconst struct field *field = &repo_info_field[i];\n \n \t\tstrbuf_reset(&valbuf);\n \t\tfield->get_value(repo, &valbuf);\n@@ -164,8 +164,8 @@ static int print_keys(enum output_format format)\n \t\tdie(_(\"--keys can only be used with --format=lines or --format=nul\"));\n \t}\n \n-\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {\n-\t\tconst struct field *field = &repo_info_fields[i];\n+\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n+\t\tconst struct field *field = &repo_info_field[i];\n \t\tprintf(\"%s%c\", field->key, sep);\n \t}\n \n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536337","messageId":"20260218211845.96009-4-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 3/8] repo: replace get_value_fn_for_key by get_repo_info_field","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:39Z","receivedAt":"2026-02-18T21:20:04Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Remove the function `get_value_fn_for_key`, which returns a function that\nretrieves a value for a certain repo info key. Introduce `get_repo_info_field`\ninstead, which returns a struct field.\n\nThis refactor makes the structure of the function print_fields more consistent\nto the function print_all_fields, improving its readability.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/repo.c | 13 ++++++-------\n 1 file changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex aa9a154cd2..c60a41ba7b 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -78,14 +78,15 @@ static int repo_info_field_cmp(const void *va, const void *vb)\n \treturn strcmp(a->key, b->key);\n }\n \n-static get_value_fn *get_value_fn_for_key(const char *key)\n+static const struct field *get_repo_info_field(const char *key)\n {\n \tconst struct field search_key = { key, NULL };\n \tconst struct field *found = bsearch(&search_key, repo_info_field,\n \t\t\t\t\t    ARRAY_SIZE(repo_info_field),\n \t\t\t\t\t    sizeof(*found),\n \t\t\t\t\t    repo_info_field_cmp);\n-\treturn found ? found->get_value : NULL;\n+\n+\treturn found;\n }\n \n static void print_field(enum output_format format, const char *key,\n@@ -113,18 +114,16 @@ static int print_fields(int argc, const char **argv,\n \tstruct strbuf valbuf = STRBUF_INIT;\n \n \tfor (int i = 0; i < argc; i++) {\n-\t\tget_value_fn *get_value;\n \t\tconst char *key = argv[i];\n+\t\tconst struct field *field = get_repo_info_field(key);\n \n-\t\tget_value = get_value_fn_for_key(key);\n-\n-\t\tif (!get_value) {\n+\t\tif (!field) {\n \t\t\tret = error(_(\"key '%s' not found\"), key);\n \t\t\tcontinue;\n \t\t}\n \n \t\tstrbuf_reset(&valbuf);\n-\t\tget_value(repo, &valbuf);\n+\t\tfield->get_value(repo, &valbuf);\n \t\tprint_field(format, key, valbuf.buf);\n \t}\n \n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536338","messageId":"20260218211845.96009-5-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 4/8] repo: rename struct field to repo_info_field","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:40Z","receivedAt":"2026-02-18T21:20:09Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Change the name of the struct field to repo_info_field, making it\nexplicit that it is an internal data type of git-repo-info.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/repo.c | 27 ++++++++++++++-------------\n 1 file changed, 14 insertions(+), 13 deletions(-)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex c60a41ba7b..f943be7451 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -31,7 +31,7 @@ enum output_format {\n \tFORMAT_NUL_TERMINATED,\n };\n \n-struct field {\n+struct repo_info_field {\n \tconst char *key;\n \tget_value_fn *get_value;\n };\n@@ -63,7 +63,7 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)\n }\n \n /* repo_info_field keys must be in lexicographical order */\n-static const struct field repo_info_field[] = {\n+static const struct repo_info_field repo_info_field[] = {\n \t{ \"layout.bare\", get_layout_bare },\n \t{ \"layout.shallow\", get_layout_shallow },\n \t{ \"object.format\", get_object_format },\n@@ -72,19 +72,20 @@ static const struct field repo_info_field[] = {\n \n static int repo_info_field_cmp(const void *va, const void *vb)\n {\n-\tconst struct field *a = va;\n-\tconst struct field *b = vb;\n+\tconst struct repo_info_field *a = va;\n+\tconst struct repo_info_field *b = vb;\n \n \treturn strcmp(a->key, b->key);\n }\n \n-static const struct field *get_repo_info_field(const char *key)\n+static const struct repo_info_field *get_repo_info_field(const char *key)\n {\n-\tconst struct field search_key = { key, NULL };\n-\tconst struct field *found = bsearch(&search_key, repo_info_field,\n-\t\t\t\t\t    ARRAY_SIZE(repo_info_field),\n-\t\t\t\t\t    sizeof(*found),\n-\t\t\t\t\t    repo_info_field_cmp);\n+\tconst struct repo_info_field search_key = { key, NULL };\n+\tconst struct repo_info_field *found = bsearch(&search_key,\n+\t\t\t\t\t\t      repo_info_field,\n+\t\t\t\t\t\t      ARRAY_SIZE(repo_info_field),\n+\t\t\t\t\t\t      sizeof(*found),\n+\t\t\t\t\t\t      repo_info_field_cmp);\n \n \treturn found;\n }\n@@ -115,7 +116,7 @@ static int print_fields(int argc, const char **argv,\n \n \tfor (int i = 0; i < argc; i++) {\n \t\tconst char *key = argv[i];\n-\t\tconst struct field *field = get_repo_info_field(key);\n+\t\tconst struct repo_info_field *field = get_repo_info_field(key);\n \n \t\tif (!field) {\n \t\t\tret = error(_(\"key '%s' not found\"), key);\n@@ -137,7 +138,7 @@ static int print_all_fields(struct repository *repo,\n \tstruct strbuf valbuf = STRBUF_INIT;\n \n \tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n-\t\tconst struct field *field = &repo_info_field[i];\n+\t\tconst struct repo_info_field *field = &repo_info_field[i];\n \n \t\tstrbuf_reset(&valbuf);\n \t\tfield->get_value(repo, &valbuf);\n@@ -164,7 +165,7 @@ static int print_keys(enum output_format format)\n \t}\n \n \tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n-\t\tconst struct field *field = &repo_info_field[i];\n+\t\tconst struct repo_info_field *field = &repo_info_field[i];\n \t\tprintf(\"%s%c\", field->key, sep);\n \t}\n \n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536339","messageId":"20260218211845.96009-6-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 5/8] t1900: rename t1900-repo to t1900-repo-info","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:41Z","receivedAt":"2026-02-18T21:20:11Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Since the commit bbb2b93348 (builtin/repo: introduce structure subcommand,\n2025-10-21), t1901 specifically tests git-repo-structure. Rename\nt1900-repo to t1900-repo-info to clarify that it focus solely on\ngit-repo-info subcommand.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n t/meson.build                           | 2 +-\n t/{t1900-repo.sh => t1900-repo-info.sh} | 0\n 2 files changed, 1 insertion(+), 1 deletion(-)\n rename t/{t1900-repo.sh => t1900-repo-info.sh} (100%)\n\ndiff --git a/t/meson.build b/t/meson.build\nindex f80e366cff..9867762bac 100644\n--- a/t/meson.build\n+++ b/t/meson.build\n@@ -240,7 +240,7 @@ integration_tests = [\n   't1700-split-index.sh',\n   't1701-racy-split-index.sh',\n   't1800-hook.sh',\n-  't1900-repo.sh',\n+  't1900-repo-info.sh',\n   't1901-repo-structure.sh',\n   't2000-conflict-when-checking-files-out.sh',\n   't2002-checkout-cache-u.sh',\ndiff --git a/t/t1900-repo.sh b/t/t1900-repo-info.sh\nsimilarity index 100%\nrename from t/t1900-repo.sh\nrename to t/t1900-repo-info.sh\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536340","messageId":"20260218211845.96009-7-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 6/8] t1901: use tr in git repo structure output instead of expected value","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:42Z","receivedAt":"2026-02-18T21:20:14Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"The test 'keyvalue and nul format', as it description says, test both\nkeyvalue and nul format. These formats are similar, differing only in\ntheir field separator (= in the former, LF in the latter) and their\nrecord separator (LF in the former, NUL in the latter). This way, both\nformats can be tested using the same expected output and only replacing\nthe separators in one of the output formats.\n\nAdjust the output of `git repo structure --format=nul` in t1901, matching the\n--format=keyvalue ones. Compare this output against the same value expected\nfrom --format=keyvalue.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n t/t1901-repo-structure.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh\nindex a6f2591d9a..4de795181f 100755\n--- a/t/t1901-repo-structure.sh\n+++ b/t/t1901-repo-structure.sh\n@@ -145,18 +145,18 @@ test_expect_success SHA1 'lines and nul format' '\n \t\ttest_cmp expect out &&\n \t\ttest_line_count = 0 err &&\n \n-\t\t# Replace key and value delimiters for nul format.\n-\t\ttr \"\\n=\" \"\\0\\n\" <expect >expect_nul &&\n \t\tgit repo structure --format=nul >out 2>err &&\n+\t\ttr \"\\012\" \"=\" <out | tr \"\\000\" \"\\012\" >actual &&\n \n-\t\ttest_cmp expect_nul out &&\n+\t\ttest_cmp expect actual &&\n \t\ttest_line_count = 0 err &&\n \n \t\t# \"-z\", as a synonym to \"--format=nul\", participates in the\n \t\t# usual \"last one wins\" rule.\n \t\tgit repo structure --format=table -z >out 2>err &&\n+\t\ttr \"\\012\" \"=\" <out | tr \"\\000\" \"\\012\" >actual &&\n \n-\t\ttest_cmp expect_nul out &&\n+\t\ttest_cmp expect actual &&\n \t\ttest_line_count = 0 err\n \t)\n '\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536341","messageId":"20260218211845.96009-8-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 7/8] Documentation/git-repo: replace 'NUL' with '_NUL_'","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:43Z","receivedAt":"2026-02-18T21:20:18Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Replace all occurrences of \"NUL\" by \"_NUL_\" in git-repo.adoc, following the\nconvention used by other documentation files.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n Documentation/git-repo.adoc | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc\nindex 319d30bd86..f76f579b20 100644\n--- a/Documentation/git-repo.adoc\n+++ b/Documentation/git-repo.adoc\n@@ -40,7 +40,7 @@ supported:\n \n `nul`:::\n \tsimilar to `lines`, but using a newline character as the delimiter\n-\tbetween the key and the value and using a NUL character after each value.\n+\tbetween the key and the value and using a _NUL_ character after each value.\n \tThis format is better suited for being parsed by another applications than\n \t`lines`. Unlike in the `lines` format, the values are never quoted.\n +\n@@ -80,7 +80,7 @@ supported:\n \tconfiguration variable `core.quotePath` (see linkgit:git-config[1]).\n \n `nul`:::\n-\tSimilar to `lines`, but uses a NUL character to delimit between\n+\tSimilar to `lines`, but uses a _NUL_ character to delimit between\n \tkey-value pairs instead of a newline. Also uses a newline character as\n \tthe delimiter between the key and value instead of '='. Unlike the\n \t`lines` format, values containing \"unusual\" characters are never\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536342","messageId":"20260218211845.96009-9-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH 8/8] Documentation/git-repo: capitalize format descriptions","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-18T21:08:44Z","receivedAt":"2026-02-18T21:20:21Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"The descriptions for the git-repo output formats are in lowercase.\nCapitalize these descriptions, making them consistent with the rest of\nthe documentation.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n Documentation/git-repo.adoc | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc\nindex f76f579b20..5e2968b707 100644\n--- a/Documentation/git-repo.adoc\n+++ b/Documentation/git-repo.adoc\n@@ -33,13 +33,13 @@ supported:\n +\n \n `lines`:::\n-\toutput key-value pairs one per line using the `=` character as\n+\tOutput key-value pairs one per line using the `=` character as\n \tthe delimiter between the key and the value. Values containing \"unusual\"\n \tcharacters are quoted as explained for the configuration variable\n \t`core.quotePath` (see linkgit:git-config[1]). This is the default.\n \n `nul`:::\n-\tsimilar to `lines`, but using a newline character as the delimiter\n+\tSimilar to `lines`, but using a newline character as the delimiter\n \tbetween the key and the value and using a _NUL_ character after each value.\n \tThis format is better suited for being parsed by another applications than\n \t`lines`. Unlike in the `lines` format, the values are never quoted.\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"536364","messageId":"CAPig+cRHm1vDABoHNKiuBRRsvk90Z1qGeeu3DT3VHdzEfJeP=g@mail.gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-2-lucasseikioshiro@gmail.com","subject":"Re: [PATCH 1/8] CodingGuidelines: instruct to name arrays in singular","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2026-02-19T03:29:27Z","receivedAt":"2026-02-19T03:29:39Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Feb 18, 2026 at 4:20 PM Lucas Seiki Oshiro\n<lucasseikioshiro@gmail.com> wrote:\n> Arrays should be named in the singular form, ensuring that when\n> accessing an element within an array (e.g. dog[0]) it's clear that\n> we're referring to an element instead of a collection.\n>\n> Add a new rule to CodingGuidelines asking for arrays to be named in\n> singular instead of plural.\n>\n> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n> ---\n> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\n> @@ -656,6 +656,14 @@ For C programs:\n> + - Array names should be named in the singular form. E.g.:\n> +\n> +         char *dog[] = ...;\n> +\n> +   and not:\n> +\n> +         char *dogs[] = ...;\n> +\n\nWhile this is generally true on this project, it is nevertheless\nincomplete. More specifically, the singular form is used for an array\nname in cases when the individual items of the array are the typical\nsubject of use, for instance, when the consumer of the array is\nwalking the dogs one at a time. However, there are cases in which the\narray is generally employed as a whole, rather than as its unit parts,\nin which the plural form for the name is preferable. An example would\nbe when walking all the dogs at the same time.\n"},{"id":"536496","messageId":"aZgzmlVfuXgI2UJ9@pks.im","threadId":"65018","inReplyTo":"20260218211845.96009-7-lucasseikioshiro@gmail.com","subject":"Re: [PATCH 6/8] t1901: use tr in git repo structure output instead of expected value","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T10:12:42Z","receivedAt":"2026-02-20T10:12:51Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Feb 18, 2026 at 06:08:42PM -0300, Lucas Seiki Oshiro wrote:\n> The test 'keyvalue and nul format', as it description says, test both\n> keyvalue and nul format. These formats are similar, differing only in\n> their field separator (= in the former, LF in the latter) and their\n> record separator (LF in the former, NUL in the latter). This way, both\n> formats can be tested using the same expected output and only replacing\n> the separators in one of the output formats.\n\nHm, okay. I have to admit I don't quite understand what we gain here. We\nhave to use tr(1) regardless of how we do it, and I cannot see that\neither of these alternatives is clearly superior compared to the other.\n\n> diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh\n> index a6f2591d9a..4de795181f 100755\n> --- a/t/t1901-repo-structure.sh\n> +++ b/t/t1901-repo-structure.sh\n> @@ -145,18 +145,18 @@ test_expect_success SHA1 'lines and nul format' '\n>  \t\ttest_cmp expect out &&\n>  \t\ttest_line_count = 0 err &&\n>  \n> -\t\t# Replace key and value delimiters for nul format.\n> -\t\ttr \"\\n=\" \"\\0\\n\" <expect >expect_nul &&\n>  \t\tgit repo structure --format=nul >out 2>err &&\n> +\t\ttr \"\\012\" \"=\" <out | tr \"\\000\" \"\\012\" >actual &&\n\nWe can combine the two calls to tr(1) to a single one.\n\n> -\t\ttest_cmp expect_nul out &&\n> +\t\ttest_cmp expect actual &&\n>  \t\ttest_line_count = 0 err &&\n>  \n>  \t\t# \"-z\", as a synonym to \"--format=nul\", participates in the\n>  \t\t# usual \"last one wins\" rule.\n>  \t\tgit repo structure --format=table -z >out 2>err &&\n> +\t\ttr \"\\012\" \"=\" <out | tr \"\\000\" \"\\012\" >actual &&\n\nSame here.\n\nPatrick\n"},{"id":"536669","messageId":"776CC19F-6FF2-478A-A454-F62F9EB09ED5@gmail.com","threadId":"65018","inReplyTo":"CAPig+cRHm1vDABoHNKiuBRRsvk90Z1qGeeu3DT3VHdzEfJeP=g@mail.gmail.com","subject":"Re: [PATCH 1/8] CodingGuidelines: instruct to name arrays in singular","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-22T21:43:17Z","receivedAt":"2026-02-22T21:43:33Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"> While this is generally true on this project, it is nevertheless\n> incomplete. More specifically, the singular form is used for an array\n> name in cases when the individual items of the array are the typical\n> subject of use, for instance, when the consumer of the array is\n> walking the dogs one at a time. However, there are cases in which the\n> array is generally employed as a whole, rather than as its unit parts,\n> in which the plural form for the name is preferable. An example would\n> be when walking all the dogs at the same time.\n\nThanks, Eric!\n\nYou explanation was very clear, and I'll use parts of it in the next\nversion, giving credits to you, of course.\n"},{"id":"536671","messageId":"052D94B7-D26B-4308-8349-159F16BDA6CC@gmail.com","threadId":"65018","inReplyTo":"aZgzmlVfuXgI2UJ9@pks.im","subject":"Re: [PATCH 6/8] t1901: use tr in git repo structure output instead of expected value","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-22T22:35:19Z","receivedAt":"2026-02-22T22:35:33Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"\n>> The test 'keyvalue and nul format', as it description says, test both\n>> keyvalue and nul format. These formats are similar, differing only in\n>> their field separator (= in the former, LF in the latter) and their\n>> record separator (LF in the former, NUL in the latter). This way, both\n>> formats can be tested using the same expected output and only replacing\n>> the separators in one of the output formats.\n> \n> Hm, okay. I have to admit I don't quite understand what we gain here. We\n> have to use tr(1) regardless of how we do it, and I cannot see that\n> either of these alternatives is clearly superior compared to the other.\n\nI should be clearer about this in my description. Of course, both\napproaches work here but this won't output a NUL character if the test\nfails, which could be considered as a binary file to diff.\n\nActually, this is something that Junio saw in a previous patch, and this\nwas his comment about it [1]:\n\n> * Instead of munging the expected file so that it contains a NUL,\n>   and compare the actual output with it, munge the NUL terminated\n>   outout to make it text and compare with the expected file in text\n>   format. This matters when tests start to fail as test_cmp will\n>   show the \"diff\" output when it fails, and comparing NUL\n>   terminated files, which are \"binary\" in the eyes of the \"diff\"\n>   utility.\n\nBut anyway, I'll make it clear in my next version.\n\nThanks!\n\n[1] xmqqh5txfv7b.fsf@gitster.g\n"},{"id":"537112","messageId":"20260225183559.79303-1-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260218211845.96009-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 0/8] repo: refactoring leftover nits","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:09Z","receivedAt":"2026-02-25T18:36:57Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Hi!\n\nThere are only three changes in this version:\n\n1. Applying Eric's suggestion of instructing to name array plural if we're\n   dealing with the values as a whole\n2. Making it clear why we should replace the NUL characters in the files\n   consumed by tes_cmp\n3. Replacing characters in just one tr call instead of two\n\nLucas Seiki Oshiro (8):\n  CodingGuidelines: instruct to name arrays in singular\n  repo: rename repo_info_fields to repo_info_field\n  repo: replace get_value_fn_for_key by get_repo_info_field\n  repo: rename struct field to repo_info_field\n  t1900: rename t1900-repo to t1900-repo-info\n  t1901: adjust nul format output instead of expected value\n  Documentation/git-repo: replace 'NUL' with '_NUL_'\n  Documentation/git-repo: capitalize format descriptions\n\n Documentation/CodingGuidelines          | 13 ++++++++\n Documentation/git-repo.adoc             |  8 ++---\n builtin/repo.c                          | 44 ++++++++++++-------------\n t/meson.build                           |  2 +-\n t/{t1900-repo.sh => t1900-repo-info.sh} |  0\n t/t1901-repo-structure.sh               |  8 ++---\n 6 files changed, 44 insertions(+), 31 deletions(-)\n rename t/{t1900-repo.sh => t1900-repo-info.sh} (100%)\n\nRange-diff against v1:\n1:  041d00fdbf ! 1:  51cfa0901e CodingGuidelines: instruct to name arrays in singular\n    @@ Commit message\n         Add a new rule to CodingGuidelines asking for arrays to be named in\n         singular instead of plural.\n     \n    +    Helped-by: Eric Sunshine <sunshine@sunshineco.com>\n         Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n     \n      ## Documentation/CodingGuidelines ##\n    @@ Documentation/CodingGuidelines: For C programs:\n         unsigned other_field:1;\n         unsigned field_with_longer_name:1;\n      \n    -+ - Array names should be named in the singular form. E.g.:\n    ++ - Array names should be named in the singular form if the individual items are\n    ++   subject of use. E.g.:\n     +\n     +         char *dog[] = ...;\n    ++         walk_dog(dog[0]);\n    ++         walk_dog(dog[1]);\n     +\n    -+   and not:\n    ++   Cases where the array is employed as a whole rather than as its unit parts,\n    ++   the plural forms is preferable. E.g:\n     +\n     +         char *dogs[] = ...;\n    ++         walk_all_dogs(dogs);\n     +\n      For Perl programs:\n      \n2:  ccf0e85919 = 2:  35feb400af repo: rename repo_info_fields to repo_info_field\n3:  eccfcf8164 = 3:  f2926725a2 repo: replace get_value_fn_for_key by get_repo_info_field\n4:  b360e3ea11 = 4:  03874e8021 repo: rename struct field to repo_info_field\n5:  3c4ae0550d = 5:  02682a08e7 t1900: rename t1900-repo to t1900-repo-info\n6:  63b516b424 ! 6:  10accd800a t1901: use tr in git repo structure output instead of expected value\n    @@ Metadata\n     Author: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n     \n      ## Commit message ##\n    -    t1901: use tr in git repo structure output instead of expected value\n    +    t1901: adjust nul format output instead of expected value\n     \n         The test 'keyvalue and nul format', as it description says, test both\n    -    keyvalue and nul format. These formats are similar, differing only in\n    +    `keyvalue` and `nul` format. These formats are similar, differing only in\n         their field separator (= in the former, LF in the latter) and their\n         record separator (LF in the former, NUL in the latter). This way, both\n         formats can be tested using the same expected output and only replacing\n         the separators in one of the output formats.\n     \n    +    However, it is not desirable to have a NUL character in the files\n    +    compared by test_cmp because, if that assetion fails, diff will consider\n    +    them binary files and won't display the differences properly.\n    +\n         Adjust the output of `git repo structure --format=nul` in t1901, matching the\n         --format=keyvalue ones. Compare this output against the same value expected\n    -    from --format=keyvalue.\n    +    from --format=keyvalue, without using files with NUL characters in\n    +    test_cmp.\n     \n         Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n     \n    @@ t/t1901-repo-structure.sh: test_expect_success SHA1 'lines and nul format' '\n     -\t\t# Replace key and value delimiters for nul format.\n     -\t\ttr \"\\n=\" \"\\0\\n\" <expect >expect_nul &&\n      \t\tgit repo structure --format=nul >out 2>err &&\n    -+\t\ttr \"\\012\" \"=\" <out | tr \"\\000\" \"\\012\" >actual &&\n    ++\t\ttr \"\\012\\000\" \"=\\012\" <out >actual &&\n      \n     -\t\ttest_cmp expect_nul out &&\n     +\t\ttest_cmp expect actual &&\n    @@ t/t1901-repo-structure.sh: test_expect_success SHA1 'lines and nul format' '\n      \t\t# \"-z\", as a synonym to \"--format=nul\", participates in the\n      \t\t# usual \"last one wins\" rule.\n      \t\tgit repo structure --format=table -z >out 2>err &&\n    -+\t\ttr \"\\012\" \"=\" <out | tr \"\\000\" \"\\012\" >actual &&\n    ++\t\ttr \"\\012\\000\" \"=\\012\" <out >actual &&\n      \n     -\t\ttest_cmp expect_nul out &&\n     +\t\ttest_cmp expect actual &&\n7:  6e0be4e746 = 7:  508a2af2e3 Documentation/git-repo: replace 'NUL' with '_NUL_'\n8:  e4125e2370 = 8:  cbf17b7abd Documentation/git-repo: capitalize format descriptions\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537113","messageId":"20260225183559.79303-2-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 1/8] CodingGuidelines: instruct to name arrays in singular","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:10Z","receivedAt":"2026-02-25T18:37:00Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Arrays should be named in the singular form, ensuring that when\naccessing an element within an array (e.g. dog[0]) it's clear that\nwe're referring to an element instead of a collection.\n\nAdd a new rule to CodingGuidelines asking for arrays to be named in\nsingular instead of plural.\n\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n Documentation/CodingGuidelines | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 51cb70b515..6c595696a5 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -658,6 +658,19 @@ For C programs:\n    unsigned other_field:1;\n    unsigned field_with_longer_name:1;\n \n+ - Array names should be named in the singular form if the individual items are\n+   subject of use. E.g.:\n+\n+         char *dog[] = ...;\n+         walk_dog(dog[0]);\n+         walk_dog(dog[1]);\n+\n+   Cases where the array is employed as a whole rather than as its unit parts,\n+   the plural forms is preferable. E.g:\n+\n+         char *dogs[] = ...;\n+         walk_all_dogs(dogs);\n+\n For Perl programs:\n \n  - Most of the C guidelines above apply.\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537114","messageId":"20260225183559.79303-3-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 2/8] repo: rename repo_info_fields to repo_info_field","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:11Z","receivedAt":"2026-02-25T18:37:03Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Rename repo_info_fields as repo_info_field, following the CodingGuidelines rule\nfor naming arrays in singular. Rename all the references to that array\naccordingly.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/repo.c | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex 6a62a6020a..aa9a154cd2 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -62,15 +62,15 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)\n \treturn 0;\n }\n \n-/* repo_info_fields keys must be in lexicographical order */\n-static const struct field repo_info_fields[] = {\n+/* repo_info_field keys must be in lexicographical order */\n+static const struct field repo_info_field[] = {\n \t{ \"layout.bare\", get_layout_bare },\n \t{ \"layout.shallow\", get_layout_shallow },\n \t{ \"object.format\", get_object_format },\n \t{ \"references.format\", get_references_format },\n };\n \n-static int repo_info_fields_cmp(const void *va, const void *vb)\n+static int repo_info_field_cmp(const void *va, const void *vb)\n {\n \tconst struct field *a = va;\n \tconst struct field *b = vb;\n@@ -81,10 +81,10 @@ static int repo_info_fields_cmp(const void *va, const void *vb)\n static get_value_fn *get_value_fn_for_key(const char *key)\n {\n \tconst struct field search_key = { key, NULL };\n-\tconst struct field *found = bsearch(&search_key, repo_info_fields,\n-\t\t\t\t\t    ARRAY_SIZE(repo_info_fields),\n+\tconst struct field *found = bsearch(&search_key, repo_info_field,\n+\t\t\t\t\t    ARRAY_SIZE(repo_info_field),\n \t\t\t\t\t    sizeof(*found),\n-\t\t\t\t\t    repo_info_fields_cmp);\n+\t\t\t\t\t    repo_info_field_cmp);\n \treturn found ? found->get_value : NULL;\n }\n \n@@ -137,8 +137,8 @@ static int print_all_fields(struct repository *repo,\n {\n \tstruct strbuf valbuf = STRBUF_INIT;\n \n-\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {\n-\t\tconst struct field *field = &repo_info_fields[i];\n+\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n+\t\tconst struct field *field = &repo_info_field[i];\n \n \t\tstrbuf_reset(&valbuf);\n \t\tfield->get_value(repo, &valbuf);\n@@ -164,8 +164,8 @@ static int print_keys(enum output_format format)\n \t\tdie(_(\"--keys can only be used with --format=lines or --format=nul\"));\n \t}\n \n-\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_fields); i++) {\n-\t\tconst struct field *field = &repo_info_fields[i];\n+\tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n+\t\tconst struct field *field = &repo_info_field[i];\n \t\tprintf(\"%s%c\", field->key, sep);\n \t}\n \n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537115","messageId":"20260225183559.79303-4-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 3/8] repo: replace get_value_fn_for_key by get_repo_info_field","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:12Z","receivedAt":"2026-02-25T18:37:06Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Remove the function `get_value_fn_for_key`, which returns a function that\nretrieves a value for a certain repo info key. Introduce `get_repo_info_field`\ninstead, which returns a struct field.\n\nThis refactor makes the structure of the function print_fields more consistent\nto the function print_all_fields, improving its readability.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/repo.c | 13 ++++++-------\n 1 file changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex aa9a154cd2..c60a41ba7b 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -78,14 +78,15 @@ static int repo_info_field_cmp(const void *va, const void *vb)\n \treturn strcmp(a->key, b->key);\n }\n \n-static get_value_fn *get_value_fn_for_key(const char *key)\n+static const struct field *get_repo_info_field(const char *key)\n {\n \tconst struct field search_key = { key, NULL };\n \tconst struct field *found = bsearch(&search_key, repo_info_field,\n \t\t\t\t\t    ARRAY_SIZE(repo_info_field),\n \t\t\t\t\t    sizeof(*found),\n \t\t\t\t\t    repo_info_field_cmp);\n-\treturn found ? found->get_value : NULL;\n+\n+\treturn found;\n }\n \n static void print_field(enum output_format format, const char *key,\n@@ -113,18 +114,16 @@ static int print_fields(int argc, const char **argv,\n \tstruct strbuf valbuf = STRBUF_INIT;\n \n \tfor (int i = 0; i < argc; i++) {\n-\t\tget_value_fn *get_value;\n \t\tconst char *key = argv[i];\n+\t\tconst struct field *field = get_repo_info_field(key);\n \n-\t\tget_value = get_value_fn_for_key(key);\n-\n-\t\tif (!get_value) {\n+\t\tif (!field) {\n \t\t\tret = error(_(\"key '%s' not found\"), key);\n \t\t\tcontinue;\n \t\t}\n \n \t\tstrbuf_reset(&valbuf);\n-\t\tget_value(repo, &valbuf);\n+\t\tfield->get_value(repo, &valbuf);\n \t\tprint_field(format, key, valbuf.buf);\n \t}\n \n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537116","messageId":"20260225183559.79303-5-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 4/8] repo: rename struct field to repo_info_field","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:13Z","receivedAt":"2026-02-25T18:37:09Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Change the name of the struct field to repo_info_field, making it\nexplicit that it is an internal data type of git-repo-info.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/repo.c | 27 ++++++++++++++-------------\n 1 file changed, 14 insertions(+), 13 deletions(-)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex c60a41ba7b..f943be7451 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -31,7 +31,7 @@ enum output_format {\n \tFORMAT_NUL_TERMINATED,\n };\n \n-struct field {\n+struct repo_info_field {\n \tconst char *key;\n \tget_value_fn *get_value;\n };\n@@ -63,7 +63,7 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)\n }\n \n /* repo_info_field keys must be in lexicographical order */\n-static const struct field repo_info_field[] = {\n+static const struct repo_info_field repo_info_field[] = {\n \t{ \"layout.bare\", get_layout_bare },\n \t{ \"layout.shallow\", get_layout_shallow },\n \t{ \"object.format\", get_object_format },\n@@ -72,19 +72,20 @@ static const struct field repo_info_field[] = {\n \n static int repo_info_field_cmp(const void *va, const void *vb)\n {\n-\tconst struct field *a = va;\n-\tconst struct field *b = vb;\n+\tconst struct repo_info_field *a = va;\n+\tconst struct repo_info_field *b = vb;\n \n \treturn strcmp(a->key, b->key);\n }\n \n-static const struct field *get_repo_info_field(const char *key)\n+static const struct repo_info_field *get_repo_info_field(const char *key)\n {\n-\tconst struct field search_key = { key, NULL };\n-\tconst struct field *found = bsearch(&search_key, repo_info_field,\n-\t\t\t\t\t    ARRAY_SIZE(repo_info_field),\n-\t\t\t\t\t    sizeof(*found),\n-\t\t\t\t\t    repo_info_field_cmp);\n+\tconst struct repo_info_field search_key = { key, NULL };\n+\tconst struct repo_info_field *found = bsearch(&search_key,\n+\t\t\t\t\t\t      repo_info_field,\n+\t\t\t\t\t\t      ARRAY_SIZE(repo_info_field),\n+\t\t\t\t\t\t      sizeof(*found),\n+\t\t\t\t\t\t      repo_info_field_cmp);\n \n \treturn found;\n }\n@@ -115,7 +116,7 @@ static int print_fields(int argc, const char **argv,\n \n \tfor (int i = 0; i < argc; i++) {\n \t\tconst char *key = argv[i];\n-\t\tconst struct field *field = get_repo_info_field(key);\n+\t\tconst struct repo_info_field *field = get_repo_info_field(key);\n \n \t\tif (!field) {\n \t\t\tret = error(_(\"key '%s' not found\"), key);\n@@ -137,7 +138,7 @@ static int print_all_fields(struct repository *repo,\n \tstruct strbuf valbuf = STRBUF_INIT;\n \n \tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n-\t\tconst struct field *field = &repo_info_field[i];\n+\t\tconst struct repo_info_field *field = &repo_info_field[i];\n \n \t\tstrbuf_reset(&valbuf);\n \t\tfield->get_value(repo, &valbuf);\n@@ -164,7 +165,7 @@ static int print_keys(enum output_format format)\n \t}\n \n \tfor (size_t i = 0; i < ARRAY_SIZE(repo_info_field); i++) {\n-\t\tconst struct field *field = &repo_info_field[i];\n+\t\tconst struct repo_info_field *field = &repo_info_field[i];\n \t\tprintf(\"%s%c\", field->key, sep);\n \t}\n \n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537117","messageId":"20260225183559.79303-6-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 5/8] t1900: rename t1900-repo to t1900-repo-info","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:14Z","receivedAt":"2026-02-25T18:37:12Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Since the commit bbb2b93348 (builtin/repo: introduce structure subcommand,\n2025-10-21), t1901 specifically tests git-repo-structure. Rename\nt1900-repo to t1900-repo-info to clarify that it focus solely on\ngit-repo-info subcommand.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n t/meson.build                           | 2 +-\n t/{t1900-repo.sh => t1900-repo-info.sh} | 0\n 2 files changed, 1 insertion(+), 1 deletion(-)\n rename t/{t1900-repo.sh => t1900-repo-info.sh} (100%)\n\ndiff --git a/t/meson.build b/t/meson.build\nindex f80e366cff..9867762bac 100644\n--- a/t/meson.build\n+++ b/t/meson.build\n@@ -240,7 +240,7 @@ integration_tests = [\n   't1700-split-index.sh',\n   't1701-racy-split-index.sh',\n   't1800-hook.sh',\n-  't1900-repo.sh',\n+  't1900-repo-info.sh',\n   't1901-repo-structure.sh',\n   't2000-conflict-when-checking-files-out.sh',\n   't2002-checkout-cache-u.sh',\ndiff --git a/t/t1900-repo.sh b/t/t1900-repo-info.sh\nsimilarity index 100%\nrename from t/t1900-repo.sh\nrename to t/t1900-repo-info.sh\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537118","messageId":"20260225183559.79303-7-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 6/8] t1901: adjust nul format output instead of expected value","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:15Z","receivedAt":"2026-02-25T18:37:16Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"The test 'keyvalue and nul format', as it description says, test both\n`keyvalue` and `nul` format. These formats are similar, differing only in\ntheir field separator (= in the former, LF in the latter) and their\nrecord separator (LF in the former, NUL in the latter). This way, both\nformats can be tested using the same expected output and only replacing\nthe separators in one of the output formats.\n\nHowever, it is not desirable to have a NUL character in the files\ncompared by test_cmp because, if that assetion fails, diff will consider\nthem binary files and won't display the differences properly.\n\nAdjust the output of `git repo structure --format=nul` in t1901, matching the\n--format=keyvalue ones. Compare this output against the same value expected\nfrom --format=keyvalue, without using files with NUL characters in\ntest_cmp.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n t/t1901-repo-structure.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh\nindex a6f2591d9a..a67b38ab17 100755\n--- a/t/t1901-repo-structure.sh\n+++ b/t/t1901-repo-structure.sh\n@@ -145,18 +145,18 @@ test_expect_success SHA1 'lines and nul format' '\n \t\ttest_cmp expect out &&\n \t\ttest_line_count = 0 err &&\n \n-\t\t# Replace key and value delimiters for nul format.\n-\t\ttr \"\\n=\" \"\\0\\n\" <expect >expect_nul &&\n \t\tgit repo structure --format=nul >out 2>err &&\n+\t\ttr \"\\012\\000\" \"=\\012\" <out >actual &&\n \n-\t\ttest_cmp expect_nul out &&\n+\t\ttest_cmp expect actual &&\n \t\ttest_line_count = 0 err &&\n \n \t\t# \"-z\", as a synonym to \"--format=nul\", participates in the\n \t\t# usual \"last one wins\" rule.\n \t\tgit repo structure --format=table -z >out 2>err &&\n+\t\ttr \"\\012\\000\" \"=\\012\" <out >actual &&\n \n-\t\ttest_cmp expect_nul out &&\n+\t\ttest_cmp expect actual &&\n \t\ttest_line_count = 0 err\n \t)\n '\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537119","messageId":"20260225183559.79303-8-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 7/8] Documentation/git-repo: replace 'NUL' with '_NUL_'","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:16Z","receivedAt":"2026-02-25T18:37:18Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Replace all occurrences of \"NUL\" by \"_NUL_\" in git-repo.adoc, following the\nconvention used by other documentation files.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n Documentation/git-repo.adoc | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc\nindex 319d30bd86..f76f579b20 100644\n--- a/Documentation/git-repo.adoc\n+++ b/Documentation/git-repo.adoc\n@@ -40,7 +40,7 @@ supported:\n \n `nul`:::\n \tsimilar to `lines`, but using a newline character as the delimiter\n-\tbetween the key and the value and using a NUL character after each value.\n+\tbetween the key and the value and using a _NUL_ character after each value.\n \tThis format is better suited for being parsed by another applications than\n \t`lines`. Unlike in the `lines` format, the values are never quoted.\n +\n@@ -80,7 +80,7 @@ supported:\n \tconfiguration variable `core.quotePath` (see linkgit:git-config[1]).\n \n `nul`:::\n-\tSimilar to `lines`, but uses a NUL character to delimit between\n+\tSimilar to `lines`, but uses a _NUL_ character to delimit between\n \tkey-value pairs instead of a newline. Also uses a newline character as\n \tthe delimiter between the key and value instead of '='. Unlike the\n \t`lines` format, values containing \"unusual\" characters are never\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537120","messageId":"20260225183559.79303-9-lucasseikioshiro@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"[PATCH v2 8/8] Documentation/git-repo: capitalize format descriptions","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:32:17Z","receivedAt":"2026-02-25T18:37:22Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"The descriptions for the git-repo output formats are in lowercase.\nCapitalize these descriptions, making them consistent with the rest of\nthe documentation.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n Documentation/git-repo.adoc | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc\nindex f76f579b20..5e2968b707 100644\n--- a/Documentation/git-repo.adoc\n+++ b/Documentation/git-repo.adoc\n@@ -33,13 +33,13 @@ supported:\n +\n \n `lines`:::\n-\toutput key-value pairs one per line using the `=` character as\n+\tOutput key-value pairs one per line using the `=` character as\n \tthe delimiter between the key and the value. Values containing \"unusual\"\n \tcharacters are quoted as explained for the configuration variable\n \t`core.quotePath` (see linkgit:git-config[1]). This is the default.\n \n `nul`:::\n-\tsimilar to `lines`, but using a newline character as the delimiter\n+\tSimilar to `lines`, but using a newline character as the delimiter\n \tbetween the key and the value and using a _NUL_ character after each value.\n \tThis format is better suited for being parsed by another applications than\n \t`lines`. Unlike in the `lines` format, the values are never quoted.\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"537122","messageId":"2403C8E1-18A3-47A3-B65A-0303072B5E22@gmail.com","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"Re: [PATCH v2 0/8] repo: refactoring leftover nits","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T18:43:25Z","receivedAt":"2026-02-25T18:43:43Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"I forgot to say in the cover letter, but this was built on top\nof the current master (7c02d39fc2 (The 6th batch, 2026-02-20)) with\nlo/repo-info-keys merge, which is already marked as\n\"Will merge to 'master'\".\n"},{"id":"537130","messageId":"xmqqms0wa9fv.fsf@gitster.g","threadId":"65018","inReplyTo":"20260225183559.79303-1-lucasseikioshiro@gmail.com","subject":"Re: [PATCH v2 0/8] repo: refactoring leftover nits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-25T19:51:16Z","receivedAt":"2026-02-25T19:51:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:\n\n> Hi!\n>\n> There are only three changes in this version:\n>\n> 1. Applying Eric's suggestion of instructing to name array plural if we're\n>    dealing with the values as a whole\n> 2. Making it clear why we should replace the NUL characters in the files\n>    consumed by tes_cmp\n> 3. Replacing characters in just one tr call instead of two\n\nAll look great.  The first patch has still rooms to bikeshed, but\nlet's take this iteration and mark it for 'next'.\n\nThanks.\n"}]}