]> Kevux Git Server - rit/commit
backfill: work with prefix pathspecs
authorDerrick Stolee <stolee@gmail.com>
Thu, 26 Mar 2026 15:14:52 +0000 (15:14 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Mar 2026 16:38:06 +0000 (09:38 -0700)
commit7be182045a6a113b118982fc81296d5b9746779e
treed68789bd8ab8f3908822a197a13bb52eab24521f
parent302aff09223f81d9bd0bb496a3aea9f279d1991f
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>
path-walk.c
path.c
path.h
t/t5620-backfill.sh