From: Junio C Hamano <gitster@pobox.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: t1450-fsck (sometimes/often) failes on Mac OS X
Date: Tue, 02 Oct 2012 14:01:08 -0700 [thread overview]
Message-ID: <7v4nmc7fmz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <506B110B.2050802@web.de> ("Torsten Bögershausen"'s message of "Tue, 02 Oct 2012 18:06:35 +0200")
Torsten Bögershausen <tboegi@web.de> writes:
> With help of Junio's comments I probably found the reason why the test
> behaves differently:
>
> The objects are checked in a certain order, based on the inode number.
>
> Which seems to be the same on most machines: when files are created
> in a certain order, then the inode numbers are in the same order.
>
> When the inode numbering changes for reasons known to the file system,
> the order changes and fsck takes a different code path.
>
> To provoke the error, the following helped at my Linux box:
>
> diff --git a/builtin/fsck.c b/builtin/fsck.c
> index a710227..bba8082 100644
> --- a/builtin/fsck.c
> +++ b/builtin/fsck.c
> @@ -373,7 +373,7 @@ static struct {
>
> static int ino_compare(const void *_a, const void *_b)
> {
> - const struct sha1_entry *a = _a, *b = _b;
> + const struct sha1_entry *a = _b, *b = _a;
> unsigned long ino1 = a->ino, ino2 = b->ino;
> return ino1 < ino2 ? -1 : ino1 > ino2 ? 1 : 0;
> }
>
> The bad news: I haven't found the time to prepare a fix.
Thanks for a reproduction. Yes, the test t1450.13 is expecting too
much.
If it finds the $sha blob first and then looks at $tag tag, then it
will notice that the tag is pointing at a blob but claims it must be
a commit. If it finds the $tag tag first, it will remember that the
tag claimed $sha must be a commit, and when later it sees $sha, it
finds that it is not of the type it is expecting (namely, a commit),
and says "the object called $sha is broken".
So "test_must_fail git fsck --tags" is correct. The fsck must find
the breakage either way.
The last piece to expect "error in tag.*broken links" in the output
is wrong. Probably we should remove the misguided check and end
it with "test_must_fail git fsck --tags".
next prev parent reply other threads:[~2012-10-02 21:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-14 12:21 t1450-fsck (sometimes/often) failes on Mac OS X Torsten Bögershausen
2012-07-15 9:08 ` Jeff King
2012-07-15 13:03 ` Torsten Bögershausen
2012-09-19 16:04 ` Torsten Bögershausen
2012-09-19 18:30 ` Junio C Hamano
2012-09-19 20:23 ` Torsten Bögershausen
2012-10-02 16:06 ` Torsten Bögershausen
2012-10-02 21:01 ` Junio C Hamano [this message]
2012-10-02 22:21 ` Junio C Hamano
2012-10-03 19:37 ` Torsten Bögershausen
2012-07-16 7:57 ` Thomas Rast
2012-07-16 16:06 ` Torsten Bögershausen
2012-07-28 15:43 ` Heiko Voigt
2012-07-28 16:00 ` Thomas Rast
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v4nmc7fmz.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).