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

RE: I have gone and done a bad thing - malformed tree objects

From
Jason Pyeron <jpyeron@pdinc.us>
Date
Aug 1, 2020, 00:01 UTC
Message-ID
<046201d66796$fb575bd0$f2061370$@pdinc.us>
In-Reply-To
<20200731231521.GB1461090@coredump.intra.peff.net>
Show 28 quoted lines
> From: Jeff King
> Sent: Friday, July 31, 2020 7:15 PM
> 
> On Fri, Jul 31, 2020 at 07:05:42PM -0400, Jason Pyeron wrote:
> 
> > > If the cruft has already been stored in a packfile, then prune would
> > > not touch it.  "git repack -a -d && git prune --expire=now" would be
> > > the next thing to do.
> >
> > $ git repack -a -d && git prune --expire=now
> > Enumerating objects: 327236, done.
> > Counting objects: 100% (327125/327125), done.
> > Delta compression using up to 8 threads
> > Compressing objects: 100% (104728/104728), done.
> > Writing objects: 100% (327125/327125), done.
> > Total 327125 (delta 205244), reused 326116 (delta 204678), pack-reused 0
> >
> > $ git cat-file --batch-all-objects --batch=objecttype
> > fatal: object 00009623a06b8dea7c151542fc789539599c07d0 changed type!?
> 
> That should be dropping everything that isn't reachable. I'd suggest to
> expire reflogs, though it looks like you've also tried "git gc" with
> reflog expiration. Does removing .git/logs entirely help?
> 
> If not, are you sure it isn't actually reachable from your history? What
> does:
> 
>   git rev-list --all --objects | grep 00009623a06

$ git rev-list --all --objects | grep 00009623a06 00009623a06b8dea7c151542fc789539599c07d0 src/htdocs (it is still running...)

But that is an expected result, I will be back at work on Sunday.
Show 10 quoted lines
> 
> say? If no hits, does adding --reflogs to the command-line change it?
> 
> We also consider blobs in the index reachable. I don't recall offhand
> whether that applies to trees mentioned by the cache-trees extension. I
> don't _think_ that would apply to your broken tree, since they'd have
> been generated by Git itself, but possibly removing .git/index (if this
> isn't a bare repo) would help?
> 
> -Peff
Previous: Jeff KingNext: Jeff King
Message 7 of 9 in “I have gone and done a bad thing - malformed tree objects”
  1. Jason PyeronJul 29, 2020
  2. Junio C HamanoJul 29, 2020
  3. Jason PyeronJul 29, 2020
  4. Junio C HamanoJul 29, 2020
  5. Jason PyeronJul 31, 2020
  6. Jeff KingJul 31, 2020
  7. Jason PyeronAug 1, 2020
  8. Jeff KingAug 1, 2020
  9. Jason PyeronAug 2, 2020

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.