From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 21C82431FBC for ; Sat, 10 Mar 2012 16:01:44 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.69 X-Spam-Level: X-Spam-Status: No, score=-0.69 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01] 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 DUvvKmH6+jNZ for ; Sat, 10 Mar 2012 16:01:41 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7A7C1431FAE for ; Sat, 10 Mar 2012 16:01:41 -0800 (PST) Received: by lbok6 with SMTP id k6so897268lbo.26 for ; Sat, 10 Mar 2012 16:01:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:user-agent:date:message-id:mime-version :content-type:x-gm-message-state; bh=lV5I7y15GbGVscgaCQFk4KxInlQcQOlA2Ne9bzgF5s8=; b=CxTMnEoH5/gEQYflCRKwxMBxPU7vRUbDyh03EQdohVikf17aTFMQdzT9rgIxGNCMVl nBqP7HWyHoYbS8+LEnDaKLzsnQdckH/xkHJZoDl8FM4RNgzEHkwc/NLLsQcNSCuJXVUl 410zh11+u3Mp6CdU00yly7vSYzTxQ6i+sMC44Il/Kx2MKjWqkXYoFYRwPkMI2uvmSbOI ZM4v8DFBiJw7rqOaziLOP6uNFHQ7t+Ro5pIsST1UUg4a4nR6ndg7pnETb5vv1PEGdYzb C3IRGoZ/8PRiejWHCB/CYP7ATViD38YQ0ANrmq865KKhGSfwYmwD27EV7Qi+3MS+1Qe0 XGZQ== Received: by 10.112.25.225 with SMTP id f1mr2748196lbg.6.1331424099729; Sat, 10 Mar 2012 16:01:39 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi. [84.248.80.253]) by mx.google.com with ESMTPS id a8sm12166918lba.15.2012.03.10.16.01.36 (version=SSLv3 cipher=OTHER); Sat, 10 Mar 2012 16:01:38 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: nmfirehose - a crude nmbug companion tool User-Agent: Notmuch/0.11.1+295~g780f284 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Sun, 11 Mar 2012 02:01:34 +0200 Message-ID: <87wr6sypi9.fsf@nikula.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Gm-Message-State: ALoCoQlWcDYFbpG5jaIztI1pStEoi+7DFO5gz/podaDGRB39XSjzFze9b3Y4ij0t7qvxV+UjSNKH 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: Sun, 11 Mar 2012 00:01:44 -0000 --=-=-= Hi all - There was some talk on IRC about maintaining a development branch containing the "maybe ready" patches [1] to better expose them to real-life use before merging to master. I set out to automate this a little, and ended up with nmfirehose. It's a shell script that can be used to grab a bunch of patches from the notmuch mail store based on queries, and apply them to a repository. In particular, it can grab the "maybe ready" patches and apply them against notmuch master. Inevitable conflicts are handled by applying patches in oldest first order, and dropping any conflicting series. An email thread approximates a patch series; more than one patch series in a thread are folded into one series. Patches are applied incrementally, on top of each other by default, but there's also support for non-incremental per-series apply against master to see if there are conflicts. This is useful for the "review" query. Conflicting patches can be automatically tagged if so desired (but I don't recommend pushing these to nmbug without human review). How well any of this works very much depends on how accurately the patch messages are tagged. Some examples (run within a notmuch git repo, with up-to-date nmbug tags in the database): # take nmbug maybe-ready patches and apply them against origin/master $ nmfirehose # use local branch firehose and force use it even if existing $ nmfirehose -l firehose -F # keep going after conflicts without reverting whole series $ nmfirehose -k # check each series in review queue against master, and tag conflicting $ nmfirehose -q review -n -t # help $ nmfirehose -h I originally planned on putting this to cron and pushing the result (supported out-of-the-box) to some public repo, but in the end I think people can use this locally just as well, at the pace they want. The script tries not to screw up anything in your notmuch repo, but be careful nonetheless. Script attached; comments welcome. Is this worth adding to contrib? BR, Jani. [1] http://nmbug.tethera.net/status/ --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=nmfirehose Content-Transfer-Encoding: base64 Content-Description: nmfirehose IyEvYmluL3NoCiMgQ29weXJpZ2h0IChjKSAyMDEyIEphbmkgTmlrdWxhCiMgTGljZW5zZTogc2Ft ZSBhcyBub3RtdWNoCgojIFByZWRlZmluZWQgcXVlcmllcy4gU2VlIGh0dHA6Ly9ubWJ1Zy50ZXRo ZXJhLm5ldC9zdGF0dXMvClFVRVJZX01BWUJFX1JFQURZPSJ0YWc6bm90bXVjaDo6cGF0Y2ggYW5k IG5vdCB0YWc6bm90bXVjaDo6cHVzaGVkIGFuZCBub3QgdGFnOm5vdG11Y2g6Om9ic29sZXRlIGFu ZCBub3QgdGFnOm5vdG11Y2g6OndpcCBhbmQgbm90IHRhZzpub3RtdWNoOjpzdGFsZSBhbmQgbm90 IHRhZzpub3RtdWNoOjpjb250cmliIGFuZCBub3QgdGFnOm5vdG11Y2g6Om1vcmVpbmZvIGFuZCBu b3QgdGFnOm5vdG11Y2g6OnB5dGhvbiBhbmQgbm90IHRhZzpub3RtdWNoOjp2aW0gYW5kIG5vdCB0 YWc6bm90bXVjaDo6d29udGZpeCBhbmQgbm90IHRhZzpub3RtdWNoOjpuZWVkcy1yZXZpZXciCgpR VUVSWV9SRVZJRVc9InRhZzpub3RtdWNoOjpwYXRjaCBhbmQgbm90IHRhZzpub3RtdWNoOjpwdXNo ZWQgYW5kIG5vdCB0YWc6bm90bXVjaDo6b2Jzb2xldGUgYW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