From patchwork Wed Nov 28 13:28:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Morelle X-Patchwork-Id: 10702661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56F8F15A7 for ; Wed, 28 Nov 2018 13:37:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45B202C509 for ; Wed, 28 Nov 2018 13:37:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33A712D229; Wed, 28 Nov 2018 13:37:48 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 669D82C509 for ; Wed, 28 Nov 2018 13:37:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728215AbeK2Aj0 (ORCPT ); Wed, 28 Nov 2018 19:39:26 -0500 Received: from bumblebee.htkc.org ([212.129.41.47]:52679 "EHLO bumblebee.htkc.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbeK2Aj0 (ORCPT ); Wed, 28 Nov 2018 19:39:26 -0500 X-Greylist: delayed 533 seconds by postgrey-1.27 at vger.kernel.org; Wed, 28 Nov 2018 19:39:25 EST Received: by bumblebee.htkc.org (Postfix, from userid 65534) id 12FBD900; Wed, 28 Nov 2018 14:28:52 +0100 (CET) Received: from [192.168.1.33] (unknown [109.132.211.228]) by bumblebee.htkc.org (Postfix) with ESMTPSA id 608C688D for ; Wed, 28 Nov 2018 14:28:51 +0100 (CET) From: Paul Morelle Subject: [PATCH] rebase -i: introduce the 'test' command To: Git Users Message-ID: <3fb5a7ff-a63a-6fac-1456-4dbc9135d088@gmail.com> Date: Wed, 28 Nov 2018 14:28:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 Content-Language: en-US Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The 'exec' command can be used to run tests on a set of commits, interrupting on failing commits to let the user fix the tests. However, the 'exec' line has been consumed, so it won't be ran again by 'git rebase --continue' is ran, even if the tests weren't fixed. This commit introduces a new command 'test' equivalent to 'exec', except that it is automatically rescheduled in the todo list if it fails. Signed-off-by: Paul Morelle --- Documentation/git-rebase.txt | 9 ++++++--- rebase-interactive.c | 1 + sequencer.c | 23 +++++++++++++++-------- t/lib-rebase.sh | 4 +++- t/t3404-rebase-interactive.sh | 16 ++++++++++++++++ 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 80793bad8..c8f565637 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -693,8 +693,8 @@ $ git rebase -i -p --onto Q O Reordering and editing commits usually creates untested intermediate steps. You may want to check that your history editing did not break anything by running a test, or at least recompiling at intermediate -points in history by using the "exec" command (shortcut "x"). You may -do so by creating a todo list like this one: +points in history by using the "exec" command (shortcut "x") or the +"test" command. You may do so by creating a todo list like this one: ------------------------------------------- pick deadbee Implement feature XXX @@ -702,7 +702,7 @@ fixup f1a5c00 Fix to feature XXX exec make pick c0ffeee The oneline of the next commit edit deadbab The oneline of the commit after -exec cd subdir; make test +test cd subdir; make test ... ------------------------------------------- @@ -715,6 +715,9 @@ in `$SHELL`, or the default shell if `$SHELL` is not set), so you can use shell features (like "cd", ">", ";" ...). The command is run from the root of the working tree. +The "test" command does the same, but will remain in the todo list as +the next command, until it succeeds. + ---------------------------------- $ git rebase -i --exec "make test" ---------------------------------- diff --git a/rebase-interactive.c b/rebase-interactive.c index 78f3263fc..4a408661d 100644 --- a/rebase-interactive.c +++ b/rebase-interactive.c @@ -14,6 +14,7 @@ void append_todo_help(unsigned edit_todo, unsigned keep_empty, "s, squash = use commit, but meld into previous commit\n" "f, fixup = like \"squash\", but discard this commit's log message\n" "x, exec = run command (the rest of the line) using shell\n" +" test = same as exec command, but keep it in TODO if it fails\n" "b, break = stop here (continue rebase later with 'git rebase --continue')\n" "d, drop = remove commit\n" "l, label