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

Re: [PATCH v3] send-email: export patch counters in validate environment

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Apr 14, 2023, 12:58 UTC
Message-ID
<d40ad39a-7598-02f3-7a5c-46f0d75f34fc@gmail.com>
In-Reply-To
<CRVOLVOVSVO4.UJJ8JLP8Y69T@ringo>
Hi Robin
On 13/04/2023 15:01, Robin Jarry wrote:
Show 11 quoted lines
> Hi Phillip,
> 
> Phillip Wood, Apr 13, 2023 at 15:52:
>> I think the documentation and implementation look good, I've left a
>> comment about the example hook below. As Junio has previously mentioned,
>> it would be nice to have a test with this patch.
> 
> Yes, I only got Junio's email after sending v3 :)
> 
> The test case is ready. I was waiting for more comments before sending
> a v4.
That's great, thank you for doing that.
Show 18 quoted lines
>>> +	git worktree remove -f "$worktree" 2>/dev/null || :
>>
>> Now that you've got rid of "set -e" I don't think we need "|| :".
> 
> Right.
> 
>> I had expected that we'd always create a new worktree on the first
>> patch in a series and remove it after processing the the last patch in
>> the series, but this seems to leave it in place until the next time
>> send-email is run or /tmp gets cleaned up. Also if I've understood it
>> correctly the name is set the first time this hook is run, rather than
>> generating a new name for each set of files that is validated.
> 
> I had thought that it would be useful to keep it in case the user wants
> to inspect and resolve issues. I you think it is a problem to leave it,
> I can deleted it after the last patch. In any case, if the user
> interrupts send-email before it has time to validate all patches, the
> worktree will be left in place.

I think leaving it in place if there is an error is fine, but it ought to clean up after itself if there isn't an error. More serious is that we use mktemp to create the worktree path the first time the hook is run and then just keep using that same path forever. It should be creating a new temporary directory with mktemp for each series to avoid clashes with existing entries in /tmp.

Best Wishes
Phillip
> Thanks for the review!
Previous: Robin JarryNext: Robin Jarry
Message 16 of 21 in “send-email: export patch counters in validate environment”
  1. send-email: export patch counters in validate environmentRobin Jarry, Apr 11, 2023
  2. Phillip WoodApr 11, 2023
  3. Junio C HamanoApr 11, 2023
  4. Robin JarryApr 11, 2023
  5. Junio C HamanoApr 11, 2023
  6. Robin JarryApr 11, 2023
  7. send-email: export patch counters in validate environmentRobin Jarry, Apr 12, 2023
  8. Junio C HamanoApr 12, 2023
  9. Robin JarryApr 12, 2023
  10. Junio C HamanoApr 12, 2023
  11. Robin JarryApr 12, 2023
  12. Junio C HamanoApr 12, 2023
  13. send-email: export patch counters in validate environmentRobin Jarry, Apr 12, 2023
  14. Phillip WoodApr 13, 2023
  15. Robin JarryApr 13, 2023
  16. Phillip WoodApr 14, 2023
  17. send-email: export patch counters in validate environmentRobin Jarry, Apr 14, 2023
  18. Robin JarryApr 14, 2023
  19. send-email: export patch counters in validate environmentRobin Jarry, Apr 14, 2023
  20. Robin JarryApr 20, 2023
  21. Junio C HamanoApr 20, 2023

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.