All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: "Christian Biesinger" <cbiesinger@google.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"René Scharfe" <l.s.r@web.de>
Subject: [PATCH v4 5/5] rebase: fix format.useAutoBase breakage
Date: Wed, 4 Dec 2019 13:25:11 -0800	[thread overview]
Message-ID: <210905f16303e9ce7ae3845e252bc07e288f70c1.1575494618.git.liu.denton@gmail.com> (raw)
In-Reply-To: <cover.1575494617.git.liu.denton@gmail.com>

With `format.useAutoBase = true`, running rebase resulted in an
error:

	fatal: failed to get upstream, if you want to record base commit automatically,
	please use git branch --set-upstream-to to track a remote branch.
	Or you could specify base commit by --base=<base-commit-id> manually
	error:
	git encountered an error while preparing the patches to replay
	these revisions:

	    ede2467cdedc63784887b587a61c36b7850ebfac..d8f581194799ae29bf5fa72a98cbae98a1198b12

	As a result, git cannot rebase them.

Fix this by always passing `--no-base` to format-patch from rebase so
that the effect of `format.useAutoBase` is negated.

Reported-by: Christian Biesinger <cbiesinger@google.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 builtin/rebase.c  | 3 ++-
 t/t3400-rebase.sh | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/builtin/rebase.c b/builtin/rebase.c
index e755087b0f..51980ab63d 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1012,7 +1012,8 @@ static int run_am(struct rebase_options *opts)
 	argv_array_pushl(&format_patch.args, "format-patch", "-k", "--stdout",
 			 "--full-index", "--cherry-pick", "--right-only",
 			 "--src-prefix=a/", "--dst-prefix=b/", "--no-renames",
-			 "--no-cover-letter", "--pretty=mboxrd", "--topo-order", NULL);
+			 "--no-cover-letter", "--pretty=mboxrd", "--topo-order",
+			 "--no-base", NULL);
 	if (opts->git_format_patch_opt.len)
 		argv_array_split(&format_patch.args,
 				 opts->git_format_patch_opt.buf);
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index ca99e8c6c4..1323f30fee 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -159,7 +159,7 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
 	test_must_fail git rebase
 '
 
-test_expect_failure 'rebase works with format.useAutoBase' '
+test_expect_success 'rebase works with format.useAutoBase' '
 	test_config format.useAutoBase true &&
 	git checkout topic &&
 	git rebase master
-- 
2.24.0.578.g4820254054


      parent reply	other threads:[~2019-12-04 21:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 20:50 Bug with "git rebase" when format.useAutoBase is set Christian Biesinger
2019-11-27  2:09 ` [PATCH 0/5] rebase: fix breakage with `format.useAutoBase` Denton Liu
2019-11-27  2:09   ` [PATCH 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-11-27  2:26     ` Eric Sunshine
2019-11-30 17:25       ` Junio C Hamano
2019-11-27  2:09   ` [PATCH 2/5] format-patch: fix indentation Denton Liu
2019-11-27  2:09   ` [PATCH 3/5] t4014: use `test_config` Denton Liu
2019-11-27  2:09   ` [PATCH 4/5] format-patch: teach --no-base Denton Liu
2019-11-27  2:09   ` [PATCH 5/5] rebase: fix `format.useAutoBase` breakage Denton Liu
2019-11-27  2:42     ` Eric Sunshine
2019-11-27 17:14   ` [PATCH 0/5] rebase: fix breakage with `format.useAutoBase` Christian Biesinger
2019-11-27 18:13   ` [PATCH v2 " Denton Liu
2019-11-27 18:13     ` [PATCH v2 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-11-27 18:13     ` [PATCH v2 2/5] format-patch: fix indentation Denton Liu
2019-11-27 18:13     ` [PATCH v2 3/5] t4014: use test_config() Denton Liu
2019-11-27 18:13     ` [PATCH v2 4/5] format-patch: teach --no-base Denton Liu
2019-11-27 19:56       ` Denton Liu
2019-11-27 18:13     ` [PATCH v2 5/5] rebase: fix format.useAutoBase breakage Denton Liu
2019-12-04 16:21       ` Christian Biesinger
2019-12-04  7:47     ` [PATCH v3 0/5] rebase: fix breakage with `format.useAutoBase` Denton Liu
2019-12-04  7:47       ` [PATCH v3 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-12-04  7:47       ` [PATCH v3 2/5] format-patch: fix indentation Denton Liu
2019-12-04  7:47       ` [PATCH v3 3/5] t4014: use test_config() Denton Liu
2019-12-04  7:47       ` [PATCH v3 4/5] format-patch: teach --no-base Denton Liu
2019-12-04 10:36         ` René Scharfe
2019-12-04 17:26           ` Junio C Hamano
2019-12-04  7:48       ` [PATCH v3 5/5] rebase: fix format.useAutoBase breakage Denton Liu
2019-12-04 21:24       ` [PATCH v4 0/5] rebase: fix breakage with `format.useAutoBase` Denton Liu
2019-12-04 21:24         ` [PATCH v4 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-12-04 21:24         ` [PATCH v4 2/5] format-patch: fix indentation Denton Liu
2019-12-04 21:25         ` [PATCH v4 3/5] t4014: use test_config() Denton Liu
2019-12-04 21:25         ` [PATCH v4 4/5] format-patch: teach --no-base Denton Liu
2019-12-04 21:25         ` Denton Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=210905f16303e9ce7ae3845e252bc07e288f70c1.1575494618.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.com \
    --cc=cbiesinger@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.