From patchwork Fri Nov 11 02:15:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Strawbridge X-Patchwork-Id: 13039512 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03D9EC4332F for ; Fri, 11 Nov 2022 02:15:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbiKKCPZ (ORCPT ); Thu, 10 Nov 2022 21:15:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232032AbiKKCPX (ORCPT ); Thu, 10 Nov 2022 21:15:23 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2059.outbound.protection.outlook.com [40.107.92.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B60B5F869 for ; Thu, 10 Nov 2022 18:15:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hOftddM8IvwCJfvKNaUb8o3eFqL+kYj3uqkg19BqNoKqNSfpejb71h/SzpJ61yIXi7cc0rt/JAM5a+5GLJI2zc0qCozVZL9vjYpOGWmqTCDai5YrI+Cr/VA2BEmYNYU9Wg6BSTyLCXzBhWlidVHTf/ZWILOnVJ5CkRe6p68xT6m0TjIiHUcag4RIEzcKxLn6wE0CqEWd/ArNe0IWOLETxoO42jW3xCY5xCfJz18UrgfGZ2P33mF28i2FICMeefXM/VlYbC29XtieJijr64Vl5oMURwZjcXYlx2IhYq5vVgU8XMETjLIaRZKF36kYA2cVZS/84PAYbA88cZI64694Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nI0FO1/L39PWqzzT1BBO95AaKVqPo9Qjqq/y3pT6h9I=; b=SscAS45oXcANNo3dsD1BTcbpyE2XzYdHf8dTt5z4YxdFfIfiZg6wZEP1rQMTVvz1kWeExB0RY2phgjWXTlultP6YvxSpCT7sK2beztRfgsmdSa4RR67x/oCfIeKoHgtMi0Et/oJ2uyNIaBfNhQGyrCydS198ASrfTx2XM7zsGjnxM6G7ObE5K2L8zsIsvohmxbgEGq9dAgMreQu/twg5lKNnvQPS+onV6gFqOvGN+MObrRli98Sfpmr7z+orqr2mUxitXPACjLWkkfiUlJq2m+5yNZXQg1OMomthSvaHlw8KEbJHTfqJTBHhi+rNbIuEx8qMIAmx2lL6PaeiObuHcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nI0FO1/L39PWqzzT1BBO95AaKVqPo9Qjqq/y3pT6h9I=; b=Bf4vpgC7QGywPakPpzlxU5LsjDcujySxrzusE30m1qhUw6EKfVhF/f8m07fHtj2oYcekjwqCI8MlH2PsW9KryZknuNB/RE1epNd4DB3SQL435vyMT00TfKbSSMwDKF1XlQiY37H1pHi/4twG8mseo4+U6O82RPrX2HnWTLODajQ= Received: from DM6PR12MB4356.namprd12.prod.outlook.com (2603:10b6:5:2aa::8) by DM6PR12MB4107.namprd12.prod.outlook.com (2603:10b6:5:218::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 02:15:20 +0000 Received: from DM6PR12MB4356.namprd12.prod.outlook.com ([fe80::70fe:fd7e:da10:fd66]) by DM6PR12MB4356.namprd12.prod.outlook.com ([fe80::70fe:fd7e:da10:fd66%6]) with mapi id 15.20.5813.013; Fri, 11 Nov 2022 02:15:20 +0000 From: "Strawbridge, Michael" To: "git@vger.kernel.org" CC: "Strawbridge, Michael" , "Tuikov, Luben" , "brian m . carlson" Subject: [PATCH 0/2] Expose header information to git-send-email's sendemail-validate hook Thread-Topic: [PATCH 0/2] Expose header information to git-send-email's sendemail-validate hook Thread-Index: AQHY9XNzwF3XVwubHkGzusuLSrgFPw== Date: Fri, 11 Nov 2022 02:15:20 +0000 Message-ID: <20221111021502.449662-1-michael.strawbridge@amd.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.34.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR12MB4356:EE_|DM6PR12MB4107:EE_ x-ms-office365-filtering-correlation-id: 446962cd-1840-4183-2040-08dac38a9589 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P5T88X32D/GnNKYCGovty8ukOGZpriT/cjoyoocl7R9GEQ4+DqP8GSjEqjFLGoK0E+tGvPOGFKtOXBWMT72FU1Uss1ghALDpUcDKM3eKoVR72MX/zVQElGuWau9FrvkpbxX57Z79SwQO/FuSSBj0SLXPyHe0AO8qfUgfCPROGV8XSwPZD1sGgVQHMKT/Oluu6n/HCtDu3cyGb+4vuUzZ+voxIeOfQv8RfTJuf6r1QaauweLOX8nmZEwffuqRJf0k32STRqZir8xs/pBmcad9qCcvJuUKjMEUwqp2g3U57KjnegRcKs7QpHGPApM3SkEMF+XCa5nNjv4OmKngMZ0yX5K5d8ZNw5PSdRVPcDQ/P2M+ko5dI3iBmC8F2hpk47KJ1/EjgXyUhIASFSOpp2asW2CAcyuxvRjoZfL2Paii+Ou4gtvj8yBwcQVrm8YTfnW4QeT9uqug6aoY6iXXCyzJYfLpnACuUPnLjhQnWa+fo9qdVlbJPmU8ViIStOaNmvDfASDd1kX0jkzJvhDOMI/GvejGs9/EBRBIwQHqxaIlZZb8YaAp363VinbnhFt9sd2qFGD8XJnLVKdXehF9gPT6ttbzryFaw5eKCnNGGMyvt1hVnTS56xBBJe0ispda/cjcnDaMTP2VylPnkR9X0u/gwX+WcUET3pxAUiJ2LGikMVXuv9A9GWj2S8bvLAVdA8nIhFhuKSW7CutskOBqQAHVMW72PCnguzypXbQuO0YvUOTf8KeY/uHO7L3OqdWR/CWrOT3Y95YIg3xPv4scdkQc0Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4356.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(39860400002)(376002)(136003)(346002)(396003)(451199015)(38100700002)(122000001)(15650500001)(86362001)(38070700005)(4326008)(6506007)(2906002)(26005)(66556008)(6512007)(66446008)(66476007)(2616005)(64756008)(76116006)(91956017)(66946007)(6486002)(71200400001)(8676002)(316002)(83380400001)(8936002)(5660300002)(1076003)(66574015)(6916009)(41300700001)(36756003)(478600001)(186003)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?sE84JZXyrFNT2SDHeA0Kun9lHFYL?= =?utf-8?q?+pWu8vhsOeKVV1QB1Ohw2m1QTaUheUPP24qKlbvzMFJDlHRHVXLPLiyYKy/637pgH?= =?utf-8?q?fge8/j8qBqFdFgYph4VbyF0AjQzayhIZgjG86VdDhOgn7yObHqDfbLaqMFBp5DL9d?= =?utf-8?q?3EY8CotzrBmKtpNoM3xIKbtS/fESC70JsT7ndv8RU9uiVXFuP43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sGYjdmmXy9EJPXx8j?= =?utf-8?q?1OZX30Ndf49ACmCOL8gQWPOnn07FofjhHHtqajb9ixcR5aml+OdMGkaAhM9+PHEcH?= =?utf-8?q?6a5lOZsTuj6Jet3xalGDJ69AKDWpi0Wl3c/DDhXocDXVtSv/YgjemLlKOKgrKsopQ?= =?utf-8?q?LG9q8xA4fXB84NcYmxDbVufSk7k5U5SWVHQIv2kE6pNixyfhv82Pq+NhMAFVw402I?= =?utf-8?q?aXfprsSYEWlO3et8UGchQEuILLakXEVCl1sksk8CKlDXCZqM4aAPlskpVcUkpeRLf?= =?utf-8?q?KOzEJ0P2oa4iiBfZLL+4LN9F67lLhG7z9Ksnv89i/mUzIKfAw7s3d93PlU1bFqQYq?= =?utf-8?q?YSJCWKTDiE4fKtJxKdHczFQtjY+jms18agkramESsa4tyxff+XFmKZO0pMjf2d2fI?= =?utf-8?q?MeXRk0V4L99cX+LQ/V9GAWMdlkWu1WpepqFYxwMHmlNG/yn16G9Rirfc1HQHcqzcT?= =?utf-8?q?QvtL6glpLsDz?= Content-ID: <64FF89E3B7E4FD4D87AC6FFF9C57A211@namprd12.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4356.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 446962cd-1840-4183-2040-08dac38a9589 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2022 02:15:20.7729 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +P2QhXKwJU79W+zOc/ctdewsjCyUiWKNT4VdrUmdUFuqBrkHJ5RxRIrFzfCzvsrW3f070yPqH70qJhh2m22eKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4107 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Sure. Thank you for the quick feedback. Let me see if I can explain the idea. Sometimes it can be helpful to react to special keywords in a git send-email subject line or specific email address. Like perhaps one wants to do some kind of sorting of patches by mailing list or "to" email address. You could use the sendemail-validate hook as a way to copy the patch to a specific location locally based on who you are emailing. I'm sure there could be other uses for the smtp header information as well. Presumably the header information is printed to stdout before sending an email, for other reasons too (this happens already). My patch makes it possible to now automate any checks one might be doing manually with these headers. With some testing I can confirm that encoded headers (like a utf8 string) get passed in encoded form. The random example I tried was with the subject "Rhyddhewch y racŵn" and it is showns as "Subject: [PATCH] =?UTF-8?q?Rhyddhewch=20y=20rac=C5=B5n?=". However, the original print of the smtp headers doesn't handle encoded text either, so it is no worse than current. Lastly, with the validate code moving later there are some changes in output. After my change, the user will get asked about: composed email (compose argument code), 8 bit encoding, who to send to, and which message-ID to reply to before validation. Since these change the header information, validation needs to happen after. Michael PS- I fixed the Signed-off-by as well. Michael Strawbridge (2): Expose header information to git-send-email's sendemail-validate hook Update sendemail-validate hook docs to add header file parameter Documentation/githooks.txt | 8 +++--- git-send-email.perl | 57 +++++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 24 deletions(-) Cc: Luben Tuikov Cc: brian m. carlson