From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id E01751F5AE for ; Fri, 31 Jul 2020 23:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726925AbgGaXPX (ORCPT ); Fri, 31 Jul 2020 19:15:23 -0400 Received: from cloud.peff.net ([104.130.231.41]:44636 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbgGaXPX (ORCPT ); Fri, 31 Jul 2020 19:15:23 -0400 Received: (qmail 27454 invoked by uid 109); 31 Jul 2020 23:15:23 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 31 Jul 2020 23:15:23 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 2732 invoked by uid 111); 31 Jul 2020 23:15:22 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 31 Jul 2020 19:15:22 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 31 Jul 2020 19:15:21 -0400 From: Jeff King To: "Jason Pyeron" Cc: "'Junio C Hamano'" , Subject: Re: I have gone and done a bad thing - malformed tree objects Message-ID: <20200731231521.GB1461090@coredump.intra.peff.net> References: <19ca801d66541$cf872af0$6e9580d0$@pdinc.us> <19cab01d66544$ecb402d0$c61c0870$@pdinc.us> <045701d6678f$1f03df20$5d0b9d60$@pdinc.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <045701d6678f$1f03df20$5d0b9d60$@pdinc.us> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 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