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

Re: [RFC PATCH] send-email: allow a custom hook to prevent sending email

From
Stefan Beller <sbeller@google.com>
Date
Dec 9, 2016, 22:53 UTC
Message-ID
<CAGZ79kaqw=XqrNF5+Ta8CwcD7FyA853UQUdMxHmBAaMHPMHrXg@mail.gmail.com>
In-Reply-To
<xmqqfulwraq2.fsf@gitster.mtv.corp.google.com>
On Fri, Dec 9, 2016 at 2:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> I doubt that this is the best place to call this hook, because the
> called hook does not have access to information that may help it
> make a better decision.

As the commit message may elude, I chose this place as it would be sufficient for checking for ChangeIds, missing signoffs, or even rudimentary check for coding style and commit message line length.

Show 10 quoted lines
>
> For example, because the hook gets one patchfile at a time, it does
> not have the entire picture (e.g. "are you sure you want 01/05,
> 02/05, 04/05 and 05/05 without 03/05?").  For another example, the
> hook does not have access to the decision git-send-email makes on
> various "parameters", which are computed based on the contents of
> the patchfiles and command line arguments at this point in the code.
> (e.g. @to, @cc, etc. are computed much later, so you cannot say "do
> not send anythnng outside corp by mistake" with this mechanism).
>
So you are suggesting to
* have the check later in the game (e.g. just after asking
   "Send this email? ([y]es|[n]o|[q]uit|[a]ll): " as then other information
  such as additional @to @cc are available.
* the hook should not just be called one file at a time, but rather
  we would give all file names via e.g. stdin. With the current code
  structure this contradicts the first point.

I wonder if we want to have multiple hooks for these different things of either looking at the big picture or looking at each in detail.

For me currently I am only interested in the small picture thing.
Stefan
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “send-email: allow a custom hook to prevent sending email”
  1. send-email: allow a custom hook to prevent sending emailStefan Beller, Dec 9, 2016
  2. Junio C HamanoDec 9, 2016
  3. Stefan BellerDec 9, 2016
  4. Junio C HamanoDec 9, 2016
  5. Stefan BellerDec 9, 2016
  6. Junio C HamanoDec 10, 2016
  7. Jeff KingDec 10, 2016
  8. Stefan BellerDec 12, 2016
  9. Junio C HamanoDec 12, 2016

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.