git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add "--expire <time>" option to 'git prune'

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Nov 29, 2007, 14:35 UTC
Message-ID
<474ECE2A.9050700@viscovery.net>
In-Reply-To
<Pine.LNX.4.64.0711291419350.27959@racer.site>
Johannes Schindelin schrieb:
Show 7 quoted lines
> +test_expect_success 'prune --expire' '
> +
> +	BLOB=$(echo aleph | git hash-object -w --stdin) &&
> +	BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
> +	test 20 = $(git count-objects | sed "s/ .*//") &&
> +	test -f $BLOB_FILE &&
> +	git reset --hard &&
Here you could throw in:
	git prune --expire=1.hour.ago &&
	test 20 = $(git count-objects | sed "s/ .*//") &&
	test -f $BLOB_FILE &&
to test that the object is not pruned (and the alternate --expire syntax).
Show 8 quoted lines
> +	if touch -d "Jan 1 1970" $BLOB_FILE
> +	then
> +		git prune --expire 1.day &&
> +		test 19 = $(git count-objects | sed "s/ .*//") &&
> +		! test -f $BLOB_FILE
> +	else
> +		say "Skipping test due to non-working touch -d"
> +	fi
-- Hannes
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 9 of 14 in “[RFC] Alternates and broken repos: A pack and prune scheme to avoid them”
  1. Johannes SixtNov 18, 2007
  2. Junio C HamanoNov 18, 2007
  3. Johannes SixtNov 18, 2007
  4. Junio C HamanoNov 18, 2007
  5. Teach repack to optionally retain otherwise lost objectsJohannes Schindelin, Nov 29, 2007
  6. Junio C HamanoNov 29, 2007
  7. Johannes SchindelinNov 29, 2007
  8. Add "--expire <time>" option to 'git prune'Johannes Schindelin, Nov 29, 2007
  9. Johannes SixtNov 29, 2007
  10. Add "--expire <time>" option to 'git prune'Johannes Schindelin, Nov 29, 2007
  11. Jeff KingNov 29, 2007
  12. Johannes SchindelinNov 29, 2007
  13. Junio C HamanoNov 29, 2007
  14. Add "--expire <time>" option to 'git prune'Johannes Schindelin, Nov 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.