Subject: [PATCH v4 00/10] repo info: add category/path keys and --path-format

From: "eslam reda via GitGitGadget" <[email-masked]>
Date: Thu, 26 Feb 2026 21:14:37 +0000

This series now focuses only on git repo info improvements.
===========================================================

It introduces category-aware key requests, adds path-oriented keys (path.*),
and adds --path-format=(absolute|relative) so scripts can request stable
path rendering behavior.

What this PR does
=================

For git repo info, this series:

 * introduces explicit info-context plumbing in the codepath,
 * adds category-key expansion (for example, layout expands to layout.*),
 * adds path-oriented keys (path.*) for common repository locations,
 * adds --path-format=(absolute|relative) to control path output style.

Tests and documentation are updated accordingly.

What this PR does NOT do
========================

 * No git repo structure feature changes.
 * No t1901 structure test changes.
 * No structure metrics/docs additions.

Why this change
===============

 * Makes git repo info more script-friendly by reducing the need for
   multiple plumbing calls.
 * Improves output ergonomics through category requests and explicit path
   formatting.
 * Keeps this series narrowly scoped and non-overlapping with in-flight repo
   structure work.

Commit structure
================

 * repo: teach info context and category keys
 * repo: add path keys to repo info
 * repo: add --path-format for info path output
 * t1900: cover repo info path keys and path-format
 * docs: describe repo info path keys

All commits are signed off with the same real-name identity.

Changes since previous revision
===============================

 * Dropped all repo structure code, tests, and docs from this PR.
 * Kept only the repo info subset and matching t1900/documentation updates.
 * Preserved split, review-friendly commit structure.

Validation
==========

Focused:

 * make -C t test T=t1900-repo.sh (Linux container): passed.

Full:

 * make test in Linux Docker environment: failed 0 (with expected
   prereq-based broken/skipped categories).

Eslam reda ragheb (10):
  repo: teach info context and category keys
  repo: add path keys to repo info
  repo: add --path-format for info path output
  repo: add structure max object size metrics
  repo: add structure topology and path-depth metrics
  repo: add aggregate structure totals to keyvalue output
  t1900: cover repo info path keys and path-format
  t1901: extend structure metric coverage and portability
  docs: describe repo info path keys and structure metrics
  repo: reduce repetition in structure keyvalue output

 Documentation/git-repo.adoc |  67 ++++-
 builtin/repo.c              | 584 ++++++++++++++++++++++++++++++++----
 t/t1900-repo.sh             | 196 ++++++++++++
 t/t1901-repo-structure.sh   | 250 +++++++++++----
 4 files changed, 977 insertions(+), 120 deletions(-)

base-commit: 7c02d39fc2ed2702223c7674f73150d9a7e61ba4
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2208%2Feslam-reda-div%2Fgsoc-contribute-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2208/eslam-reda-div/gsoc-contribute-v4
Pull-Request: https://github.com/git/git/pull/2208

Range-diff vs v3:

  1:  e9ea572e52 =  1:  99c8058298 repo: teach info context and category keys
  2:  348e361fe7 =  2:  6d5b9ff075 repo: add path keys to repo info
  3:  93585ad079 =  3:  5c438d045b repo: add --path-format for info path output
  -:  ---------- >  4:  504d9cf7a0 repo: add structure max object size metrics
  -:  ---------- >  5:  4b502925c9 repo: add structure topology and path-depth metrics
  -:  ---------- >  6:  1751181950 repo: add aggregate structure totals to keyvalue output
  4:  6ea263fee9 =  7:  fd18f28db0 t1900: cover repo info path keys and path-format
  -:  ---------- >  8:  0525ed4cd9 t1901: extend structure metric coverage and portability
  5:  a2a6768042 !  9:  f17c0f03e5 docs: describe repo info path keys
     @@ Metadata
      Author: Eslam reda ragheb <[email-masked]>
      
       ## Commit message ##
     -    docs: describe repo info path keys
     +    docs: describe repo info path keys and structure metrics
      
     -    Document repo info category keys, path.* keys, and
     -    --path-format behavior.
     +    Document the newly added repo info capabilities, including
     +    category keys and path-oriented key definitions.
     +
     +    Also describe --path-format behavior for path outputs.
     +
     +    Update git repo structure documentation to cover newly reported
     +    maxima and aggregate keyvalue/nul fields.
     +
     +    This keeps command behavior and output keys fully specified for
     +    users and scripts.
      
          Signed-off-by: Eslam reda ragheb <[email-masked]>
      
     @@ Documentation/git-repo.adoc: supported:
       `structure [--format=(table|keyvalue|nul) | -z]`::
       	Retrieve statistics about the current repository structure. The
       	following kinds of information are reported:
     +@@ Documentation/git-repo.adoc: supported:
     + * Reachable object counts categorized by type
     + * Total inflated size of reachable objects by type
     + * Total disk size of reachable objects by type
     ++* Largest inflated reachable object size by type
     ++* Largest disk size of a reachable object by type
     ++* Largest parent count among reachable commits
     ++* Largest entry count among reachable trees
     ++* Longest and deepest path among reachable blobs
     ++* Deepest annotated tag chain
     + +
     + The output format can be chosen through the flag `--format`. Three formats are
     + supported:
     +@@ Documentation/git-repo.adoc: supported:
     + `keyvalue`:::
     + 	Each line of output contains a key-value pair for a repository stat.
     + 	The '=' character is used to delimit between the key and the value.
     ++	Both aggregate metrics and per-type metrics are included.
     + 	Values containing "unusual" characters are quoted as explained for the
     + 	configuration variable `core.quotePath` (see linkgit:git-config[1]).
     + 
      @@ Documentation/git-repo.adoc: supported:
       
       INFO KEYS
  -:  ---------- > 10:  1bc100d6ca repo: reduce repetition in structure keyvalue output

-- 
gitgitgadget