From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 892C7C4338F for ; Tue, 24 Aug 2021 19:01:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59EBA61178 for ; Tue, 24 Aug 2021 19:01:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233976AbhHXTCh (ORCPT ); Tue, 24 Aug 2021 15:02:37 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:60706 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233770AbhHXTCh (ORCPT ); Tue, 24 Aug 2021 15:02:37 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6BD51D238B; Tue, 24 Aug 2021 15:01:52 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=elbXAlLPoScZ kW+NVt29U1LO9IS6UDVHAWW/3sXJkuY=; b=e1EqHn8ZRtTPSyuhYoPHRdDBCOZR OH9HT00XD5ZeDnm2ZUdRrttLNK9xX8hZUSD88Nl8I6ZdLmd01Z8uKQ9gHOi/eVIJ yGVIFbGA7zjFBtl3UkJ7aIQyC31K1KGwmv55dPJ/ysjuIRAImWPSKDHOBDg9tGkz Dj2qAFZ1WG9spow= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 62B0FD238A; Tue, 24 Aug 2021 15:01:52 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.116.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id CA7E7D2388; Tue, 24 Aug 2021 15:01:51 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Johannes Berg Cc: git@vger.kernel.org, Taylor Blau , Derrick Stolee , Jeff King Subject: Re: [PATCH v3] multi-pack-index: fix *.rev cleanups with --object-dir References: <20210823171011.80588-1-johannes@sipsolutions.net> Date: Tue, 24 Aug 2021 12:01:51 -0700 In-Reply-To: (Johannes Berg's message of "Tue, 24 Aug 2021 09:59:02 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: BDCA11E8-050D-11EC-AD0B-FD8818BA3BAF-77302942!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Johannes Berg writes: > On Mon, 2021-08-23 at 15:44 -0700, Junio C Hamano wrote: >> Johannes Berg writes: >>=20 >> > If using --object-dir to point into a repo while the current >> > working dir is outside, such as >> >=20 >> > =C2=A0=C2=A0git init /repo >> > =C2=A0=C2=A0git -C /repo ... # add some objects >> > =C2=A0=C2=A0cd /non-repo >> > =C2=A0=C2=A0git multi-pack-index --object-dir /repo/.git/objects/ wr= ite >> >=20 >> > the binary will segfault trying to access the object-dir via >> > the repo it found, but that's not fully initialized. Fix it >>=20 >> OK, so write_midx_internal() was given an object_dir to work in, >> made various changes to that directory, but at the very end of the >> sequence, instead of clearing the revindex in the object_dir we have >> been working in, cleared the odb associated with the repository. > > I'm not sure I'd claim "cleared the odb" but it's also not entirely > clear to me what you mean by that. "cleared the revindex in the wrong odb" is what I meant to say.