From: Junio C Hamano <gitster@pobox.com>
To: Ephrim Khong <dr.khong@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>, Duy Nguyen <pclouds@gmail.com>,
GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH v3] sha1_file: do not add own object directory as alternate
Date: Tue, 15 Jul 2014 12:48:41 -0700 [thread overview]
Message-ID: <xmqq8unuv1wm.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <53C510A9.4010208@gmail.com> (Ephrim Khong's message of "Tue, 15 Jul 2014 13:29:45 +0200")
Ephrim Khong <dr.khong@gmail.com> writes:
> diff --git a/t/t7702-repack-cyclic-alternate.sh b/t/t7702-repack-cyclic-alternate.sh
> new file mode 100755
> index 0000000..8341d46
> --- /dev/null
> +++ b/t/t7702-repack-cyclic-alternate.sh
> @@ -0,0 +1,24 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2014 Ephrim Khong
> +#
> +
> +test_description='repack involving cyclic alternate'
> +. ./test-lib.sh
> +
> +test_expect_success setup '
> + GIT_OBJECT_DIRECTORY=.git//../.git/objects &&
> + export GIT_OBJECT_DIRECTORY &&
Do you need this artificially strange environment settings for the
problem to manifest itself, or is it sufficient to have a
non-canonical pathname in the info/alternates file?
Exporting an environment early in the test and having later tests in
the file depend on it makes it harder to debug when things go wrong,
than leaving an info/alternates file in the repository, primarily
because the latter can be inspected more easily in the trash
directory after "t7702-*.sh -i" dies, hence the above question.
> + touch a &&
Don't use 'touch' if you are not interested in timestams. Write this as
>a &&
because what you care about here in this test is that an empty file
'a' exists, so that you can run "git add" on it.
> + git add a &&
> + git commit -m 1 &&
> + git repack -adl &&
> + echo "$(pwd)"/.git/objects/../objects >.git/objects/info/alternates
> +'
> +
> +test_expect_success 're-packing repository with itsself as alternate' '
> + git repack -adl &&
> + git fsck
> +'
> +
> +test_done
next prev parent reply other threads:[~2014-07-15 19:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 9:37 [Bug] data loss with cyclic alternates Ephrim Khong
2014-07-11 16:01 ` Junio C Hamano
2014-07-11 18:01 ` Keller, Jacob E
2014-07-12 5:57 ` Jeff King
2014-07-14 22:05 ` Keller, Jacob E
2014-07-13 10:44 ` Ephrim Khong
2014-07-14 9:02 ` [PATCH] sha1_file: do not add own object directory as alternate Ephrim Khong
2014-07-14 10:47 ` Duy Nguyen
2014-07-14 12:53 ` [PATCH v2] " Ephrim Khong
2014-07-15 5:44 ` Johannes Sixt
2014-07-15 11:29 ` [PATCH v3] " Ephrim Khong
2014-07-15 19:26 ` Junio C Hamano
2014-07-16 6:42 ` Ephrim Khong
2014-07-15 19:33 ` Eric Sunshine
2014-07-15 19:48 ` Junio C Hamano [this message]
2014-07-16 6:47 ` Ephrim Khong
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=xmqq8unuv1wm.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=dr.khong@gmail.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=pclouds@gmail.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.