From patchwork Sat Mar 23 15:25:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10866857 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 87EF11390 for ; Sat, 23 Mar 2019 15:25:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AB4C29969 for ; Sat, 23 Mar 2019 15:25:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5908A291E2; Sat, 23 Mar 2019 15:25:38 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 BB6BC28451 for ; Sat, 23 Mar 2019 15:25:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727730AbfCWPZg (ORCPT ); Sat, 23 Mar 2019 11:25:36 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:47069 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727677AbfCWPZg (ORCPT ); Sat, 23 Mar 2019 11:25:36 -0400 Received: by mail-pf1-f195.google.com with SMTP id 9so3464280pfj.13 for ; Sat, 23 Mar 2019 08:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Phnsw4zG02guc8oZcPcLY+WOWXthybQOjzshjFP+uuo=; b=FiXgMLidoWSw9uk6YCQTYgB5ruAzMYjYskVxUdoqV454mcPY1A/HnnAfvBs+oRzb4w XUbl5O23lP2W3OB84+2U3JLeNsE6H3JGvB+u/Fg0RIPJH7rhEaxgE1fjGRs7tsZFQ4G1 rL62ctfWI7bV+NC3N2wyWLnUupSfiqBVZdaOCbGfkEpITOlwuE5hYpx1O+djJZFqC8lA pAp44H0jrn7qkcUq9hkE4BPpmTznfFkh+auq0MvhWc8jSCmU98ZrMLrMmGATGPDHMSmo lO92vQUfUuan4cx1V4gJOmqSJCcl22sSBKDEptmOInfgDtZ0CFnTQcRTFHiCf6eUnUmc ugnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Phnsw4zG02guc8oZcPcLY+WOWXthybQOjzshjFP+uuo=; b=KPKrwj0iFvNEmtGW7nmZwcMvn+kHamadjHOAj8H5EjpkjdOqypKfgC3uPk8YPGek3v vDR9Np92Jr5cUCDDzEh//tVN35p0r9Z6TxhE/R/jNthUQpFQld9GK/5u3fSQeQBczeAE cFctDGavG7TXchK+a6JNxsU4Cupves6g27nGHQ/i8HuNO894s3CCxKrM656TDYh2xmWX smzQZVWrcWS8G6VSyN9YXq4wISTrdZZYXcZewfmi1Fc/+eoShcwwyNBFh5AXwwOcb/Tn 5FmkcyKHJ01Fe0p/HTREJL/EtrcqYa3vgNoG3pDgmaqjmIiCuMWEsLuSvgpPafPkRp3b hR9g== X-Gm-Message-State: APjAAAU9B+asINK8SWEoMW8cm1lDeZvTmI44hh4CH06gFxmMMS5zD0gH BPS34MWSCflbPYXu2HqIhB1ru03L X-Google-Smtp-Source: APXvYqzVZCXIT6AaU4gAIt5M9Z2ZeWnmqPrqM0YGqk48WMZoHC2ATVoRn0oD9ZhhyxjJccubHQyPbA== X-Received: by 2002:a63:4e64:: with SMTP id o36mr14081499pgl.213.1553354735686; Sat, 23 Mar 2019 08:25:35 -0700 (PDT) Received: from archbookpro.localdomain ([172.56.17.211]) by smtp.gmail.com with ESMTPSA id j14sm14209528pfe.12.2019.03.23.08.25.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Mar 2019 08:25:35 -0700 (PDT) Date: Sat, 23 Mar 2019 08:25:28 -0700 From: Denton Liu To: Git Mailing List Subject: [PATCH 1/3] rebase: teach rebase --keep-base Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A common scenario is if a user is working on a topic branch and they wish to make some changes to intermediate commits or autosquashing, they would run something such as git rebase -i --onto master... master in order to preserve the merge base. This prevents unnecessary commit churning. Alternatively, a user wishing to test individual commits in a topic branch without changing anything may run git rebase -x ./test.sh master... master Since rebasing onto the merge base of the branch and the upstream is such a common case, introduce the --keep-base option as a shortcut. This allows us to rewrite the above as git rebase -i --keep-base master and git rebase -x ./test.sh --keep-base master respectively. Signed-off-by: Denton Liu --- builtin/rebase.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 77deebc65c..fffee89064 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -27,8 +27,8 @@ #include "branch.h" static char const * const builtin_rebase_usage[] = { - N_("git rebase [-i] [options] [--exec ] [--onto ] " - "[] []"), + N_("git rebase [-i] [options] [--exec ] " + "[--onto | --keep-base] [ []]"), N_("git rebase [-i] [options] [--exec ] [--onto ] " "--root []"), N_("git rebase --continue | --abort | --skip | --edit-todo"), @@ -1018,6 +1018,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) }; const char *branch_name; int ret, flags, total_argc, in_progress = 0; + int keep_base = 0; int ok_to_skip_pre_rebase = 0; struct strbuf msg = STRBUF_INIT; struct strbuf revisions = STRBUF_INIT; @@ -1051,6 +1052,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) OPT_STRING(0, "onto", &options.onto_name, N_("revision"), N_("rebase onto given branch instead of upstream")), + OPT_BOOL(0, "keep-base", &keep_base, + N_("use the merge-base of upstream and branch as the current base")), OPT_BOOL(0, "no-verify", &ok_to_skip_pre_rebase, N_("allow pre-rebase hook to run")), OPT_NEGBIT('q', "quiet", &options.flags, @@ -1217,6 +1220,13 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) usage_with_options(builtin_rebase_usage, builtin_rebase_options); + if (keep_base) { + if (options.onto_name) + die(_("cannot combine '--keep-base' with '--onto'")); + if (options.root) + die(_("cannot combine '--keep-base' with '--root'")); + } + if (action != NO_ACTION && !in_progress) die(_("No rebase in progress?")); setenv(GIT_REFLOG_ACTION_ENVIRONMENT, "rebase", 0); @@ -1541,10 +1551,19 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) } /* Make sure the branch to rebase onto is valid. */ - if (!options.onto_name) + if (keep_base) { + strbuf_reset(&buf); + strbuf_addstr(&buf, options.upstream_name); + strbuf_addstr(&buf, "..."); + options.onto_name = xstrdup(buf.buf); + } else if (!options.onto_name) options.onto_name = options.upstream_name; if (strstr(options.onto_name, "...")) { if (get_oid_mb(options.onto_name, &merge_base) < 0) + if (keep_base) + die(_("'%s': need exactly one merge base with branch"), + options.upstream_name); + else die(_("'%s': need exactly one merge base"), options.onto_name); options.onto = lookup_commit_or_die(&merge_base, From patchwork Sat Mar 23 15:25:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10866859 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 C2E811390 for ; Sat, 23 Mar 2019 15:25:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8798291E2 for ; Sat, 23 Mar 2019 15:25:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D06129C8C; Sat, 23 Mar 2019 15:25:46 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 90729291E2 for ; Sat, 23 Mar 2019 15:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727746AbfCWPZo (ORCPT ); Sat, 23 Mar 2019 11:25:44 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46427 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727677AbfCWPZo (ORCPT ); Sat, 23 Mar 2019 11:25:44 -0400 Received: by mail-pg1-f193.google.com with SMTP id a22so3474771pgg.13 for ; Sat, 23 Mar 2019 08:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zL52v53Y03n+ceEFJ89GWw/GvEQpi29fWEbH6Av6QkI=; b=Z9ydceLzTZ7P+P6+dIsO2x07MzJbAna4cwOhiiUrIfZam/7KJyyKrV47Oa5tcpS7t1 F3AnuTCG4c0gRiCI8UVxkC4WEgFqGLb9NQebHn3fYxb6XS2VCMRJnL+nEytW7VXR37j6 e1eIEcKlA7VuljSQa/8AbjrC5Di+qjwGChnb4BtIqQJEOHPBeei/EPcIQ9+imf+kXg53 pc2TjP5XhdPPpvgfBLrh13NKgoVYhORYEq2FBRd4vOXH8141wnzzErFd0yyubHppyLhr 6k7FYdKQ4d4JgSjWCzD28b1hgSlNAPFNk+kGQa3GX8RpkVluOt153V1KXxDyRxRFTT2+ 0a1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zL52v53Y03n+ceEFJ89GWw/GvEQpi29fWEbH6Av6QkI=; b=Dea2z/aooFEKa/FawiJy2w3tSm6THuFNt3fmsyzOO27vJ7MZFxVyskr6DQT79bYT1u 4oWrjUwJe4+66mx2nyQdlG6BpbWD7D5tr+44Gd2bTABIJA9ExG3W5ekoQl7+9XLIVymo zvQR5x48t1X7SiGRUsUdviWlMXmBjISYq+B/Msid80XeOgpnqxJO+V9cIHbkzcHp3WWU tripYr5rK+1xhbiYIflk41ySE/Z0DQ53i/1DhCG9G0/SaL91XaaO9FFWKNVkNZfPDrsD GwvIae8Wfm4dH7uFjgMygxFiYl3GXE3AmiNM3cCwCsipeeSni05JhJdoBMhjVfCNzlCy jZUA== X-Gm-Message-State: APjAAAUM8rHTqFbKYy0TjyV8yrWXsmpaeP//JcZPiDQT8vFbX8XrrU0z MIKNvcYMde851lQjindoCHRKgxs/ X-Google-Smtp-Source: APXvYqzjSCx/QouBg8mn/D67NYzTdhRlBGkEOg0zVG8zX43aL/P+6JVaazMlcShfcOXvR5zP/jTPkA== X-Received: by 2002:a17:902:8643:: with SMTP id y3mr15335336plt.195.1553354743288; Sat, 23 Mar 2019 08:25:43 -0700 (PDT) Received: from archbookpro.localdomain ([172.56.17.211]) by smtp.gmail.com with ESMTPSA id k9sm22953148pfc.57.2019.03.23.08.25.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Mar 2019 08:25:42 -0700 (PDT) Date: Sat, 23 Mar 2019 08:25:36 -0700 From: Denton Liu To: Git Mailing List Subject: [PATCH 2/3] t3416: test rebase --keep-base Message-ID: <6398944a6f9e696a6f6f7d616447160af93b0639.1553354374.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Test rebase --keep-base to ensure it works correctly in the normal case and fails when there are multiple merge-bases, both in regular and interactive mode. Also, test to make sure conflicting options causes rebase to fail. While we're at it, add a missing set_fake_editor call to 'rebase -i --onto master...side'. Signed-off-by: Denton Liu --- t/t3416-rebase-onto-threedots.sh | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh index ddf2f64853..9c2548423b 100755 --- a/t/t3416-rebase-onto-threedots.sh +++ b/t/t3416-rebase-onto-threedots.sh @@ -99,7 +99,64 @@ test_expect_success 'rebase -i --onto master...side' ' git checkout side && git reset --hard K && + set_fake_editor && test_must_fail git rebase -i --onto master...side J ' +test_expect_success 'rebase --keep-base --onto incompatible' ' + test_must_fail git rebase --keep-base --onto master... +' + +test_expect_success 'rebase --keep-base --root incompatible' ' + test_must_fail git rebase --keep-base --root +' + +test_expect_success 'rebase --keep-base master from topic' ' + git reset --hard && + git checkout topic && + git reset --hard G && + + git rebase --keep-base master && + git rev-parse C >base.expect && + git merge-base master HEAD >base.actual && + test_cmp base.expect base.actual && + + git rev-parse HEAD~2 >actual && + git rev-parse C^0 >expect && + test_cmp expect actual +' + +test_expect_success 'rebase --keep-base master from side' ' + git reset --hard && + git checkout side && + git reset --hard K && + + test_must_fail git rebase --keep-base master +' + +test_expect_success 'rebase -i --keep-base master from topic' ' + git reset --hard && + git checkout topic && + git reset --hard G && + + set_fake_editor && + EXPECT_COUNT=2 git rebase -i --keep-base master && + git rev-parse C >base.expect && + git merge-base master HEAD >base.actual && + test_cmp base.expect base.actual && + + git rev-parse HEAD~2 >actual && + git rev-parse C^0 >expect && + test_cmp expect actual +' + +test_expect_success 'rebase -i --keep-base master from side' ' + git reset --hard && + git checkout side && + git reset --hard K && + + set_fake_editor && + test_must_fail git rebase -i --keep-base master +' + test_done From patchwork Sat Mar 23 15:25:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10866861 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 DCF50922 for ; Sat, 23 Mar 2019 15:25:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C29B9291E2 for ; Sat, 23 Mar 2019 15:25:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B727E29C8C; Sat, 23 Mar 2019 15:25:52 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 5FD1A291E2 for ; Sat, 23 Mar 2019 15:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727754AbfCWPZv (ORCPT ); Sat, 23 Mar 2019 11:25:51 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36232 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727372AbfCWPZv (ORCPT ); Sat, 23 Mar 2019 11:25:51 -0400 Received: by mail-pf1-f196.google.com with SMTP id p10so3494554pff.3 for ; Sat, 23 Mar 2019 08:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=g4ZNdZpmmwUoCHPmCpS71WtXGaNzSDoLsluClN+27UQ=; b=gYOwBN7epr+NsIMtbTWs9HbzjC3d+mDxHMbA0s0t0ZJstEq4N9MfNlzxnLycFPQJ3t 3fARsY3xPyg8zEdavEAnD3CF5GxYsfACEKCzGSddsdsyxcyw64j5CXmHjkXHzuO/moOK 0xbTnaynt+JmqYOcU7+I2gvV63CwFUqeobTx4pptMzuoGGHIpa0dQM5EuBHB+e7D2mhX cRsWGCSguMrFu1glnMeuXgm4CWzxZya2MsX85xKLaNAe5aas0CPFWHzsXZG/A2iEpX9N IAtboLSpZPEiVsIqqxHcjkxUTtty7A/gxL2V+P5Wm7fIT3+z/Xp+XbiUPgH2GDmp58us V//g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=g4ZNdZpmmwUoCHPmCpS71WtXGaNzSDoLsluClN+27UQ=; b=Dsr/bYUf8Bz9xq5twnn5BXCTodjs7hefK0mXGxEfSvmKGE1bytwsEjK5hDRI/dSgN/ QU/C0buAIiIv6kNjPWFhN0Be1BFQO2T/wo4N23APR4KBy28LlCKs1/WBR853oHIW9/3D x92PJWmYEgx2BZNFKiIaxfu0/DnumUTnhpr+AyWPoenNT6huWJVn7k/IXspy68fwH/Gy Skz4gPgJwxs/BB6Nvo7BUHTVXuclzAPuSuAWmOFxHOqAcWS28vOnulLApOgqAIHnYZVW L7p1cxDWpbGXB8tV3LvuwKeTqaVPCbyFeMpWLC8mN3FKqa1aw8NaczN7R1zVJa1lVsVA +HKw== X-Gm-Message-State: APjAAAU+8GPqAbBc7yoom2DnWPVJrDVW+hkOWERB7+O0lZ1kbX5EKiih //4He906O6JaK1K+R+G/s9Rb6PPr X-Google-Smtp-Source: APXvYqwsbMTmFheWWPqT33iIsv3FMTciPfIQ8xiEBgRwBIrDzr1MIHT2fyKLAqW6RURkZIMngbop+w== X-Received: by 2002:a17:902:4827:: with SMTP id s36mr15551394pld.220.1553354750363; Sat, 23 Mar 2019 08:25:50 -0700 (PDT) Received: from archbookpro.localdomain ([172.56.17.211]) by smtp.gmail.com with ESMTPSA id d5sm12107706pgv.20.2019.03.23.08.25.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Mar 2019 08:25:49 -0700 (PDT) Date: Sat, 23 Mar 2019 08:25:43 -0700 From: Denton Liu To: Git Mailing List Subject: [PATCH 3/3] git-rebase.txt: document --keep-base option Message-ID: <8896a65c2cecfc84c494545e47c918a45cd63602.1553354374.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Document the --keep-base rebase option. While we're at it, change an instance of "merge-base" to "merge base", which is the consistent spelling. Signed-off-by: Denton Liu --- Documentation/git-rebase.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 6363d674b7..780d381667 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -8,8 +8,8 @@ git-rebase - Reapply commits on top of another base tip SYNOPSIS -------- [verse] -'git rebase' [-i | --interactive] [] [--exec ] [--onto ] - [ []] +'git rebase' [-i | --interactive] [] [--exec ] + [--onto | --keep-base] [ []] 'git rebase' [-i | --interactive] [] [--exec ] [--onto ] --root [] 'git rebase' --continue | --skip | --abort | --quit | --edit-todo | --show-current-patch @@ -217,6 +217,12 @@ As a special case, you may use "A\...B" as a shortcut for the merge base of A and B if there is exactly one merge base. You can leave out at most one of A and B, in which case it defaults to HEAD. +--keep-base:: + Set the starting point at which to create the new commits to the + merge base of . Running + 'git rebase --keep-base ' is equivalent to + running 'git rebase --onto ... '. + :: Upstream branch to compare against. May be any valid commit, not just an existing branch name. Defaults to the configured @@ -863,7 +869,7 @@ NOTE: While an "easy case recovery" sometimes appears to be successful --interactive` will be **resurrected**! The idea is to manually tell 'git rebase' "where the old 'subsystem' -ended and your 'topic' began", that is, what the old merge-base +ended and your 'topic' began", that is, what the old merge base between them was. You will have to find a way to name the last commit of the old 'subsystem', for example: