git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Magnus Bäck" <magnus.back@sonyericsson.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: git@vger.kernel.org
Subject: Re: Inspecting a corrupt git object
Date: Wed, 4 Aug 2010 15:02:29 +0200	[thread overview]
Message-ID: <20100804130229.GA1537@jpl.local> (raw)
In-Reply-To: <201008041148.49668.trast@student.ethz.ch>

On Wednesday, August 04, 2010 at 11:48 CEST,
     Thomas Rast <trast@student.ethz.ch> wrote:

> Magnus Bäck wrote:
>
> > From what I gather from the community book and Pro Git, a git object
> > file is a deflated representation of the object type as a string,
> > the payload size, a null byte, and the payload. Is there a standard
> > tool for inflating the file back so that I can inspect what the
> > actual difference between these two are? Short of writing a tool
> > utilizing zlib, at least.
> 
> I'm sure it's a one-liner in almost any scripting language, e.g. you
> can use
> 
>   python -c 'import sys,zlib; sys.stdout.write(zlib.decompress(open(sys.argv[1]).read()))'
> 
> with a filename argument if you have Python at hand.

That worked fine, thanks. Apparently this difference in the second byte
of the compressed data makes no difference for the end result -- the two
inflated files are identical.

Interestingly, just as we were about to transplant the loose object from
my working repository to the server where "git gc" failed and the object
was seemingly corrupt, the person doing the actual work (I don't have
access to the server) ran "git gc" to find the id of the bad object, and
suddenly it completed without errors. The object in question had now
been included in a packfile, and upon unpacking that packfile to inspect
the object it was identical to the file I had, i.e. the new loose object
was different from the original loose object. I had expected a loose
object -> packfile -> loose object cycle to not change anything.
Everything seems to be back to normal now, which is good, but I prefer
I understand why things get fixed.

We did have some initial problems with reaching the per-process limit
for open files (as no repack had been done for an extended time and 5000
packfiles were lingering), but it seems weird for such a problem to be
related to the possible corruptness of a single tree object.

-- 
Magnus Bäck                      Opinions are my own and do not necessarily
SW Configuration Manager         represent the ones of my employer, etc.
Sony Ericsson

  reply	other threads:[~2010-08-04 13:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04  9:25 Inspecting a corrupt git object Magnus Bäck
2010-08-04  9:48 ` Alejandro Riveira Fernández
2010-08-04 13:09   ` Magnus Bäck
2010-08-04  9:48 ` Thomas Rast
2010-08-04 13:02   ` Magnus Bäck [this message]
2010-08-04 11:11 ` Holger Hellmuth

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=20100804130229.GA1537@jpl.local \
    --to=magnus.back@sonyericsson.com \
    --cc=git@vger.kernel.org \
    --cc=trast@student.ethz.ch \
    /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).