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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 939C4C433B4 for ; Wed, 21 Apr 2021 16:20:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A2586144A for ; Wed, 21 Apr 2021 16:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244261AbhDUQUj convert rfc822-to-8bit (ORCPT ); Wed, 21 Apr 2021 12:20:39 -0400 Received: from mav.lukeshu.com ([104.207.138.63]:59482 "EHLO mav.lukeshu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244255AbhDUQUg (ORCPT ); Wed, 21 Apr 2021 12:20:36 -0400 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 36BD880590; Wed, 21 Apr 2021 12:20:01 -0400 (EDT) Date: Wed, 21 Apr 2021 10:17:51 -0600 Message-ID: <87lf9b393k.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: =?ISO-8859-1?Q?=C6var_Arnfj=F6r=F0?= Bjarmason Cc: Junio C Hamano , Luke Shumaker , git@vger.kernel.org, Luke Shumaker , Elijah Newren , Jeff King Subject: Re: [RFC PATCH] fast-export, fast-import: Let tags specify an internal name In-Reply-To: <87zgxs2gp9.fsf@evledraar.gmail.com> References: <20210420190552.822138-1-lukeshu@lukeshu.com> <87zgxs2gp9.fsf@evledraar.gmail.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 02:18:58 -0600, Ævar Arnfjörð Bjarmason wrote: > > Luke Shumaker writes: > >> This patch adds an optional "name" sub-command to fast-import's "tag" > >> top-level-command, the stream > >> > >> tag foo > >> name bar > >> ... > >> > >> will create a tag at "refs/tags/foo" that says "tag bar" internally. ... > All we [fsck] check is that the pseudo-"refname" is valid, i.e. if we were to > use the thing we find on the "tag" line as a refname, does it pass > check_refname_format()? > > "git tag -v" doesn't care either: > > $ git update-ref refs/tags/a-v-2.31.0 3e90d4b58f3819cfd58ac61cb8668e83d3ea0563 > $ git tag -v a-v-2.31.0 > object a5828ae6b52137b913b978e16cd2334482eb4c1f > type commit > tag v2.31.0 > tagger Junio C Hamano 1615834385 -0700 > [.. snip same gpgp output as for v2.31.0 itself..] > > I think at this point the right thing to do is to just explicitly > document that we ignore it, and that the export/import chain should be > as forgiving about it as possible. > > I.e. we have not cared about this before for validation, and > e.g. core.alternateRefsPrefixes and such things will break any "it > should be under refs/tags/" assumption. > > There's also perfectly legitimate in-the-wild use-cases for this, > e.g. "archiving" tags to not-refs/tags/* so e.g. the upload-pack logic > doesn't consider and follow them. Not being able to export/import those > repositories as-is due to an overzelous data check there that's not in > fsck.c would suck. With that in mind, should I flip it around, to have the refname be more flexible? Have the stream tag foo refname refs/tags/bar ... create a tag at "refs/tags/bar" that says "tag foo" internally? -- Happy hacking, ~ Luke Shumaker