From: Ian Jackson Subject: Re: [PATCH RFC v2 00/13] New event API Date: Tue, 22 Nov 2011 16:04:14 +0000 Message-ID: <20171.51198.221057.507056@mariner.uk.xensource.com> References: <1319827031-15395-1-git-send-email-ian.jackson@eu.citrix.com> <1320055865.23193.45.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: "xen-devel@lists.xensource.com" , Ian Campbell List-Id: xen-devel@lists.xenproject.org Roger Pau Monn=E9 writes ("Re: [Xen-devel] [PATCH RFC v2 00/13] New event A= PI"): > I'm sorry to ask such a noobish question... I'm trying to import this > patches into my source tree, but mimport seems to be unable to > correctly sort them (maybe because they seem to be in git format). > What's the best way to import them directly from my mailbox? I'm afraid I don't know. With my upstream hat on, for applying patches, I have an absolutely hideous script. (Below but don't read it if you want to keep your lunch.) With my contributor hat on I almost always use git. Ian. #!/bin/bash set -e file=3D$1 perl -pe <$file >$file.mangled ' BEGIN { $nl=3D""; } if (m/^\S/ || m/^$/) { if (defined $subj) { die "$subj ?" if $subj =3D~ m/rfc/i; $subj =3D~ s/\[xen-devel\]//i; $subj =3D~ s/\[patch[ 0-9a-z,]*\]//i; $subj =3D~ s/\s+/ /g; $subj =3D~ s/^\s+//; $subj =3D~ s/\s+$//; print "Subject: $subj\n"; $subj=3D undef; $nl=3D "\n"; } } if (m/^subject:\s+/i) { $subj=3D $'\''; } elsif (defined $subj) { $subj .=3D $_; } if (m/^$/) { print $nl; $nl=3D ""; } $_=3D"" if defined $subj; if ($last =3D~ m/^signed-off-by/i && !m/^signed-off-by/i) { print < END #Acked-by: Ian Jackson # #Acked-by: Ian Campbell } $last=3D $_; ' formail -s hg import - < $file.mangled