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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 6A8CD1F4D7 for ; Thu, 26 May 2022 09:09:53 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=web.de header.i=@web.de header.b="j5MvL401"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346835AbiEZJJs (ORCPT ); Thu, 26 May 2022 05:09:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239996AbiEZJJp (ORCPT ); Thu, 26 May 2022 05:09:45 -0400 Received: from mout.web.de (mout.web.de [212.227.15.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DE111FCC0 for ; Thu, 26 May 2022 02:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1653556157; bh=63HbYwbaiYE7eEjEXLzqOp0J76EIVn025mRXs/z6IDQ=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=j5MvL4011wKnc6h3uyXHCIr+ZK+p14E1ZiO+3+6JpmPo5gyG0E9WcP8YPWcJzjfrC lGxvDVYs74Ldjf/DW9wKw6hV3Bu2phToZmR188F+KF4SU6htmbI+V6ZHmzOdDAqPGs 6Ge1OD9JUk3H6Ue8SNQ5cOLrW8VDd5ezLqcjrbMs= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.29] ([79.203.31.99]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N79NA-1nmaLh2JBM-017J0G; Thu, 26 May 2022 11:09:17 +0200 Message-ID: <7815a07a-da2f-d348-4179-6dc5b1d5fee6@web.de> Date: Thu, 26 May 2022 11:09:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v6 1/7] archive: optionally add "virtual" files Content-Language: en-US To: Junio C Hamano , Johannes Schindelin via GitGitGadget Cc: git@vger.kernel.org, Taylor Blau , Derrick Stolee , Elijah Newren , rsbecker@nexbridge.com, =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Johannes Schindelin References: <0005cfae31d52a157d4df5ba3db9f9f5b2167ddc.1653145696.git.gitgitgadget@gmail.com> From: =?UTF-8?Q?Ren=c3=a9_Scharfe?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ADdXO4uJrmwpV6aojqE8GViOyJxYJHi32PDZzVb/7sR1OYC/cYa R0xXiv47tznAJrF3Ejg1TrJPUMCX6MIivxwQ+rjt0uciihHJC1WdAEfvzVXEeEJntdm9QF+ pDayQiWIrXXPH5kJioTijhthKop1tHgqX03ibrydtwtZfhIAE3fb9ipFiZQApoqbhzRaNOR i0oxpwqPUuwiDjDP9s3Qg== X-UI-Out-Filterresults: notjunk:1;V03:K0:44ZjoqnEjJ4=:IVDIazG6W+gV3o7T4eDN2Y 0VlKC93rvIduQTEGxrQpADn+iT5m1SrxnE+P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IbvLn VXFz/WkaGXHs1C4OXuZqdSQMqe32GiYx5aX Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 25.05.22 um 23:11 schrieb Junio C Hamano: > "Johannes Schindelin via GitGitGadget" > writes: > >> @@ -61,6 +61,17 @@ OPTIONS >> by concatenating the value for `--prefix` (if any) and the >> basename of . >> >> +--add-virtual-file=3D::: >> + Add the specified contents to the archive. Can be repeated to add >> + multiple files. The path of the file in the archive is built >> + by concatenating the value for `--prefix` (if any) and the >> + basename of . > > This sentence was copy-pasted from --add-file without adjusting. > There is no ; this new feature gives . > > Also, I suspect that the feature is losing end-user supplied > information without a good reason. --add-file=3D may have > prepared an input in a randomly named temporary directory and it > would make quite a lot of sense to strip the leading directory > components from and use only the basename part. But the > given to "--add-virtual-file" does not refer to anything on > the filesystem. Its ONLY use is to be used as the path in the > archive to store the content. There is no justification why we > would discard the leading path components from it. Good point. > I am not > decided, but I am inclined to say that we should not honor > "--prefix". > > $ git archive --prefix=3D2.36.0 v2.36.0 > > would be a way to create a single directory and put everything in > the tree-ish in there, but there probably are cases where the user > of an "extra file" feature wants to add untracked cruft _in_ that > directory, and there are other cases where an extra file wants to go > to the top-level next to the 2.36.0 directory. A user can use the > same string as --prefix=3D in front of if the extra file > should go next to the top-level of the tree-ish, or without such > prefixing to place the extra file at the top-level. If the prefix is applied then a prefix-less extra file can by had by using --prefix=3D or --no-prefix for it and --prefix=3D... for the tree, e.g.: $ git archive --add-file=3Dextra --prefix=3Ddir/ v2.36.0 puts "extra" at the root and the rest under "dir". The order of arguments matters here, and the default prefix is the empty string. So extra files can be put anywhere even if --prefix is honored. Keeping the whole path from --add-virtual-file makes sense to me; I slightly prefer applying --prefix on top of that for consistency. Ren=C3=A9