git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git doesn't finds the parent of a commit (was: How to fetch missing pack)

From
JSJörg Sommer <joerg@alea.gnuu.de>
Date
Apr 27, 2008, 10:47 UTC
Message-ID
<20080427104704.GA11784@alea.gnuu.de>
In-Reply-To
<20080424060857.GX29771@spearce.org>
Hi,
Shawn O. Pearce schrieb am Thu 24. Apr, 02:08 (-0400):
Show 10 quoted lines
> If you know the name of the objects you are missing, you can
> make a temporary pack to transfer the list of objects:
> 
> 	# at good repo
> 	#
> 	git pack-objects --stdout <object.list >save.pack
> 
> 	# at bad repo
> 	#
> 	git index-pack --stdin <save.pack

I didn't know the list of objects I'm missing, but I used this little script do find them:

anchor=7cb192eab0251911e2ca77d4ecceb621dd2d34f5
while true
do
    outp=$(git log --pretty=raw --raw $anchor 2>&1 >/dev/null)
    echo $outp
    [ $#outp -eq 0 ] && break
    cmt=${${outp##* \(}%\)}
    git cat-file -t $cmt >/dev/null 2>&1 && \
      cmt=$(git cat-file commit $cmt |grep '^tree ')
    echo ${cmt##* } | ssh server cd git\; git pack-objects --stdout | \
      git index-pack --stdin >/dev/null
done
Maybe it helps someone else. :)
But now, there's something else broken.

% git cat-file commit b63e99500137c913bd801a2f22b6cf88c63b95c5 tree 68a58fb97935f35c6fb7bcbcfed73b1697db000a parent 3f061887c562b20d3ed3d1f764462cf986a1ad12 author Wincent Colaiuta <win@wincent.com> 1195996542 +0100 committer Junio C Hamano <gitster@pobox.com> 1196019475 -0800

Add "--patch" option to git-add--interactive

When the "--patch" option is supplied, the patch_update_cmd() function is …

% git cat-file commit 3f061887c562b20d3ed3d1f764462cf986a1ad12 tree 636a0f9c085aac7ba539ef2ace03b3081481891a parent 324ccbd6a09816af830b22b02bbeb06349141849 author Junio C Hamano <gitster@pobox.com> 1196014210 -0800 committer Junio C Hamano <gitster@pobox.com> 1196014993 -0800

add -i: Fix running from a subdirectory

This fixes the pathspec interactive_add() passes to the underlying …

% git rev-parse b63e99500137c913bd801a2f22b6cf88c63b95c5~1 b63e99500137c913bd801a2f22b6cf88c63b95c5~1 fatal: ambiguous argument 'b63e99500137c913bd801a2f22b6cf88c63b95c5~1': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

Can someone tell me what I'm doing wrong?
> Note that you may need to do this several times; e.g. if you are
> missing a tree you won't know what blobs you are missing until
> you load the tree and run fsck --full again to parse the tree and
> discover the missing blobs.
fsck --full reports only dangling objects, no breakage.
Bye, Jörg.
-- 
Die zehn Gebote Gottes enthalten 172 Wörter, die amerikanische
Unabhängigkeitserklärung 300 Wörter, die Verordnung der europäischen
Gemeinschaft über den Import von Karamelbonbons exakt 25911 Wörter.
Previous: Shawn O. PearceNext: Stephen R. van den Berg
Message 6 of 10 in “How to fetch missing pack”
  1. Jörg SommerApr 12, 2008
  2. Peter BaumannApr 13, 2008
  3. Jörg SommerApr 23, 2008
  4. Christian CouderApr 24, 2008
  5. Shawn O. PearceApr 24, 2008
  6. git doesn't finds the parent of a commit (was: How to fetch missing pack)Jörg Sommer, Apr 27, 2008
  7. Stephen R. van den BergApr 27, 2008
  8. Junio C HamanoApr 27, 2008
  9. Stephen R. van den BergApr 27, 2008
  10. Jörg SommerApr 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.