All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org, pasky@suse.cz
Subject: Re: [PATCH] Add "--expire <time>" option to 'git prune'
Date: Thu, 29 Nov 2007 15:35:22 +0100	[thread overview]
Message-ID: <474ECE2A.9050700@viscovery.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0711291419350.27959@racer.site>

Johannes Schindelin schrieb:
> +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).

> +	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

  reply	other threads:[~2007-11-29 14:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18 11:25 [RFC] Alternates and broken repos: A pack and prune scheme to avoid them Johannes Sixt
2007-11-18 18:39 ` Junio C Hamano
2007-11-18 20:01   ` Johannes Sixt
2007-11-18 20:10     ` Junio C Hamano
2007-11-29  3:41       ` [PATCH/RFC] Teach repack to optionally retain otherwise lost objects Johannes Schindelin
2007-11-29  6:15         ` Junio C Hamano
2007-11-29 11:57           ` Johannes Schindelin
2007-11-29 14:21             ` [PATCH] Add "--expire <time>" option to 'git prune' Johannes Schindelin
2007-11-29 14:35               ` Johannes Sixt [this message]
2007-11-29 15:22                 ` [PATCH v2] " Johannes Schindelin
2007-11-29 15:12               ` [PATCH] " Jeff King
2007-11-29 16:13                 ` Johannes Schindelin
2007-11-29 20:06               ` Junio C Hamano
2007-11-29 20:59                 ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=474ECE2A.9050700@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pasky@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.