Skip to main content.

E-mail Interface to the U-Boot Patch Tracking System

Submitting Patches

How E-mail Processing Works

The U-Boot Patch Tracking System is just one out of several databases within the GNATS setup on our server. To submit a *patch*, you send an e-mail message to the corresponding "" mail address. To submit a patch for U-Boot, please send it to ""

Note: only "patches" are accepted at this mail address; any message that does not look like a patch will be rejected.

The processing of the incoming patches is performed by the script

The task of the script is to verify that an e-mail message contains a patch and to bring it into a format that is easily digestible by GNATS.

The script handles both patches that come "inline" in the message body and such that are included as MIME attachments.
The task to bring he e-mail message into a standard form in performed by running git-mailinfo. This has several advantages:
  • This is the most complicated part of the task, so it is nice that we can re-use existing code.
  • We automatically benefit from upstream improvements by just keeping git updated.
  • Most of the problems that have to be handled when parsing a patch can then be tested much easier and independent from the remaining setup.

    git-mailinfo splits the e-mail message into 3 parts:
  • information (Subject, Author, Date, E-mail address)
  • Message (all text that does not belong to the patch itself)
  • Patch

    Additionally, we also parse the header of the e-mail to extract some information that is ignored by git-mailinfo. We extract the followong mail headers:
  • Message-Id
  • References
  • In-Reply-To
  • Organization

    Finally, the script parses the "Message" part for well-known (Signed-off|Acked|Tested|Reviewed)-by pseudo-headers. E-mail addresses found in such headers are added to the "Notify-List".

    All this information then gets assembled into a GNATS Problem Report, which looks as follows (copy & paste from real code):
    From: $info{author} <$info{email}>
    To: GNATS
    X-ParsePatches-Version: $VERSION
    >Synopsis: $info{subject}
    >Originator: $info{author} <$info{email}>
    >Submitter-Id: patch-submission
    >Organization: $info{organization}
    >Notify-List: $notify
    >Category: unassigned-patches
    >Class: patch
    >Priority: low
    >Severity: non-critical
    >Message-Id: $info{msgid}
    >In-Reply-To: $info{in_reply_to}
    >References: $info{references}
    >Patch-Date: $info{date}
    >Fix: N/A
    insert_file($pr, "$tempdir/msg-clean");
    print $pr ">Patch:\n";
    insert_file($pr, "$tempdir/patch");

Following up with Patch Submissions

-- WolfgangDenk - 01 Aug 2008