Matthew DeVore <matvore@xxxxxxxxxx> writes: > The name "tree:0" allows later filtering based on depth, i.e. "tree:1" > would filter out all but the root tree and blobs. In order to avoid > confusion between 0 and capital O, the documentation was worded in a > somewhat round-about way that also hints at this future improvement to > the feature. > > Signed-off-by: Matthew DeVore <matvore@xxxxxxxxxx> Thanks. > diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt > index 7b273635d..5f1672913 100644 > --- a/Documentation/rev-list-options.txt > +++ b/Documentation/rev-list-options.txt > @@ -731,6 +731,11 @@ the requested refs. > + > The form '--filter=sparse:path=<path>' similarly uses a sparse-checkout > specification contained in <path>. > ++ > +The form '--filter=tree:<depth>' omits all blobs and trees whose depth > +from the root tree is >= <depth> (minimum depth if an object is located > +at multiple depths in the commits traversed). Currently, only <depth>=0 > +is supported, which omits all blobs and trees. OK. > diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh > index 9839b48c1..510d3537f 100755 > --- a/t/t5317-pack-objects-filter-objects.sh > +++ b/t/t5317-pack-objects-filter-objects.sh > @@ -72,6 +72,34 @@ test_expect_success 'get an error for missing tree object' ' > grep -q "bad tree object" bad_tree > ' As output made inside test_expect_{succcess,failure} are discarded by default and shown while debugging tests, there is no strong reason to use "grep -q" in our tests. I saw a few instances of "grep -q" added in this series including this one test_must_fail grep -q "$file_4" observed that should probably be ! grep "$file_4" observed > + printf "blob\ncommit\ntree\n" >unique_types.expected && > ... > + printf "blob\ntree\n" >expected && Using test_write_lines is probably easier to read. Other than these two minor classes of nits, the series look quite well cooked to me. Thanks.