Subject: Re: [PATCH v2] hooks: add sendemail-validate-series

From: Phillip Wood <[email-masked]>
Date: Tue, 11 Apr 2023 10:58:05 +0100

On 06/04/2023 09:56, Ævar Arnfjörð Bjarmason wrote:
> 
> On Thu, Apr 06 2023, Robin Jarry wrote:
> 
> Honestly, I don't really get the use-case. If your 02/N depends on 01/N
> couldn't your hook just maintain its own state, e.g. in some file
> created in the passed $GIT_DIR?

A hook that wants to check some property of the whole series needs to 
know which patch is the final one. We could pass that via the 
environment as we do for external diff commands with 
GIT_DIFF_PATH_COUNTER and GIT_DIFF_PATH_TOTAL.

> With the upcoming parallel hooks, I'm also skeptical of a an interface
> that would preclude validating these in parallel.

I'd not thought of that, I thought the idea of parallel hooks was to run 
different scripts for the same hook in parallel, not have multiple 
instances of the same script running simultaneously.

> I also don't understand the reason for the stdin interface. The
> "git-send-email" program itself takes a <file|directory>, so concerns
> about the files exceeding argument list seem out the window, i.e. we
> could just pass the dir/files, and as we'd have the same limitations
> here we should be able to pass the full set of files, no?

No, not if the user passes something like "HEAD~1000.." instead of a 
list of paths.

Best Wishes

Phillip

> I.e. why not a sendemail-validate-all that just takes a dir or file(s)?