Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 175048344f5b04c720e34426137418b64c7b260f
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 16a93c03c7824a40b034a6ee1cb1c68c8ef48682
Choose a head ref
  • 7 commits
  • 6 files changed
  • 1 contributor

Commits on Oct 21, 2025

  1. builtin/repo: rename repo_info() to cmd_repo_info()

    Subcommand functions are often prefixed with `cmd_` to denote that they
    are an entrypoint. Rename repo_info() to cmd_repo_info() accordingly.
    
    Signed-off-by: Justin Tobler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jltobler authored and gitster committed Oct 21, 2025
    Configuration menu
    Copy the full SHA
    026ad60 View commit details
    Browse the repository at this point in the history
  2. ref-filter: allow NULL filter pattern

    When setting up `struct ref_filter` for filter_refs(), the
    `name_patterns` field must point to an array of pattern strings even if
    no patterns are required. To improve this interface, treat a NULL
    `name_patterns` field the same as when it points to an empty array.
    
    Signed-off-by: Justin Tobler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jltobler authored and gitster committed Oct 21, 2025
    Configuration menu
    Copy the full SHA
    eafc03d View commit details
    Browse the repository at this point in the history
  3. ref-filter: export ref_kind_from_refname()

    When filtering refs, `ref_kind_from_refname()` is used to determine the
    ref type. In a subsequent commit, this same logic is reused when
    counting refs by type. Export the function to prepare for this change.
    
    Signed-off-by: Justin Tobler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jltobler authored and gitster committed Oct 21, 2025
    Configuration menu
    Copy the full SHA
    6d1997f View commit details
    Browse the repository at this point in the history
  4. builtin/repo: introduce structure subcommand

    The structure of a repository's history can have huge impacts on the
    performance and health of the repository itself. Currently, Git lacks a
    means to surface repository metrics regarding its structure/shape via a
    single command. Acquiring this information requires users to be familiar
    with the relevant data points and the various Git commands required to
    surface them. To fill this gap, supplemental tools such as git-sizer(1)
    have been developed.
    
    To allow users to more readily identify repository structure related
    information, introduce the "structure" subcommand in git-repo(1). The
    goal of this subcommand is to eventually provide similar functionality
    to git-sizer(1), but natively in Git.
    
    The initial version of this command only iterates through all references
    in the repository and tracks the count of branches, tags, remote refs,
    and other reference types. The corresponding information is displayed in
    a human-friendly table formatted in a very similar manner to
    git-sizer(1). The width of each table column is adjusted automatically
    to satisfy the requirements of the widest row contained.
    
    Subsequent commits will surface additional relevant data points to
    output and also provide other more machine-friendly output formats.
    
    Based-on-patch-by: Derrick Stolee <[email protected]>
    Signed-off-by: Justin Tobler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jltobler authored and gitster committed Oct 21, 2025
    Configuration menu
    Copy the full SHA
    bbb2b93 View commit details
    Browse the repository at this point in the history
  5. builtin/repo: add object counts in structure output

    The amount of objects in a repository can provide insight regarding its
    shape. To surface this information, use the path-walk API to count the
    number of reachable objects in the repository by object type. All
    regular references are used to determine the reachable set of objects.
    The object counts are appended to the same table containing the
    reference information.
    
    Signed-off-by: Justin Tobler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jltobler authored and gitster committed Oct 21, 2025
    Configuration menu
    Copy the full SHA
    eb5cf58 View commit details
    Browse the repository at this point in the history
  6. builtin/repo: add keyvalue and nul format for structure stats

    All repository structure stats are outputted in a human-friendly table
    form. This format is not suitable for machine parsing. Add a --format
    option that supports three output modes: `table`, `keyvalue`, and `nul`.
    The `table` mode is the default format and prints the same table output
    as before.
    
    With the `keyvalue` mode, each line of output contains a key-value pair
    of a repository stat. The '=' character is used to delimit between keys
    and values. The `nul` mode is similar to `keyvalue`, but key-values are
    delimited by a NUL character instead of a newline. Also, instead of a
    '=' character to delimit between keys and values, a newline character is
    used. This allows stat values to support special characters without
    having to cquote them. These two new modes provides output that is more
    machine-friendly.
    
    Signed-off-by: Justin Tobler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jltobler authored and gitster committed Oct 21, 2025
    Configuration menu
    Copy the full SHA
    1721567 View commit details
    Browse the repository at this point in the history
  7. builtin/repo: add progress meter for structure stats

    When using the structure subcommand for git-repo(1), evaluating a
    repository may take some time depending on its shape. Add a progress
    meter to provide feedback to the user about what is happening. The
    progress meter is enabled by default when the command is executed from a
    tty. It can also be explicitly enabled/disabled via the --[no-]progress
    option.
    
    Signed-off-by: Justin Tobler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jltobler authored and gitster committed Oct 21, 2025
    Configuration menu
    Copy the full SHA
    16a93c0 View commit details
    Browse the repository at this point in the history
Loading