From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Stefan Beller" <stefanbeller@googlemail.com>,
"Torsten Bögershausen" <tboegi@web.de>,
git@vger.kernel.org
Subject: Re: [PATCH] repack.c: rename and unlink pack file if it exists
Date: Wed, 5 Feb 2014 15:54:05 -0500 [thread overview]
Message-ID: <20140205205405.GA24100@sigill.intra.peff.net> (raw)
In-Reply-To: <20140205203740.GA17077@sigill.intra.peff.net>
On Wed, Feb 05, 2014 at 03:37:40PM -0500, Jeff King wrote:
> > Sounds sensible. Run "repack -a -d" once, and then another while
> > forcing it to be single threaded, or something?
>
> Certainly that's the way to trigger the code, but doing this:
> [...]
> ...does not seem to fail, and it does not seem to leave any cruft in
> place. So maybe I am misunderstanding the thing the patch is meant to
> fix. Is it that we simply do not replace the pack in this instance?
>
> I guess we would have to generate a pack with the identical set of
> objects, then, but somehow different in its pack parameters (perhaps
> turning off deltas?).
Here's a more robust test that actually checks the pack contents:
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index b45bd1e..c18a318 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -164,5 +164,17 @@ test_expect_success 'objects made unreachable by grafts only are kept' '
git cat-file -t $H1
'
+test_expect_success 'repack can handle generating the same pack again' '
+ show_deltas() {
+ git rev-list --objects --all --reflog |
+ git cat-file --batch-check="%(objectname) %(deltabase) %(rest)"
+ }
+ git -c pack.threads=1 repack -adf --window=0 &&
+ show_deltas >no-deltas &&
+ git -c pack.threads=1 repack -adf --window=10 &&
+ show_deltas >deltas &&
+ ! test_cmp no-deltas deltas
+'
+
test_done
which _also_ does not fail. And then I realized it is because of
1190a1ac, which gives these two separate names.
So I am not sure if it is even possible to trigger the bug in a
meaningful way at this point.
-Peff
next prev parent reply other threads:[~2014-02-05 20:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 23:40 [PATCH] repack.c: rename and unlink pack file if it exists Junio C Hamano
2014-02-04 23:43 ` Junio C Hamano
2014-02-05 1:16 ` Jeff King
2014-02-05 17:54 ` Torsten Bögershausen
2014-02-05 20:06 ` Junio C Hamano
2014-02-05 20:12 ` Jeff King
2014-02-05 20:31 ` Junio C Hamano
2014-02-05 20:37 ` Jeff King
2014-02-05 20:54 ` Jeff King [this message]
2014-02-05 20:57 ` Junio C Hamano
2014-02-05 21:01 ` Jeff King
2014-02-05 21:08 ` Junio C Hamano
2014-02-05 21:09 ` Jeff King
2014-02-05 21:01 ` Torsten Bögershausen
2014-02-05 20:10 ` Junio C Hamano
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=20140205205405.GA24100@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=stefanbeller@googlemail.com \
--cc=tboegi@web.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).