public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Shawn Pearce <spearce@spearce•org>,
	Git Mailing List <git@vger•kernel.org>
Subject: Re: [PATCH] pack-objects: name pack files after trailer hash
Date: Thu, 05 Dec 2013 14:59:45 -0800	[thread overview]
Message-ID: <xmqq4n6m52fy.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20131205202807.GA19042@sigill.intra.peff.net> (Jeff King's message of "Thu, 5 Dec 2013 15:28:07 -0500")

Jeff King <peff@peff•net> writes:

> The second half would be to simplify git-repack. The current behavior is
> to replace the old packfile with a tricky rename dance. Which is still
> correct, but overly complicated. We should be able to just drop the new
> packfile, since we know the bytes are identical (or rename the new one
> over the old, though I think keeping the old is probably kinder to the
> disk cache, especially if another process already has it mmap'd).

Concurred.

> One test needs to be updated, because it actually corrupts a
> pack and expects that re-packing the corrupted bytes will
> use the same name. It won't anymore, but we can easily just
> use the name that pack-objects hands back.

Re-reading the tests in that script, I am not sure if keeping these
tests is even a sane thing to do, by the way.  It "expects" that
certain breakages are propagated, and anybody who breaks that
expectation by improving pack-objects etc. to catch such breakages
will be yelled at by breaking the test that used to pass.

Seeing that the way the test scripts are line-wrapped follows the
ancient convention, I suspect that this may be because it predates
our more recent best practice to document known breakages with
test_expect_failure.

> diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
> index fe82025..4bbb718 100755
> --- a/t/t5302-pack-index.sh
> +++ b/t/t5302-pack-index.sh
> @@ -174,11 +174,11 @@ test_expect_success \
>  test_expect_success \
>      '[index v1] 5) pack-objects happily reuses corrupted data' \
>      'pack4=$(git pack-objects test-4 <obj-list) &&
> -     test -f "test-4-${pack1}.pack"'
> +     test -f "test-4-${pack4}.pack"'
>  
>  test_expect_success \
>      '[index v1] 6) newly created pack is BAD !' \
> -    'test_must_fail git verify-pack -v "test-4-${pack1}.pack"'
> +    'test_must_fail git verify-pack -v "test-4-${pack4}.pack"'

A good thing is that the above hunks are the right thing to do, even
if we are to modernise these tests so that they document a known
breakage with expect-failure.

Thanks.

  parent reply	other threads:[~2013-12-05 22:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28  3:13 How to resume broke clone ? zhifeng hu
2013-11-28  7:39 ` Trần Ngọc Quân
2013-11-28  7:41   ` zhifeng hu
2013-11-28  8:14     ` Duy Nguyen
2013-11-28  8:35       ` Karsten Blees
2013-11-28  8:50         ` Duy Nguyen
2013-11-28  8:55           ` zhifeng hu
2013-11-28  9:09             ` Duy Nguyen
2013-11-28  9:29               ` Jeff King
2013-11-28 10:17                 ` Duy Nguyen
2013-11-28 19:15                 ` Shawn Pearce
2013-12-04 20:08                   ` Jeff King
2013-12-05  6:50                     ` Shawn Pearce
2013-12-05 13:21                       ` Michael Haggerty
2013-12-05 15:11                         ` Shawn Pearce
2013-12-05 16:12                         ` Jeff King
2013-12-05 16:04                       ` Jeff King
2013-12-05 18:01                         ` Junio C Hamano
2013-12-05 19:08                           ` Jeff King
2013-12-05 20:28                         ` [PATCH] pack-objects: name pack files after trailer hash Jeff King
2013-12-05 21:56                           ` Shawn Pearce
2013-12-05 22:59                           ` Junio C Hamano [this message]
2013-12-06 22:18                             ` Jeff King
2013-12-16  7:41                           ` Michael Haggerty
2013-12-16 19:04                             ` Jeff King
2013-12-16 19:19                               ` Jonathan Nieder
2013-12-16 19:28                                 ` Jeff King
2013-12-16 19:37                                   ` Junio C Hamano
2013-12-16 19:33                               ` Junio C Hamano
2013-12-16 19:35                                 ` Jeff King
2013-11-28  9:20       ` How to resume broke clone ? Tay Ray Chuan
2013-11-28  9:29         ` zhifeng hu
2013-11-28 19:35           ` Shawn Pearce
2013-11-28 21:54           ` Jakub Narebski

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=xmqq4n6m52fy.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    --cc=spearce@spearce$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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