Re: [PATCH 1/3] prune: lazily perform reachability traversal

2019-02-14 Thread Jeff King
On Thu, Feb 14, 2019 at 05:54:25AM -0500, Eric Sunshine wrote: > On Wed, Feb 13, 2019 at 11:35 PM Jeff King wrote: > > diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh > > @@ -274,6 +274,18 @@ test_expect_success 'prune .git/shallow' ' > > +test_expect_success 'prune .git/shallow when there are n

Re: [PATCH 1/3] prune: lazily perform reachability traversal

2019-02-14 Thread Eric Sunshine
On Wed, Feb 13, 2019 at 11:35 PM Jeff King wrote: > diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh > @@ -274,6 +274,18 @@ test_expect_success 'prune .git/shallow' ' > +test_expect_success 'prune .git/shallow when there are no loose objects' ' > + SHA1=$(echo hi|git commit-tree HEAD^{tree})

[PATCH 1/3] prune: lazily perform reachability traversal

2019-02-13 Thread Jeff King
The general strategy of "git prune" is to do a full reachability walk, then for each loose object see if we found it in our walk. But if we don't have any loose objects, we don't need to do the expensive walk in the first place. This patch postpones that walk until the first time we need to see it