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-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 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 2806A1F5AE for ; Wed, 21 Apr 2021 17:28:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241375AbhDUR3D convert rfc822-to-8bit (ORCPT ); Wed, 21 Apr 2021 13:29:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239320AbhDUR3C (ORCPT ); Wed, 21 Apr 2021 13:29:02 -0400 Received: from mav.lukeshu.com (mav.lukeshu.com [IPv6:2001:19f0:5c00:8069:5400:ff:fe26:6a86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C9DC06174A for ; Wed, 21 Apr 2021 10:28:28 -0700 (PDT) Received: from lukeshu-dw-thinkpad (c-73-229-136-185.hsd1.co.comcast.net [73.229.136.185]) by mav.lukeshu.com (Postfix) with ESMTPSA id 7ED7280590; Wed, 21 Apr 2021 13:28:27 -0400 (EDT) Date: Wed, 21 Apr 2021 11:26:17 -0600 Message-ID: <87im4f35xi.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: =?ISO-8859-1?Q?=C6var_Arnfj=F6r=F0?= Bjarmason Cc: Luke Shumaker , git@vger.kernel.org, Luke Shumaker Subject: Re: [RFC PATCH] fast-export, fast-import: Let tags specify an internal name In-Reply-To: <87k0ov38bv.wl-lukeshu@lukeshu.com> References: <20210420190552.822138-1-lukeshu@lukeshu.com> <8735vk3vyq.fsf@evledraar.gmail.com> <87k0ov38bv.wl-lukeshu@lukeshu.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, 21 Apr 2021 10:34:28 -0600, Luke Shumaker wrote: > On Wed, 21 Apr 2021 02:03:57 -0600, > Ævar Arnfjörð Bjarmason wrote: > > On Tue, Apr 20 2021, Luke Shumaker wrote: > > > + tagname = memmem(buf, message ? message - buf : size, "\ntag ", 5); > > > + if (!tagname) > > > + die("malformed tag %s", oid_to_hex(&tag->object.oid)); > > > + tagname += 5; > > > + tagname_end = strchrnul(tagname, '\n'); > > > > So it's no longer possible to export a reporitory with a missing "tag" > > entry in a tag? Maybe OK, but we have an escape hatch for it with fsck, > > we don't need one here? > > > > In any case a test for it would be good to have. > > I hadn't realized that it was possible for a tag object to be missing > the "tag" entry, I will fix that. Actually, can you expand on that? I don't see the escape hatch you speak of. `git hash-object` doesn't want to even create such an object ("fatal: corrupt tag"), and I had to pass `--literally` to even create the object. `git update-ref` doesn't want to even acknowledge the object to create the ref pointing to it ("fatal: cannot update ref 'refs/tags/badtag': trying to write ref 'refs/tags/badtag' with nonexistent object HASH"), and I had to `echo HASH > .git/refs/tags/badtag` to create the ref. And then `git fsck` (even with `--no-tags`) complains about the object ("error: HASH: object could not be parsed: .git/objects/HA/SH"). It is my reading of the code that `parse_tag_buffer` will always fail to parse such an object, and so `fsck_walk_tag` and `fsck_walk` will always bubble up an error. -- Happy hacking, ~ Luke Shumaker