From patchwork Thu Jun 12 01:54:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 358951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C57BE140092 for ; Thu, 12 Jun 2014 11:56:25 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id B4B131A060F for ; Thu, 12 Jun 2014 11:56:25 +1000 (EST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mail-qa0-x22b.google.com (mail-qa0-x22b.google.com [IPv6:2607:f8b0:400d:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 8C9AA1A054E for ; Thu, 12 Jun 2014 11:56:22 +1000 (EST) Received: by mail-qa0-f43.google.com with SMTP id k15so831711qaq.30 for ; Wed, 11 Jun 2014 18:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=5Eq5sMvoavN17KvlqJA1o5cgGgqYh/IgwZtu5Kjl7gc=; b=y9uAXUqoHj3AZ4otRrlmbbpsgr/oTSN1VDG1pyXoqICxe7xZZCd/OIr/nIsbC9lpkC KguLS3uZ5H+YrmaGYQFOrTs5vs5a4wj9X/IccmvAJ5NusYZyQlneREetXVGsFRewXfdY 4ehYPXxHbe/e9z54SRfSezG0ugDue7v0WINxPHtXCk988v9IQTtcmnIvwMGjxQtplxFQ YdFUZIIR7Ve9C8LW1iYQGLbVoPysXEXOtas+9JyAfuy0pzKmPAevBanlWhBnhIOpuxXx QoBsu77y1c25iQ2p4CTWYslh49QGbXJmyMsttf3r0EPyImNu3U5sUsx2B4GSoTob8G+5 nZ7g== X-Received: by 10.140.22.209 with SMTP id 75mr52863713qgn.4.1402538178557; Wed, 11 Jun 2014 18:56:18 -0700 (PDT) Received: from ld-irv-0074.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id z8sm43892443qar.49.2014.06.11.18.56.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jun 2014 18:56:18 -0700 (PDT) From: Brian Norris To: Jeremy Kerr Subject: [PATCH] post-receive: exclude commits from the patch update step Date: Wed, 11 Jun 2014 18:54:59 -0700 Message-Id: <1402538099-7200-1-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: patchwork@lists.ozlabs.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" When merging upstream work related to other projects into your own project repository, you probably don't want to check for (and try to update) the status on every change-set in the merge. So add a list of references (branches, tags, commits, etc.) whose commits should be ignored in the patch update step. This could be used, for example, to set: EXCLUDE="refs/heads/upstream" Then when you're ready to merge in new upstream code, you first update the 'upstream' branch before pushing your own. Signed-off-by: Brian Norris --- tools/post-receive.hook | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/post-receive.hook b/tools/post-receive.hook index 4fb741d3ea98..a38522e22f35 100755 --- a/tools/post-receive.hook +++ b/tools/post-receive.hook @@ -8,6 +8,12 @@ set -eu #TODO: the state map should really live in the repo's git-config STATE_MAP="refs/heads/master:Accepted" +# +# ignore all commits already present in these refs +# e.g., +# EXCLUDE="refs/heads/upstream refs/heads/other-project" +# +EXCLUDE="" PWDIR=/srv/patchwork/apps/patchwork @@ -39,7 +45,8 @@ set_patch_state() update_patches() { local cnt; cnt=0 - for rev in $(git rev-list --no-merges --reverse ${1}..${2}); do + for rev in $(git rev-parse --not ${EXCLUDE} | + git rev-list --stdin --no-merges --reverse ${1}..${2}); do if [ "$do_exit" = 1 ]; then echo "I: exiting..." >&2 break