git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Tom Scogland <scogland1@llnl.gov>
Cc: Tom Scogland via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] archive: make --add-virtual-file honor --prefix
Date: Mon, 20 May 2024 19:07:22 +0200	[thread overview]
Message-ID: <01b21870-b37e-47fe-9bd7-225499ae5eaf@web.de> (raw)
In-Reply-To: <95B94723-BCBF-48B4-A02C-A5C61FB060DA@llnl.gov>

Am 20.05.24 um 18:10 schrieb Tom Scogland:
>
> On 19 May 2024, at 6:25, René Scharfe wrote:
>
>> You can already specify any path you want with --add-virtual-file.
>> What's the advantage of honoring --prefix as well?
>
> I came into this after trying to translate an --add-file to an
> --add-virtual-file and being surprised that the prefix wasn't
> applied.

Understandable, the documentation promised otherwise and the options
have very similar names.

> anything else you add, in the repo or not, it gets the prefix.> I can go back and explicitly add the prefix, but it makes the
> options less naturally composable in my opinion.

True, applying the prefix to all items would be simpler overall.

Speaking of simpler: --add-virtual-file could have been implemented to
only take a single argument -- the content -- and rely on --prefix to
provide the full path.  That's more consistent with other options, as
most of them only take single-valued arguments (or none). :]

> That said, it sounds like both you and Junio prefer updating the docs
> rather than the code, which makes me think I'm in the minority in
> that opinion.

I'm not sure I have an opinion on that topic, yet.  Fixing the
documentation is certainly easier.  Adding the prefix to the path of
virtual files as well is a breaking change.  I feel that the easier
route should at least be mentioned in the commit message and why it
was not taken.

> If that's the case, I can certainly update the docs, and I imagine we
> can backport that easily wherever it makes sense.  I would really
> like to have the option to have the prefix apply though, either
> adding a new flag or an option to the existing one that would be
> invalid given current syntax or similar to provide the option.
You mean like replacing a leading colon in the path with the prefix?

René

  reply	other threads:[~2024-05-20 17:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 21:15 [PATCH] archive: make --add-virtual-file honor --prefix Tom Scogland via GitGitGadget
2024-05-15 15:23 ` Junio C Hamano
2024-05-15 16:27   ` Tom Scogland
2024-05-17 17:34 ` [PATCH v2] " Tom Scogland via GitGitGadget
2024-05-17 23:33   ` Junio C Hamano
2024-05-18  0:26     ` Tom Scogland
2024-05-19 13:25   ` René Scharfe
2024-05-20 16:10     ` Tom Scogland
2024-05-20 17:07       ` René Scharfe [this message]
2024-06-14 18:07         ` Junio C Hamano
2024-06-14 18:40           ` [PATCH] archive: document that --add-virtual-file takes full path Junio C Hamano
2024-06-25 22:43             ` Junio C Hamano
2024-06-26 19:05               ` René Scharfe
2024-05-20 17:55       ` [PATCH v2] archive: make --add-virtual-file honor --prefix Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01b21870-b37e-47fe-9bd7-225499ae5eaf@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=scogland1@llnl.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).