git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yossi Leybovich" <sleybo@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org, ae@op5.se,
	"Yossi Leybovich" <sleybo@mellanox.co.il>
Subject: Re: corrupt object on git-gc
Date: Fri, 9 Nov 2007 12:53:51 -0500	[thread overview]
Message-ID: <4fe79b4b0711090953h5b06f7d4l2d17972630a4d355@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.0.999.0711090758560.15101@woody.linux-foundation.org>

On Nov 9, 2007 11:28 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote:
> and you should now have a line that looks like
>
>        10064 blob 4b9458b3786228369c63936db65827de3cc06200     my-magic-file

That works and now I know the file
>
> The easiest way to do it is to do
>
>        git log --raw --all --full-history -- subdirectory/my-magic-file
>
> and that will show you the whole log for that file (please realize that
> the tree you had may not be the top-level tree, so you need to figure out
> which subdirectory it was in on your own), and because you're asking for
> raw output, you'll now get something like
>
>        commit abc
>        Author:
>        Date:
>          ..
>        :100644 100644 4b9458b... newsha... M  somedirectory/my-magic-file
>
>
>        commit xyz
>        Author:
>        Date:
>
>          ..
>        :100644 100644 oldsha... 4b9458b... M   somedirectory/my-magic-file
>
> and this actually tells you what the *previous* and *subsequent* versions
> of that file were! So now you can look at those ("oldsha" and "newsha"
> respectively), and hopefully you have done commits often, and can
> re-create the missing my-magic-file version by looking at those older and
> newer versions!
>
> If you can do that, you can now recreate the missing object with

Ok, tried that and unfortuantly the SHA1 number is apear only one

[mellanox@mellanox-compile ib]$ git log --raw --all --full-history --
SymmK/St.c  | grep 4b9
:100755 100755 308806c... 4b9458b3786228369c63936db65827de3cc06200 M
 SymmK/St.c

git log --raw --all --full-history -- SymmK/St.c

...
...
commit 597e70e7dc8e06a7cdbe4d9e9727411c964bd023
Author: sleybo <sleybo@mellanox.co.il>
Date:   Fri Oct 5 10:41:43 2007 -0400

    1. increase QPs parameters - QP is bigger than 4k
    2. lock buffers use the dma key
    3. add prints

:100755 100755 308806c... 4b9458b3786228369c63936db65827de3cc06200 M
 SymmK/St.c


What intersting is that the SHA1 that I looked for apear only once
(only as new SHA1)

So I checkout version of the file which produce the old SHA1 308806c....

[mellanox@mellanox-compile ib-tmp]$ git checkout mlx4-start -- SymmK/St.c
[mellanox@mellanox-compile ib-tmp]$  git hash-object -w SymmK/St.c
308806cf3a864656a49d00edc35b9505abd627a2

than I did
[mellanox@mellanox-compile ib-tmp]$ git diff-tree --stdin -p --pretty
597e70e7dc8e06a7cdbe4d9e9727411c964bd023  > commit-597e70e

( which is the commit SHA1)

[mellanox@mellanox-compile ib-tmp]$ git apply commit-597e70e
Adds trailing whitespace.
../ib/commit-597e70e:1622:
Adds trailing whitespace.
../ib/commit-597e70e:1646:                      (int)devif->lock_dma +
lockid*sizeof(u64),
warning: 2 lines add whitespace errors.
[mellanox@mellanox-compile ib-tmp]$  git hash-object -w SymmK/St.c
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391


So the same commit actual lead to the wrong SHA1
(I tried this flow on different file and it works)

I think I am close but still not there , any suggestions ?

Thanks
Yossi

  parent reply	other threads:[~2007-11-09 17:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09 13:38 corrupt object on git-gc Yossi Leybovich
2007-11-09 13:46 ` Andreas Ericsson
2007-11-09 15:01   ` Yossi Leybovich
2007-11-09 15:34     ` Johannes Sixt
2007-11-09 15:53       ` Yossi Leybovich
2007-11-09 16:03         ` Johannes Sixt
2007-11-09 16:03         ` Nicolas Pitre
2007-11-09 16:31           ` Yossi Leybovich
2007-11-09 16:52             ` Nicolas Pitre
2007-11-09 16:28 ` Linus Torvalds
2007-11-09 17:28   ` [PATCH] add a howto document about corrupted blob recovery Nicolas Pitre
2007-11-09 17:30     ` Johannes Schindelin
2007-11-26  2:12     ` J. Bruce Fields
2007-11-09 17:53   ` Yossi Leybovich [this message]
2007-11-09 18:02     ` corrupt object on git-gc Linus Torvalds
2007-11-09 18:37       ` Yossi Leybovich
2007-11-09 18:55         ` Linus Torvalds
2007-11-09 19:07           ` Mike Hommey
2007-11-09 19:41             ` Yossi Leybovich
2007-11-09 19:52               ` Mike Hommey
     [not found] <6C2C79E72C305246B504CBA17B5500C902535D9C@mtlexch01.mtl.com>
     [not found] ` <458BC6B0F287034F92FE78908BD01CE814472B3D@mtlexch01.mtl.com>
2007-11-08 23:59   ` Yossi Leybovich
2007-11-09  5:13     ` Christian Couder
2007-11-09 12:16       ` Yossi Leybovich
2007-11-09 17:45         ` Junio C Hamano
2007-11-09  8:10     ` Alex Riesen
2007-11-09 12:23       ` Yossi Leybovich
2007-11-09 12:56         ` Andreas Ericsson
2007-11-09 16:17       ` Nicolas Pitre

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=4fe79b4b0711090953h5b06f7d4l2d17972630a4d355@mail.gmail.com \
    --to=sleybo@gmail.com \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=sleybo@mellanox.co.il \
    --cc=torvalds@linux-foundation.org \
    /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).