From: Junio C Hamano <gitster@pobox.com>
To: Doug Kelly <dougk.ff7@gmail.com>
Cc: git@vger.kernel.org, peff@peff.net, sbeller@google.com
Subject: Re: [PATCH 3/4] t5304: Ensure wanted files are not deleted
Date: Wed, 13 Jan 2016 12:55:50 -0800 [thread overview]
Message-ID: <xmqqmvs9mc6h.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <670a9d9268beb0d70fb877a7c62d769062babba9.1452704305.git.dougk.ff7@gmail.com> (Doug Kelly's message of "Wed, 13 Jan 2016 11:07:11 -0600")
Doug Kelly <dougk.ff7@gmail.com> writes:
> Subject: Re: [PATCH 3/4] t5304: Ensure wanted files are not deleted
I'd suggest s/wanted/non-garbage/.
> Explicitly test for and ensure files that may be wanted are not
> deleted during a gc operation. These include .pack without .idx
> (which may be in-flight), garbage in the directory, and .keep files
> the user created.
"garbage in the directory" is not well defined. "files in the
directory that clearly are not related to packing" is probably what
you meant, but the definition of "related to packing" is still
fuzzy. Please clarify.
The following is me thinking aloud about things that you would need
to think about while attempting to clarify this.
What should the code do if we find
pack-b0a9d62a7471e58832a575a78d57f8fb26822125.frotz
in $GIT_OBJECT_DIRECTORY/pack/ directory? Is it a "garbage in the
directory"? The filename looks so similar to the usual things with
know suffixes .pack, .idx, .bitmap, and .keep, that we may want to
consider that it might be another file related to the packing left
by a future version of Git and if we do not see corresponding .pack
we would want to remove it? Or do we want to do something else?
What should "gc" do if we find
pack-frotz.idx
without corresponding ".pack"? Wouldn't it be safer to consider it
a garbage unrelated to packing (because regular packing would have
given it with 40-hex name, not "frotz") and leave it undeleted?
Thanks.
> Signed-off-by: Doug Kelly <dougk.ff7@gmail.com>
> ---
> t/t5304-prune.sh | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
> index 4fa6e7a..f7c380c 100755
> --- a/t/t5304-prune.sh
> +++ b/t/t5304-prune.sh
> @@ -285,6 +285,23 @@ EOF
> test_cmp expected actual
> '
>
> +test_expect_success 'ensure unknown garbage kept with gc' '
> + test_when_finished "rm -f .git/objects/pack/fake*" &&
> + test_when_finished "rm -f .git/objects/pack/foo*" &&
> + : >.git/objects/pack/foo.keep &&
> + : >.git/objects/pack/fake.pack &&
> + : >.git/objects/pack/fake2.foo &&
> + git gc &&
> + git count-objects -v 2>stderr &&
> + grep "^warning:" stderr | sort >actual &&
> + cat >expected <<\EOF &&
> +warning: garbage found: .git/objects/pack/fake2.foo
> +warning: no corresponding .idx or .pack: .git/objects/pack/foo.keep
> +warning: no corresponding .idx: .git/objects/pack/fake.pack
> +EOF
> + test_cmp expected actual
> +'
> +
> test_expect_success 'prune .git/shallow' '
> SHA1=`echo hi|git commit-tree HEAD^{tree}` &&
> echo $SHA1 >.git/shallow &&
next prev parent reply other threads:[~2016-01-13 20:55 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-14 0:10 [PATCH 0/3] Add cleanup for garbage .bitmap files Doug Kelly
2015-11-14 0:10 ` [PATCH 1/3] prepare_packed_git(): find more garbage Doug Kelly
2015-11-14 0:43 ` Stefan Beller
2015-11-14 0:46 ` Doug Kelly
2015-11-14 0:46 ` [PATCH 2/3] t5304: Add test for .bitmap garbage files Doug Kelly
2015-11-14 0:46 ` [PATCH 3/3] gc: Clean garbage .bitmap files from pack dir Doug Kelly
2015-12-15 23:23 ` Jeff King
2015-11-25 18:43 ` [PATCH 1/3] prepare_packed_git(): find more garbage Stefan Beller
2015-11-26 6:15 ` Doug Kelly
2015-12-15 23:09 ` Jeff King
2015-12-15 23:25 ` Jeff King
2015-12-19 0:06 ` [PATCH v3 0/3] " Doug Kelly
2015-12-19 0:06 ` [PATCH 1/3] " Doug Kelly
2015-12-19 0:06 ` [PATCH 2/3] t5304: Add test for .bitmap garbage files Doug Kelly
2015-12-19 0:06 ` [PATCH 3/3] gc: Clean garbage .bitmap files from pack dir Doug Kelly
2015-12-19 2:01 ` Jeff King
2015-12-19 2:02 ` [PATCH v3 0/3] prepare_packed_git(): find more garbage Jeff King
2015-12-19 2:03 ` Jeff King
2016-01-11 16:35 ` Stefan Beller
2016-01-13 17:07 ` [PATCH v4 0/4] gc: Clean garbage .bitmap files from pack dir Doug Kelly
2016-01-13 17:07 ` [PATCH 1/4] prepare_packed_git(): find more garbage Doug Kelly
2016-01-13 17:07 ` [PATCH 2/4] t5304: Add test for .bitmap garbage files Doug Kelly
2016-01-13 20:42 ` Junio C Hamano
2016-01-13 17:07 ` [PATCH 3/4] t5304: Ensure wanted files are not deleted Doug Kelly
2016-01-13 20:55 ` Junio C Hamano [this message]
2016-01-18 16:54 ` Doug Kelly
2016-01-19 18:36 ` Junio C Hamano
2016-01-13 17:07 ` [PATCH 4/4] gc: Clean garbage .bitmap files from pack dir Doug Kelly
2015-11-26 6:18 ` [PATCH 1/3] prepare_packed_git(): find more garbage Doug Kelly
2015-11-14 0:47 ` Doug Kelly
2015-11-14 0:10 ` [PATCH 2/3] t5304: Add test for .bitmap garbage files Doug Kelly
2015-11-14 0:47 ` Stefan Beller
2015-11-14 0:10 ` [PATCH 3/3] gc: Clean garbage .bitmap files from pack dir Doug Kelly
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=xmqqmvs9mc6h.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=dougk.ff7@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=sbeller@google.com \
/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.