From: Jean-Noël Avila Date: Mon, 11 Mar 2024 21:29:53 GMT Subject: Re: [PATCH 2/3] format-patch: teach `--header-cmd` Message-ID: <53ea3745-205b-40c0-a4c5-9be26d9b88bf@gmail.com> In-Reply-To: Le 07/03/2024 à 20:59, Kristoffer Haugsbakk a écrit : > > +format.headerCmd:: > + Command to run for each patch that should output RFC 2822 email > + headers. Has access to some information per patch via > + environment variables. See linkgit:git-format-patch[1]. > + > format.to:: > format.cc:: > Additional recipients to include in a patch to be submitted > diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt > index 728bb3821c1..41c344902e9 100644 > --- a/Documentation/git-format-patch.txt > +++ b/Documentation/git-format-patch.txt > @@ -303,6 +303,32 @@ feeding the result to `git send-email`. > `Cc:`, and custom) headers added so far from config or command > line. > > +--[no-]header-cmd=:: > + Run __ for each patch. __ should output valid RFC 2822 > + email headers. This can also be configured with > + the configuration variable `format.headerCmd`. Can be turned off > + with `--no-header-cmd`. This works independently of > + `--[no-]add-header`. > ++ > +__ has access to these environment variables: > ++ > + GIT_FP_HEADER_CMD_VERSION Better use a nested description list like this: GIT_FP_HEADER_CMD_VERSION;; The version of this API. Currently `1`. __ may return exit code `2` in order to signal that it does not support the given version. > ++ > +The version of this API. Currently `1`. __ may return exit code > +`2` in order to signal that it does not support the given version. > ++ > + GIT_FP_HEADER_CMD_HASH > ++ > +The hash of the commit corresponding to the current patch. Not set if > +the current patch is the cover letter. > ++ > + GIT_FP_HEADER_CMD_COUNT > ++ > +The current patch count. Increments for each patch. > ++ > +`git format-patch` will error out if __ returns a non-zero exit > +code. > + > --[no-]cover-letter:: > In addition to the patches, generate a cover letter file > containing the branch description, shortlog and the overall diffstat. You can Overall, thank you for correctly marking up placeholders and options.