Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 47C28431FB6 for ; Tue, 19 Apr 2011 02:16:43 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id egMRqt1VPHuN for ; Tue, 19 Apr 2011 02:16:42 -0700 (PDT) Received: from mail-iw0-f181.google.com (mail-iw0-f181.google.com [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 8B553431FB5 for ; Tue, 19 Apr 2011 02:16:42 -0700 (PDT) Received: by iwn2 with SMTP id 2so6374097iwn.26 for ; Tue, 19 Apr 2011 02:16:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.213.132 with SMTP id gw4mr7857850icb.59.1303204600009; Tue, 19 Apr 2011 02:16:40 -0700 (PDT) Received: by 10.42.21.1 with HTTP; Tue, 19 Apr 2011 02:16:39 -0700 (PDT) In-Reply-To: <87k4es9hdo.fsf@A7GMS.i-did-not-set--mail-host-address--so-tickle-me> References: <87k4es9hdo.fsf@A7GMS.i-did-not-set--mail-host-address--so-tickle-me> Date: Tue, 19 Apr 2011 12:16:39 +0300 Message-ID: Subject: Re: Filtering out replies to a patch series From: Amit Kucheria To: Pieter Praet Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2011 09:16:43 -0000 On Mon, Apr 18, 2011 at 9:57 AM, Pieter Praet wrote: > On Fri, 1 Apr 2011 11:47:25 +0300, Amit Kucheria wrote: >> Hi, >> >> I am wondering how developers on this list handle the case of grabbing >> a patch series posted to the list and using something like git-am to >> apply it to their local trees. > > See id:"m2vd3p3u78.fsf@kcals.maillard.im" > >> Several patches in the series could have replies to them and hence >> they need to be filtered out. >> >> e.g. I use notmuch show --output=3Dmbox thread:000000000000eb4e to get >> the basic series. But I'd appreciate any tips on filtering out the >> replies. > > Something like this might work: > > =A0noreplieskthxbye() { > =A0 =A0 =A0thread_id=3D${1} > =A0 =A0 =A0target_dir=3D/tmp/${thread_id} > =A0 =A0 =A0test -d ${target_dir} && echo "Patch queue dirty. Remove ${tar= get_dir}" && return 1 > =A0 =A0 =A0mkdir -p ${target_dir} > =A0 =A0 =A0notmuch show --format=3Dmbox ${thread_id} | git mailsplit -o${= target_dir} > =A0 =A0 =A0grep -l "^diff --git" ${target_dir}/* | xargs git am -3 > =A0 =A0 =A0rm -rf ${target_dir} # "Danger, Will Robinson!" > =A0} > > =A0noreplieskthxbye thread:000000000000eb4e > > But I'd be suprised beyond belief if there weren't a *sane* way to do > this. I might also need some coffee first... I haven't found a 'sane way' yet. Your scripting hack looks like a good way to start though.