From patchwork Thu Mar 30 13:30:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9654191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFF5160113 for ; Thu, 30 Mar 2017 13:30:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C324028478 for ; Thu, 30 Mar 2017 13:30:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B803128543; Thu, 30 Mar 2017 13:30:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 776D428515 for ; Thu, 30 Mar 2017 13:30:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB6FF6E8B4; Thu, 30 Mar 2017 13:30:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 484246E8B4 for ; Thu, 30 Mar 2017 13:30:50 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id p52so12232345wrc.2 for ; Thu, 30 Mar 2017 06:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=D6vQhioapScyuXQaoPtMLKdgWoPuRUD10KVsXRs+BYc=; b=KlwDulOffkCkYtX4WGG5lFmaP0z8LdUX+1d3aXVSZNa964hZnb5oKSuGqGM060lQyx 3krLmZ769+qaHSpFaHSmhCgIStqpxqNx2+bNZ8UCq1hEl0REYxpVThtgEHq/sIzC8IOB PMUVBeQypR5vB8uDhQjHJ4VcGdc+3i0jO0Lfs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=D6vQhioapScyuXQaoPtMLKdgWoPuRUD10KVsXRs+BYc=; b=tkZq7mb3Pf7KurV/oVzosLCEQKKJRiIIekhecdJnPEbgMB0prVgqZXtpbueMRBCu/g hVb3ascVR+Li343112QhLWrkYGftoMJL5nlc8sMiidnyrkIbCSvPB0v0SjmpvAGgXg/+ KBKAe6KSiORhpkS5vF7Ol+3jgyo4eey7sEKPdLn0k/aHYRdx9qWcMQwlinCBSGDQhScU cAY38pLwn8xbD2fp4qpo5it6De4nLy2FOXcWK7j4rZZTFQvF5Izsd8zFx4+VNmFIQ8PP 7Gf7k/tp4Qdp2p0AoODHdHvZLdcvYq1IdMC+Wgbgun5mnZ5ShcS3N4E1cSaaPSzqoaF2 30Xw== X-Gm-Message-State: AFeK/H09iJH6mTvhTWduLzvI6dah2NjZWX/10xdO5KPr1Vsfl8kKR0u2x4kzVifuVSab2w== X-Received: by 10.28.183.4 with SMTP id h4mr3644542wmf.140.1490880648913; Thu, 30 Mar 2017 06:30:48 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:563a:0:c2b5:dd51:f7b6:65bb]) by smtp.gmail.com with ESMTPSA id s17sm2855572wrc.25.2017.03.30.06.30.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 06:30:48 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 30 Mar 2017 15:30:43 +0200 Message-Id: <20170330133043.29267-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 Cc: Daniel Vetter , DRI Development , Daniel Vetter Subject: [Intel-gfx] [PATCH] dim: Add apply-pull command X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP I'm getting real lazy, let's start scripting this. Very rough draft, but adds a Link: (patchwork tracks pull requests too, maybe we'll start CI-ing them too), and sob line. In the future we might add more checks here ... Signed-off-by: Daniel Vetter --- dim | 34 ++++++++++++++++++++++++++++++++++ dim.rst | 4 ++++ 2 files changed, 38 insertions(+) diff --git a/dim b/dim index 0903f6c2634d..73c25a195f17 100755 --- a/dim +++ b/dim @@ -717,6 +717,40 @@ function dim_apply_branch return $rv } +dim_alias_ap=apply-pull +function dim_apply_pull +{ + local branch file message_id pull_branch rv + + branch=${1:?$usage} + shift + file=$(mktemp) + + assert_branch $branch + assert_repo_clean + + cat > $file + + pull_branch=$(sed -e '0,/git repository at:$/d' $file | head -n 2 | tail -n 1) + + echo $pull_branch + + git pull $pull_branch + + message_id=$(message_get_id $file) + + if [ -n "$message_id" ]; then + dim_commit_add_tag "\nLink: http://patchwork.freedesktop.org/patch/msgid/$message_id" + else + echoerr "WARNING: No message-id found in the patch file." + rv=1 + fi + + git commit --amend -s + + return $rv +} + function dim_add_link { local branch file message_id diff --git a/dim.rst b/dim.rst index aed79ca1d43c..a1c67143d910 100644 --- a/dim.rst +++ b/dim.rst @@ -356,6 +356,10 @@ tag; this must have been done previously using **update-next**. This also means that the pull request can be regenerated with the same commands if something goes wrong. +apply-pull *branch* +------------------- +Reads a pull request mail from stdin and merges it into the given *branch*. + update-next ----------- Pushes out the latest dinq to drm-intel-next and tags it. Also