[PATCH v2 0/2] Two cleanups around 'prefetch' refs
From: Derrick Stolee via GitGitGadget <hidden>
Date: 2021-01-19 18:27:13
Here are a couple things that caught my eye during a recent evaluation of
the maintenance feature:
1. 'refs/prefetch/' refs show up in 'git log' decorations. Auto-hide these.
2. t7900-maintenance.sh had some scary warnings that end up being
unimportant.
This is based on 'master' at 66e871b (The third batch, 2021-01-15).
Update in v2: deleting refs more safely for alternate ref backends. (Thanks,
Taylor!)
Thanks, -Stolee
Derrick Stolee (2):
maintenance: set log.excludeDecoration durin prefetch
t7900: clean up some broken refs
builtin/gc.c | 6 ++++++
t/t7900-maintenance.sh | 33 ++++++++++++++++++++++++++++++++-
2 files changed, 38 insertions(+), 1 deletion(-)
base-commit: 66e871b6647ffea61a77a0f82c7ef3415f1ee79c
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-838%2Fderrickstolee%2Fprefetch-refs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-838/derrickstolee/prefetch-refs-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/838
Range-diff vs v1:
1: 5b2ce9049a6 = 1: 5b2ce9049a6 maintenance: set log.excludeDecoration durin prefetch
2: 616b73a6556 ! 2: 35038dfd037 t7900: clean up some broken refs
@@ Commit message
All that is left is to clean up the tests in t7900-maintenance.sh to
remove these tags and refs that are not being repacked for the
- incremental-repack tests.
+ incremental-repack tests. Use update-ref to ensure this works with all
+ ref backends.
+ Helped-by: Taylor Blau [off-list ref]
Signed-off-by: Derrick Stolee [off-list ref]
## t/t7900-maintenance.sh ##
@@ t/t7900-maintenance.sh: test_expect_success 'incremental-repack task' '
^HEAD~1
EOF
+
++ # Delete refs that have not been repacked in these packs.
++ git for-each-ref --format="delete %(refname)" \
++ refs/prefetch refs/tags >refs &&
++ git update-ref --stdin <refs &&
++
+ # Replace the object directory with this pack layout.
-+ # However, it does not include all objects from the remotes.
-+ rm -rf .git/refs/prefetch &&
-+ rm -rf .git/refs/tags &&
rm -f $packDir/pack-* &&
rm -f $packDir/loose-* &&
ls $packDir/*.pack >packs-before &&
--
gitgitgadget