Re: [PATCH v2] archive: make --add-virtual-file honor --prefix
- From
René Scharfe <l.s.r@web.de>
- Date
- May 20, 2024, 17:07 UTC
- Message-ID
- <01b21870-b37e-47fe-9bd7-225499ae5eaf@web.de>
- In-Reply-To
- <95B94723-BCBF-48B4-A02C-A5C61FB060DA@llnl.gov>
Am 20.05.24 um 18:10 schrieb Tom Scogland:
Show 9 quoted lines
> > 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.
Show 5 quoted lines
> 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é