From: "Jason Sewall" <jasonsewall@gmail.com>
To: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>
Subject: New repo quickly corrupted
Date: Thu, 15 Nov 2007 16:50:15 -0500 [thread overview]
Message-ID: <31e9dd080711151350u6c2ae40foc7c05e59496260fa@mail.gmail.com> (raw)
I was working on a new repo created from a tar snapshot of an old
project, and after about a half-hour and about 5 commits for hacking,
I had fixed the problem I set out to take care of.
However, I tried to run git gc to clean it up and put it away and I
was met with the following:
[sewall@hobo SWIFT++_1.2 (master)]$ git gc
Counting objects: 227, done.
error: corrupt loose object '680aba836639d14a36b81f9e29da52bd9af69770'
fatal: object 680aba836639d14a36b81f9e29da52bd9af69770 cannot be read
error: failed to run repack
I've followed discussions on the list about corrupted repos and did
[sewall@hobo SWIFT++_1.2 (master)]$ git fsck
error: corrupt loose object '24bbb41919ef906db6f40c3c80f246b7e0cdf9f4'
error: 24bbb41919ef906db6f40c3c80f246b7e0cdf9f4: object corrupt or missing
error: corrupt loose object '680aba836639d14a36b81f9e29da52bd9af69770'
error: 680aba836639d14a36b81f9e29da52bd9af69770: object corrupt or missing
error: 8de8382bdc3cc5f936670df414b33ee63927f3a4: object corrupt or missing
error: corrupt loose object 'd186d23e87ddf344acc56f48e3cf2f61c7a47e16'
error: d186d23e87ddf344acc56f48e3cf2f61c7a47e16: object corrupt or missing
missing blob 680aba836639d14a36b81f9e29da52bd9af69770
missing blob 8de8382bdc3cc5f936670df414b33ee63927f3a4
missing blob d186d23e87ddf344acc56f48e3cf2f61c7a47e16
missing blob 24bbb41919ef906db6f40c3c80f246b7e0cdf9f4
And since these were all blobs, I looked for em with git-log:
[sewall@hobo SWIFT++_1.2 (master)]$ git log --raw --all | grep 24bbb*
[sewall@hobo SWIFT++_1.2 (master)]$ git log --raw --all | grep d186*
[sewall@hobo SWIFT++_1.2 (master)]$ git log --raw --all | grep 8de83*
[sewall@hobo SWIFT++_1.2 (master)]$ git log --raw --all | grep 680ab*
So it would assume that these are dangling objects. Given the simple
history of the repo, the only think I can think of that could have
caused it would be that my first commit was of the original files, and
I immediately remembered that I wanted to run dos2unix on the files so
I did and did a commit -a --amend.
I untarred the original snapshot again and ran git-hash-object over
all the files, and sure enough each of those missing hashes
corresponds to a blob in the original (non-dos2unix'd) file.
I copied the corrupted repo, manually deleted those objects, then
hash-object -w the appropriate originals back in. git-fsck was
mollified.
Finally, I tried repeating the process and the same error occurs.
In summary:
unzip original.zip
git init
git add .
git commit -m "Initial commit"
find . -type f -exec dos2unix {} +
git commit -a --amend
[accept same message]
git fsck
[same error message as above]
I just built my git today, unmodified:
git version 1.5.3.5.721.g039b
What's going on?
Jason
P.S. These files aren't particularly secret, so I'm happy to post them
if need be. Its actually someone else's code (a fellow student who
graduated some time before I arrived in grad school); I was asked to
modernize it enough to compile on on the latest gcc.
next reply other threads:[~2007-11-15 21:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 21:50 Jason Sewall [this message]
2007-11-15 21:55 ` New repo quickly corrupted Junio C Hamano
2007-11-15 21:59 ` Jason Sewall
2007-11-15 22:01 ` Linus Torvalds
2007-11-15 22:06 ` Jason Sewall
2007-11-15 22:12 ` Nicolas Pitre
2007-11-15 22:37 ` Linus Torvalds
2007-11-16 5:45 ` Christian Couder
2007-11-16 7:35 ` Andreas Ericsson
2007-11-17 12:53 ` Christian Couder
2007-11-17 14:13 ` Robin Rosenberg
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=31e9dd080711151350u6c2ae40foc7c05e59496260fa@mail.gmail.com \
--to=jasonsewall@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 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).