From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 45A071F406 for ; Wed, 11 Oct 2023 22:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233651AbjJKWr5 (ORCPT ); Wed, 11 Oct 2023 18:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbjJKWr4 (ORCPT ); Wed, 11 Oct 2023 18:47:56 -0400 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C2E09D for ; Wed, 11 Oct 2023 15:47:54 -0700 (PDT) Received: (qmail 20278 invoked by uid 109); 11 Oct 2023 22:47:54 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 11 Oct 2023 22:47:54 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 11048 invoked by uid 111); 11 Oct 2023 22:47:56 -0000 Received: from coredump.intra.peff.net (HELO coredump.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Wed, 11 Oct 2023 18:47:56 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 11 Oct 2023 18:47:53 -0400 From: Jeff King To: Junio C Hamano Cc: Michael Strawbridge , Bagas Sanjaya , Todd Zullinger , Luben Tuikov , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Taylor Blau , Git Mailing List Subject: Re: [PATCH] send-email: move process_address_list earlier to avoid, uninitialized address error Message-ID: <20231011224753.GE518221@coredump.intra.peff.net> References: <20230925080010.GA1534025@coredump.intra.peff.net> <20230925161748.GA2149383@coredump.intra.peff.net> <95b9e5d5-ab07-48a6-b972-af5348f653be@amd.com> <7e2c92ff-b42c-4b3f-a509-9d0785448262@amd.com> <20231011221844.GB518221@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Oct 11, 2023 at 03:37:39PM -0700, Junio C Hamano wrote: > On the other hand, I am not sure what is wrong with "after the user > typed", actually. As you said, anybody sane would be using --to (or > an equivalent configuration variable in the repository) to send > their patches to the project address instead of typing, and to them > it is not a problem. After getting the recipient address from the > end user, the validation may fail due to a wrong address, in which > case it is a good thing. If the validation failed due to wrong > contents of the patch (perhaps it included a change to the file with > trade secret that appeared in the context lines), as long as the > reason why the validation hook rejected the patches is clear enough > (e.g., "it's the patches, not the recipients"), such "a rejection > after typing" would be only once per a patch series, so it does not > sound too bad, either. > > But perhaps I am not seeing the reason why "fail after the user typed" > is so disliked and being unnecessarily unsympathetic. I dunno. I did not look carefully at the flow of send-email, so this may or may not be an issue. But what I think would be _really_ annoying is if you asked to write a cover letter, went through the trouble of writing it, and then send-email bailed due to some validation failure that could have been checked earlier. There is probably a way to recover your work (presumably we leave it in a temporary file somewhere), but it may not be entirely trivial, especially for users who are not comfortable with advanced usage of their editor. ;) I seem to remember we had one or two such problems in the early days with "git commit", where you would go to the trouble to type a commit message only to bail on some condition which _could_ have been checked earlier. You can recover the message from .git/COMMIT_EDITMSG, but you need to remember to do so before re-invoking "git commit", otherwise it gets obliterated. Now for send-email, if your flow is to generate the patches with "format-patch", then edit the cover letter separately, and then finally ship it all out with "send-email", that might not be an issue. But some workflows use the --compose option instead. -Peff