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:
- Create directory to store the patches
$ mkdir /tmp/patches
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/*
- 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.
- 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
Life Cycle of a Patch.
The sender of the patch, and all addresses listed in the
[GnatsNotifyList]["Notify-List"]] receive an e-mail about the new
patch that looks like this:
Subject: unassigned-patches/19: [PATCH 1/3] TEST: add file
From: u-boot@bugs.denx.de
Date: Sat, 2 Aug 2008 22:15:01 +0200 (CEST)
To: Wolfgang Denk <wd@denx.de>
Cc: U-boot Development List <u-boot@lists.denx.de>
Signed-off-by: Wolfgang Denk <wd@denx.de>
---
Added to GNATS database as unassigned-patches/19
>Responsible: patch-coord
>Message-Id: <1217707968-24231-1-git-send-email-wd@denx.de>
>In-Reply-To:
>References:
>Patch-Date: Sat Aug 02 22:12:46 +0200 2008
---
...
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