From patchwork Mon Jul 31 14:17:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 9871887 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 2B941602F0 for ; Mon, 31 Jul 2017 14:18:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32F85285D1 for ; Mon, 31 Jul 2017 14:18:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27665285D4; Mon, 31 Jul 2017 14:18:03 +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_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable 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 C3A82285DB for ; Mon, 31 Jul 2017 14:18:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75B876E689; Mon, 31 Jul 2017 14:18:01 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC23B6E684; Mon, 31 Jul 2017 14:17:59 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id d40so6804967wma.3; Mon, 31 Jul 2017 07:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=y7VVc35HZxOmVKasI598mKzVS+h8EJ4aB4kahmi8K+s=; b=gLCp+G+TooEOdimAjyxUmjU4WKCyRDFCytssgUZRRlCIrQKXqd+owO+K9aV6F6IusM Mm871NKTSO0jMYz90wruB/Uu/AHsYug0qVlNFTdJBrveUmIhAQSICnpqUXZM4mzfR2Wn 8VuWpPHvint7xRQn3uDs6nfGQ8Yl7g99nJZPBtidYk6hv3pTkItX2Dwwe19KEPKBmOZZ 7DPk9w1M93wtYtOw9mlMrnbao5oLcGzGYRNowu/Vl7wWjND20j+sE7sabCYM2zLk1qTa SUFCyNshQT7UqGeZ4P6fxh05KXibnApcQln8oe3bVrffB3DZVxNND3nHieGihC0FCQpd ZllA== 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=y7VVc35HZxOmVKasI598mKzVS+h8EJ4aB4kahmi8K+s=; b=jaU80wraXzAJMRhCP8EWCDuLEmJlJYwsNBorzpBmmOxubkUoAKUaoQ8xTxyxMQfZLa sQXocoDd+jBWbzhA62jZAR7vKpuCQMvkAiIkcXPYizENrVRzWU4eKNFl9cNqrJ4e9tBt /SqmHesmMn5Wyy+DVdGhovDro4AreH7mOwXuXs74dLF8eXpFl4Xl7tKF5HLMsAkfhr9q uCDLodE/vTe46KFxbHbIViKd/5eXN6sT9zLBJ0l2l0bkIwyIRNjGuOVtT8R6tLvHVM+N t7ZziwKbHJ4W4B4j2nthWpBL831AqYNZXyUzrOLsEqENO79Z39qy3teU37L5hC5SmOdl 4TzA== X-Gm-Message-State: AIVw113c2HS5/34C/bVScWNnAmxzkMdIV4Is5A5D7XbCaXKQKTvb65pD acjfzqbD00D9uWb/ X-Received: by 10.28.127.14 with SMTP id a14mr10792605wmd.91.1501510677912; Mon, 31 Jul 2017 07:17:57 -0700 (PDT) Received: from localhost (p200300E41BDFF20076D02BFFFE273F51.dip0.t-ipconnect.de. [2003:e4:1bdf:f200:76d0:2bff:fe27:3f51]) by smtp.gmail.com with ESMTPSA id a31sm61053651wrc.64.2017.07.31.07.17.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Jul 2017 07:17:57 -0700 (PDT) From: Thierry Reding To: intel-gfx@lists.freedesktop.org Date: Mon, 31 Jul 2017 16:17:56 +0200 Message-Id: <20170731141756.26745-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.13.3 Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [maintainer-tools PATCH] dim: Add apply and push shorthands for current branch 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 From: Thierry Reding The new apply and push commands are shorthands for applying patches to and pushing the current branch, respectively. Signed-off-by: Thierry Reding --- dim | 27 +++++++++++++++++++++++++++ dim.rst | 8 ++++++++ 2 files changed, 35 insertions(+) diff --git a/dim b/dim index c0cbe352b165..036cb092557e 100755 --- a/dim +++ b/dim @@ -326,6 +326,20 @@ function git_fetch_helper # remote fi } +function git_current_branch +{ + local line branch + + git branch --list | while read line; do + branch="${line#* }" + + if test "$branch" != "$line"; then + echo "$branch" + break + fi + done +} + function git_is_current_branch # branch { git branch --list $1 | grep -q '\*' @@ -739,6 +753,11 @@ function dim_push_fixes dim_push_branch drm-intel-fixes "$@" } +function dim_push +{ + dim_push_branch $(git_current_branch) "$@" +} + # ensure we're on branch $1, and apply patches. the rest of the arguments are # passed to git am. dim_alias_ab=apply-branch @@ -930,6 +949,14 @@ function dim_apply_next_fixes dim_apply_branch drm-intel-next-fixes "$@" } +# apply patch to current branch, the rest of the arguments are passed to +# git am +dim_alias_am=apply +function dim_apply +{ + dim_apply_branch $(git_current_branch) "$@" +} + function commit_list_references { local commit remote log diff --git a/dim.rst b/dim.rst index c004c30ada17..fa9b587d73bb 100644 --- a/dim.rst +++ b/dim.rst @@ -198,6 +198,10 @@ apply-queued [*git am arguments*] **apply-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, and *drm-intel-next-queued* branches respectively. +apply [*git am arguments*] +-------------------------- +**apply-branch** shorthand for the current branch. + extract-tags *branch* [*git-rangeish*] -------------------------------------- This extracts various tags (e.g. Reviewed-by:) from emails and applies them to the @@ -232,6 +236,10 @@ push-queued [*git push arguments*] **push-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, and *drm-intel-next-queued* branches respectively. +push [*git push arguments*] +--------------------------- +**push** shorthand for the current branch. + rebuild-tip ----------- Rebuild and push the integration tree.