gc: make --prune useful again by accepting an optional parameter
With this patch, "git gc --no-prune" will not prune any loose (and
dangling) object, and "git gc --prune=5.minutes.ago" will prune
all loose objects older than 5 minutes.
This patch benefitted from suggestions by Thomas Rast and Jan Krï¿œger.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Johannes Schindelin16 years agocommitted byJunio C Hamano
@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository
@@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository
@ -59,6 +59,14 @@ are consolidated into a single pack by using the `-A` option of
@@ -59,6 +59,14 @@ are consolidated into a single pack by using the `-A` option of
'git-repack'. Setting `gc.autopacklimit` to 0 disables
automatic consolidation of packs.
--prune=<date>::
Prune loose objects older than date (default is 2 weeks ago,
overrideable by the config variable `gc.pruneExpire`). This
@ -112,4 +112,42 @@ test_expect_success 'prune: do not prune heads listed as an argument' '
@@ -112,4 +112,42 @@ test_expect_success 'prune: do not prune heads listed as an argument' '