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

Re: [PATCH v2] archive: make --add-virtual-file honor --prefix

From
TSTom Scogland <scogland1@llnl.gov>
Date
May 18, 2024, 00:26 UTC
Message-ID
<176A8590-61BC-45F2-9B37-FFD8B07ABCA9@llnl.gov>
In-Reply-To
<xmqqv83cdneo.fsf@gitster.g>
On 17 May 2024, at 16:33, Junio C Hamano wrote:
Show 15 quoted lines
> "Tom Scogland via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> Notably both explicitly state that they honor the last `--prefix` option
>> before the `--add` option in question.  The implementation of
>> `--add-file` seems to have always honored prefix, but the implementation
>> of `--add-virtual-file` does not.
>
> The above is misleading.
>
>     The implementation of `--add-file` has always honored the prefix,
>     while the implementation of `--add-virtual-file` has always ignored
>     the prefix.
>
> would make it easier to assess how long existing users may have been
> relying on the current behaviour.
Fair, I had no intention to mislead and will reword.
Show 10 quoted lines
>> Modify archive.c to include the prefix in the path used by
>> `--add-virtual-file` and add checks into
>> the existing add-virtual-file test to verify:
>>
>> * that `--prefix` is honored
>> * that leading path components are preserved
>> * that both work together and separately
>
> Very nice job explaining the chosen design clearly (even though I do
> not necessarily agree with the direction this patch is going).
Thanks for that.  As to the direction, I mentioned earlier adding a different flag, or perhaps marking the filename in some fashion to express that the prefix should be honored, would you prefer that? It would, as you said, be much safer in that there's no reason for it to be a breaking change. If there's a design you prefer that would result in having an opt-in way to get the prefix behavior I wouldn't mind implementing it.
Show 7 quoted lines
> Also, given that this option was introduced for an explicit purpose
> of using it to write out diagnostics archive file, we should mention
> that this change does not break it in the proposed log message, at
> least.  Of course, we should do so after verifying that is indeed
> the case, and better yet, after verifying that it will be hard for
> future changes to diagnose.c to trigger an unexpected behaviour
> caused by this change [*].
That's a very good point, and thank you for digging into it.
Show 9 quoted lines
>> Changes since v1:
>> - Revised the commit message style
>> - Added tests for basename/non-basename behavior
>> - Fixed archive.c to use full path for virtual and basename for add-file
>
> The "changes since v1" section does not belong to the log message
> proper, as v1 never happened as long as readers of "git log" are
> concerned.  It is a very good thing to help reviewers to have below
> the three-dash lines that comes after your sign-off, though.
My apologies, this is my unfamiliarity with GitGitGadget, I'll put information like this in the PR description next time, which I think will do that.
Previous: Junio C HamanoNext: René Scharfe
Message 6 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.