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: cd79c76a51f776bf46a849db04ce2cc45c5c5d6d
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 46d1f4cf4dcb8aaf799f78410af829e149086f36
Choose a head ref
  • 6 commits
  • 7 files changed
  • 1 contributor

Commits on Mar 26, 2026

  1. revision: include object-name.h

    The REV_INFO_INIT macro includes a use of the DEFAULT_ABBREV macro, which is
    defined in object-name.h. Include it in revision.h so consumers of
    REV_INFO_INIT do not need to include this hidden dependency.
    
    Signed-off-by: Derrick Stolee <stolee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Mar 26, 2026
    Configuration menu
    Copy the full SHA
    50da232 View commit details
    Browse the repository at this point in the history
  2. t5620: prepare branched repo for revision tests

    Prepare the test infrastructure for upcoming changes that teach 'git
    backfill' to accept revision arguments and pathspecs.
    
    Add test_tick before each commit in the setup loop so that commit dates
    are deterministic. This enables reliable testing with '--since'.
    
    Rename the 'd/e/' directory to 'd/f/' so that the prefix 'd/f' is
    ambiguous with the files 'd/file.*.txt'. This exercises the subtlety
    in prefix pathspec matching that will be added in a later commit.
    
    Create a branched version of the test repository (src-revs) with:
     - A 'side' branch merged into main, adding s/file.{1,2}.txt with
       two versions (4 new blobs, 52 total from main HEAD).
     - An unmerged 'other' branch adding o/file.{1,2}.txt (2 more blobs,
       54 total reachable from --all).
    
    This structure makes --all, --first-parent, and --since produce
    meaningfully different results when used with 'git backfill'.
    
    Signed-off-by: Derrick Stolee <stolee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Mar 26, 2026
    Configuration menu
    Copy the full SHA
    9b474a6 View commit details
    Browse the repository at this point in the history
  3. backfill: accept revision arguments

    The existing implementation of 'git backfill' only includes downloading
    missing blobs reachable from HEAD. Advanced uses may desire more general
    commit limiting options, such as '--all' for all references, specifying a
    commit range via negative references, or specifying a recency of use such as
    with '--since=<date>'.
    
    All of these options are available if we use setup_revisions() to parse the
    unknown arguments with the revision machinery. This opens up a large number
    of possibilities, only a small set of which are tested here.
    
    For documentation, we avoid duplicating the option documentation and instead
    link to the documentation of 'git rev-list'.
    
    Note that these arguments currently allow specifying a pathspec, which
    modifies the commit history checks but does not limit the paths used in the
    backfill logic. This will be updated in a future change.
    
    Signed-off-by: Derrick Stolee <stolee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Mar 26, 2026
    Configuration menu
    Copy the full SHA
    302aff0 View commit details
    Browse the repository at this point in the history
  4. backfill: work with prefix pathspecs

    The previous change allowed specifying revision arguments over the 'git
    backfill' command-line. This created the opportunity for restricting the
    initial commit set by filtering the revision walk through a pathspec. Other
    than filtering the commit set (and thereby the root trees), this did not
    restrict the path-walk implementation of 'git backfill' and did not restrict
    the blobs that were downloaded to only those matching the pathspec.
    
    Update the path-walk API to accept certain kinds of pathspecs and to
    silently ignore anything too complex, for now. We will update this in the
    next change to properly restrict to even complex pathspecs.
    
    The current behavior focuses on pathspecs that match paths exactly. This
    includes exact filenames, including directory names as prefixes. Pathspecs
    containing wildcards or magic are cleared so the path walk downloads all
    blobs, as before.
    
    The reason for this restriction is to allow for a faster execution by
    pruning the path walk to only trees that could contribute towards one of
    those paths as a parent directory.
    
    The test directory 'd/f/' (next to 'd/file*.txt') was prepared in a
    previous commit to exercise the subtlety in prefix matching.
    
    Signed-off-by: Derrick Stolee <stolee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Mar 26, 2026
    Configuration menu
    Copy the full SHA
    7be1820 View commit details
    Browse the repository at this point in the history
  5. path-walk: support wildcard pathspecs for blob filtering

    Previously, walk_objects_by_path() silently ignored pathspecs containing
    wildcards or magic by clearing them. This caused all blobs to be
    downloaded regardless of the given pathspec. Wildcard pathspecs like
    "d/file.*.txt" are useful for narrowing which blobs to process (e.g.,
    during 'git backfill').
    
    Support wildcard pathspecs by making two changes:
    
     1. Add an 'exact_pathspecs' flag to path_walk_context. When the
        pathspec has no wildcards or magic, set this flag and use the
        existing fast-path prefix matching in add_tree_entries(). When
        wildcards are present, skip that block since prefix matching
        cannot handle glob patterns.
    
     2. Add a match_pathspec() check in walk_path() to filter out blobs
        whose full path does not match the pathspec. This provides the
        actual blob-level filtering for wildcard pathspecs.
    
    Signed-off-by: Derrick Stolee <stolee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Mar 26, 2026
    Configuration menu
    Copy the full SHA
    3f20c21 View commit details
    Browse the repository at this point in the history
  6. t5620: test backfill's unknown argument handling

    Before the recent changes to parse rev-list arguments inside of 'git
    backfill', the builtin would take arbitrary arguments without complaint (and
    ignore them). This was noticed and a patch was sent [1] which motivates
    this change.
    
    [1] https://lore.kernel.org/git/20260321031643.5185-1-r.siddharth.shrimali@gmail.com/
    
    Note that the revision machinery can output an "ambiguous argument"
    warning if a value not starting with '--' is found and doesn't make
    sense as a reference or a pathspec. For unrecognized arguments starting
    with '--' we need to add logic into builtin/backfill.c to catch leftover
    arguments.
    
    Reported-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
    Signed-off-by: Derrick Stolee <stolee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Mar 26, 2026
    Configuration menu
    Copy the full SHA
    46d1f4c View commit details
    Browse the repository at this point in the history
Loading