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 A09B9C433B4 for ; Wed, 21 Apr 2021 18:50:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6BADB6113B for ; Wed, 21 Apr 2021 18:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245258AbhDUSvY convert rfc822-to-8bit (ORCPT ); Wed, 21 Apr 2021 14:51:24 -0400 Received: from mav.lukeshu.com ([104.207.138.63]:59664 "EHLO mav.lukeshu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243061AbhDUSvX (ORCPT ); Wed, 21 Apr 2021 14:51:23 -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 D7A0F80590; Wed, 21 Apr 2021 14:50:49 -0400 (EDT) Date: Wed, 21 Apr 2021 12:48:39 -0600 Message-ID: <87h7jz3248.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: Elijah Newren Cc: =?ISO-8859-1?Q?=C6var_Arnfj=F6r=F0?= Bjarmason , Luke Shumaker , Git Mailing List , Luke Shumaker Subject: Re: [RFC PATCH] fast-export, fast-import: Let tags specify an internal name In-Reply-To: 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 12:34:26 -0600, Elijah Newren wrote: > On Wed, Apr 21, 2021 at 1:19 AM Ævar Arnfjörð Bjarmason > wrote: > > 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. > > Not would suck, but does suck. I had to document it as a shortcoming > of fast-export/fast-import -- see > https://www.mankier.com/1/git-filter-repo#Internals-Limitations, where > I wrote, "annotated and signed tags outside of the refs/tags/ > namespace are not supported (their location will be mangled in weird > ways)". > > The problem is, what's the right backward-compatible way to fix this? > Do we have to add a flag to both fast-export and fast-import to stop > assuming a "refs/tags/" prefix and use the full refname, and require > the user to pass both flags? How is fast-import supposed to know that > "refs/alternate-tags/foo" is or isn't > "refs/tags/refs/alternate-tags/foo"? > > And if we need such a flag, should fast-import die if it sees this new > "name" directive and the flag isn't given? Elsehwere in the thread, I responded to some feedback by suggesting that perhaps I should flip it around, and instead add a 'refname' sub-command, and have it default to 'refs/tags/{tagname}' So the stream tag foo ... would create a tag at "refs/tags/foo" that says "tag foo". And the stream tag bar refname refs/alternate-tags/baz would create a tag at "refs/alternate-tags/baz" that says "tag bar". Grepping for "refs/tags" in fast-export.c and fast-import.c, I think that would fully address this concern. -- Happy hacking, ~ Luke Shumaker