git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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é
Previous: Tom ScoglandNext: Junio C Hamano
Message 9 of 14 in “archive: make --add-virtual-file honor --prefix”
  1. archive: make --add-virtual-file honor --prefixTom Scogland via GitGitGadget, May 14, 2024
  2. Junio C HamanoMay 15, 2024
  3. Tom ScoglandMay 15, 2024
  4. archive: make --add-virtual-file honor --prefixTom Scogland via GitGitGadget, May 17, 2024
  5. Junio C HamanoMay 17, 2024
  6. Tom ScoglandMay 18, 2024
  7. René ScharfeMay 19, 2024
  8. Tom ScoglandMay 20, 2024
  9. René ScharfeMay 20, 2024
  10. Junio C HamanoJun 14, 2024
  11. archive: document that --add-virtual-file takes full pathJunio C Hamano, Jun 14, 2024
  12. Junio C HamanoJun 25, 2024
  13. René ScharfeJun 26, 2024
  14. Junio C HamanoMay 20, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.