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

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

From
Robin Jarry <robin@jarry.cc>
Date
Apr 11, 2023, 16:47 UTC
Message-ID
<CRU2VKKMECFZ.2GSICU4EKKBDR@ringo>
In-Reply-To
<79a7c59f-6644-1dad-3b85-fe0ca8beb968@gmail.com>
Phillip Wood, Apr 11, 2023 at 15:23:
> This is certainly less intrusive, if it does what you need and is 
> efficient enough for your needs then I'd be inclined to go with this 
> approach.

Yes, that is perfectly suitable to validate series. The missing pieces of information (e.g. the place where all patches are spooled) can be either hard coded or stored in git config entries.

Show 13 quoted lines
> >   	foreach my $f (@files) {
> >   		unless (-p $f) {
> > +			$ENV{GIT_SENDEMAIL_PATCH_COUNTER} = "$num";
> > +			$ENV{GIT_SENDEMAIL_PATCH_TOTAL} = "$num_patches";
>
> We only need to set this once outside the loop
>
> >   			validate_patch($f, $target_xfer_encoding);
> > +			delete $ENV{GIT_SENDEMAIL_PATCH_COUNTER};
> > +			delete $ENV{GIT_SENDEMAIL_PATCH_TOTAL};
>
> Do we really need to clear these? Certainly not in each iteration of the 
> loop I would think.

I wanted to keep everything collocated. The time spent setting/unsetting these variables is completely negligible. I don't mind making this more streamlined in a v2.

Thanks for the review :)
Previous: Junio C HamanoNext: Robin Jarry
Message 6 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.