dvhart / mailtogit

Mutt patch management macros
11 stars 7 forks source link

formail incorrectly splits patch if Cc: tag present in body #1

Open vladimiroltean opened 3 years ago

vladimiroltean commented 3 years ago

Hi, Thanks for these scripts! I noticed that when formail detects a "Cc: " line in the email body (which is a frequently used method of copying people using git-send-email), the patch is split into 2 pieces, and a new ".mbox" file contains the second half. When procmail is used directly, it jumps properly over the "Cc: " line and outputs the entire mail into the same .mbox file. The disadvantage with invoking procmail directly is that I don't know how multiple emails could be converted to mbox at the same time (i.e. the "(t" command). Have you noticed this behavior?

dvhart commented 3 years ago

Hi. I haven't seen this behavior, and when I was using them for Linux kernel subsystem maintenance, Cc: was certainly used more often than not. Interesting. Can you provide some details re. OS, formail version, and possibly an example email that it splits?

vladimiroltean commented 3 years ago

I am on Ubuntu 20.04, and formail is:

formail v3.23pre 2001/09/13

When I download this patch (random example) using NeoMutt 20200925 (built from source a month ago) piped through your mail-to-mbox shell script with "(t": https://lore.kernel.org/netdev/20201101125114.1316879-5-ciorneiioana@gmail.com/ this is what I get:

  1. PATCH_net-next_v2_04-19_net_phy_at803x_implement_generic_.handle_interrupt__callback.mbox
    
    From netdev-owner@vger.kernel.org  Thu Nov  5 03:11:03 2020
    Delivered-To: olteanv@gmail.com
    Received: by 2002:a17:906:b091:0:0:0:0 with SMTP id x17csp2878764ejy;         Sun, 1 Nov 2020 04:53:47 -0800 (PST)
    X-Google-Smtp-Source: ABdhPJz+kplviwolMHfXg+7/7nR0N6Et1kDfuAdeZt4ka81UOQ40eMI/lIVLaXHKD25hjvxa8XyI
    X-Received: by 2002:a17:906:3a02:: with SMTP id z2mr10711123eje.452.1604235226973;         Sun, 01 Nov 2020 04:53:46 -0800 (PST)
    ARC-Seal: i=1; a=rsa-sha256; t=1604235226; cv=none;         d=google.com; s=arc-20160816;         b=N8er/KXvxKDJ2fqRuoIuAie2tiljxvj4kYUFvEhtkQWHsa2EEU1RRCTkJbrYxp7rv0          gf0cvJhiC+FL8/H+ZU8sTVgj6Z70edKIk0umTpVMOz6Q6X4REZz8wvzViv4/EjQ1nawg          uQXDhrZAqdqTE9gEU5j61UOC333FkD82KQEDfhxo54HVC8KUVRJNQ+UHEivXrabIfWOI          69UooYNePqk1nfHk4OUaZJwfhAMdAr3o388g9RveiSMfwZ8JHZ0IikPz9cE2TuHtCIN9          U6kZHQHIGISN9q5yGcizhTIq5kh6KNxwwun3yoMNleJXK7WF+ZkVVUR9FkhUCv08U/bf          rdbw==
    ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;         h=list-id:precedence:content-transfer-encoding:mime-version          :references:in-reply-to:message-id:date:subject:cc:to:from          :dkim-signature;         bh=zAr2ZpROTUIh8AyndHrw65H5Tjuc6RrJxRTm7QHUC9c=;         b=JEb5JlF14d0Hfvc8+B/FoTc+lvuA1Ti9r4xl0+HMIzLgsFwFeeHm/26AqSMAaRqnmG          p1gb7VxFEi/Irf0LzH3V5ihG1BuSswrX8VjtZKKKAm7DjDP7QZWk2CrNVETQFp1Mgu+D          zZxs3SS8sBw4OgErku36M/fS+h6MbflIQ4zqcGgcQjPRZ3axQVq0Zbiz2T+QVAPp1mFD          1KUcyKMcQNNF2nGkyyzkFa3WE3z00+yEF9WHowup/jq+N8FjwztMJivOdzLuHSpWj+OW          9YrTY9qEPlW+ER59QCw0K2R6hlCy5KTZyHP0wa0K+F3LEBLh3Ub2yXIzYRQi0Zu/deXk          itZw==
    ARC-Authentication-Results: i=1; mx.google.com;        dkim=pass header.i=@gmail.com header.s=20161025 header.b=kgPmBeJM;        spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org;        dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
    Return-Path: <netdev-owner@vger.kernel.org>
    Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18])         by mx.google.com with ESMTP id a10si8084002eju.313.2020.11.01.04.53.22;         Sun, 01 Nov 2020 04:53:46 -0800 (PST)
    Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18;
    Authentication-Results: mx.google.com;        dkim=pass header.i=@gmail.com header.s=20161025 header.b=kgPmBeJM;        spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org;        dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
    Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand         id S1726824AbgKAMwd (ORCPT <rfc822;xiaoyi.jin1008@gmail.com>         + 99 others); Sun, 1 Nov 2020 07:52:33 -0500
    Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38682 "EHLO         lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org         with ESMTP id S1726496AbgKAMw1 (ORCPT         <rfc822;netdev@vger.kernel.org>); Sun, 1 Nov 2020 07:52:27 -0500
    Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641])         by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49A4AC0617A6;         Sun,  1 Nov 2020 04:52:27 -0800 (PST)
    Received: by mail-ej1-x641.google.com with SMTP id o9so12738088ejg.1;         Sun, 01 Nov 2020 04:52:27 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;         d=gmail.com; s=20161025;         h=from:to:cc:subject:date:message-id:in-reply-to:references          :mime-version:content-transfer-encoding;         bh=zAr2ZpROTUIh8AyndHrw65H5Tjuc6RrJxRTm7QHUC9c=;         b=kgPmBeJMeW0hJeo7er3LfchxAFxmGI/4Yb5AzlL6EpKM2mzcMolBfkLTL2cAdhv9IB          pAOD7+6KO6FpijBMsw+jcwkJ9a2WTwqkASBBodgHog9Sf3+rOEYdrlb9AxJKSJttSgLL          R/qfDNgYc42NjiC+NXj5tkTj//tWpvrUuWvOeGZDV839J6/PP20mII9dFzFOugUbrLT4          Jh8fvAKlmRRfGP5JMrLd4VRprUvYQ7P7AEGNyhzWsxoINfLtveY3xEg/geN6siEsX02z          Js8PhPwtWpQCB+maBIYs9V2mtBXR7gIB/zvdKTOyzYgaQjqnijnLYNacCQCmcrTleyi6          DG4Q==
    X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;         d=1e100.net; s=20161025;         h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to          :references:mime-version:content-transfer-encoding;         bh=zAr2ZpROTUIh8AyndHrw65H5Tjuc6RrJxRTm7QHUC9c=;         b=QNCKS0smjgrgjNoHIoQjMbbtFeQudOM6dxlwD4lCXpX/jy9uMjfOBmEdujCEvi7SPs          IHENWpryS+9QufK6Hn2W3D6b9kyQZYOoouN2sIJ0ktJzojcz6lM12NiFPqa+Q7lHcFDs          8MUrL74ZqHTCfm/6WZkXS6WINboRlhkys5LhZi/jRW5V25uVkFR3Ewx571w/typZEbHd          pBblEJaOHTyMkDAVcgddmHqjHq17FNPFB4OnYw2Ov+2s1rP84nN7VQQ0r1YsfNT6u/YP          lSA1CB7wSl6xefWCn59E1GlQw6cRDVDl7zPPrbCivW77wT2u2zynmVL22cq+w2A80JCy          yCAg==
    X-Gm-Message-State: AOAM533Zig5x/PJSjM2r2YaTSQrVC4Buk7UmCpG4Xo2IyQHARGkHEKhE         jy/wA+rRwVm2b0LBb/ACP6c=
    X-Received: by 2002:a17:906:260a:: with SMTP id h10mr4506040ejc.159.1604235146026;         Sun, 01 Nov 2020 04:52:26 -0800 (PST)
    Received: from yoga-910.localhost ([188.25.2.177])         by smtp.gmail.com with ESMTPSA id c5sm8133603edx.58.2020.11.01.04.52.24         (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);         Sun, 01 Nov 2020 04:52:25 -0800 (PST)
    From:   Ioana Ciornei <ciorneiioana@gmail.com>
    To:     Andrew Lunn <andrew@lunn.ch>,         Heiner Kallweit <hkallweit1@gmail.com>,         Russell King <linux@armlinux.org.uk>,         Florian Fainelli <f.fainelli@gmail.com>,         Jakub Kicinski <kuba@kernel.org>, netdev@vger.kernel.org,         linux-kernel@vger.kernel.org
    Cc:     Ioana Ciornei <ioana.ciornei@nxp.com>,         Oleksij Rempel <o.rempel@pengutronix.de>,         Michael Walle <michael@walle.cc>
    Subject: [PATCH net-next v2 04/19] net: phy: at803x: implement generic .handle_interrupt() callback
    Date:   Sun,  1 Nov 2020 14:50:59 +0200
    Message-Id: <20201101125114.1316879-5-ciorneiioana@gmail.com>
    X-Mailer: git-send-email 2.28.0
    In-Reply-To: <20201101125114.1316879-1-ciorneiioana@gmail.com>
    References: <20201101125114.1316879-1-ciorneiioana@gmail.com>
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Precedence: bulk
    List-ID: <netdev.vger.kernel.org>
    X-Mailing-List: netdev@vger.kernel.org
    X-TUID: yUDTUcj2fIZP

From: Ioana Ciornei ioana.ciornei@nxp.com

In an attempt to actually support shared IRQs in phylib, we now move the responsibility of triggering the phylib state machine or just returning IRQ_NONE, based on the IRQ status register, to the PHY driver. Having 3 different IRQ handling callbacks (.handle_interrupt(), .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY driver implement directly an IRQ handler like any other device driver. Make this driver follow the new convention.

and 2: `.mbox`:

From foo@bar Thu Nov 5 03:11:04 2020 Cc: Oleksij Rempel o.rempel@pengutronix.de Cc: Michael Walle michael@walle.cc Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com


Changes in v2:

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index ed601a7e46a0..c7f91934cf82 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -628,6 +628,32 @@ static int at803x_config_intr(struct phy_device *phydev) return err; }

+static irqreturn_t at803x_handle_interrupt(struct phy_device *phydev) +{

vladimiroltean commented 3 years ago

when I was using them for Linux kernel subsystem maintenance

Are you using something different now? Please do tell.

dvhart commented 3 years ago

Oh.... that Cc:, so it may be interpreting it as a header after the body started and getting confused. Hrm. No immediate ideas on a solution, but will think on it. Please let me know if you find a solution.

I handed off maintenance of the pdx86 subsystem a while back now - current job responsibilities not compatible with the schedule. But, still happy to be involved where I can.