Skip to main content.

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

Prepare and Submit Patch or Patches

Patches are submitted to the U-Boot Patch Tracking System by sending them as e-mail to the address <u-boot-patches@bugs.denx.de>.

We assume that the patch(es) are available as commit(s) in a git repository. In the first step, we prepare patches for e-mail submission, then we send them out. Here we show how to submit a series of three patches:

  1. Create directory to store the patches
    $ mkdir /tmp/patches
    
    ALERT! Note: if you use the same directory again for a new series of patches, you should make sure that no old files are left there:
    $ rm -fr /tmp/patches/*
    
  2. Use git-format-patch to format the 3 topmost commits as patch series:
    $ git-format-patch -n -o /tmp/patches HEAD~3
    /tmp/patches/0001-TEST-add-file.patch
    /tmp/patches/0002-TEST-format-text.patch
    /tmp/patches/0003-TEST-add-author-name.patch
    
    For a single patch, everything is the same except that you can (and probably should) omit the "-n" option.
  3. Now we use git-send-email to actually send the patches to the Tracking System:
    $ git-send-email -q -to u-boot-patches@bugs.denx.de /tmp/patches
    Who should the emails appear to be from? [Wolfgang Denk <wd@denx.de>] 
    Emails will be sent from: Wolfgang Denk <wd@denx.de>
    Message-ID to be used as In-Reply-To for the first email? 
    Sent [PATCH 1/3] TEST: add file
    Sent [PATCH 2/3] TEST: format text
    Sent [PATCH 3/3] TEST: add author name
    

What happened to my patches?

When you submitted patches to the Tracking System, they enter it in Category "unassigned-patches", see Lice Cycle of a Patch.

You can also easily check this using the Web Interface to GNATS.

Following up with Patch Submissions

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 "<db>-patches@bugs.denx.de" mail address. To submit a patch for U-Boot, please send it to "u-boot-patches@bugs.denx.de"

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 parsepatches.pl:

Purpose:
The task of the parsepatches.pl 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.
Function:
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
    Subject:
    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
    >Description:
    HEAD
        ;
    insert_file($pr, "$tempdir/msg-clean");
    print $pr ">Patch:\n";
    insert_file($pr, "$tempdir/patch");
    

-- WolfgangDenk - 01 Aug 2008