From: Phillip Wood <phillip.wood@talktalk.net>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: [PATCH 6/6] cherry-pick/revert: reject --rerere-autoupdate when continuing
Date: Wed, 2 Aug 2017 11:44:20 +0100 [thread overview]
Message-ID: <20170802104420.12809-7-phillip.wood@talktalk.net> (raw)
In-Reply-To: <20170802104420.12809-1-phillip.wood@talktalk.net>
From: Phillip Wood <phillip.wood@dunelm.org.uk>
cherry-pick and revert should not accept --[no-]rerere-autoupdate once
they have started.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
This will break scripts that pass --[no-]rerere-autoupdate to 'git
cherry-pick --continue'. I don't think that this will be an issue for
the vast majority of users as I think most people will have assumed
that you cannot pass any other options with '--continue'.
'--rerere-autoupdate' is mentioned by 'git cherry-pick -h' but it is
not mentioned in the documentation. Hopefully a note in the release
notes should be enough to alert anyone who is affected by this.
builtin/revert.c | 2 ++
t/t3504-cherry-pick-rerere.sh | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/builtin/revert.c b/builtin/revert.c
index 16028b9ea82edee9cf41044c69a47e8994d78fc6..b9d927eb09c9ed87c84681df1396f4e6d9b13c97 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -155,6 +155,8 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
"--strategy-option", opts->xopts ? 1 : 0,
"-x", opts->record_origin,
"--ff", opts->allow_ff,
+ "--rerere-autoupdate", opts->allow_rerere_auto == RERERE_AUTOUPDATE,
+ "--no-rerere-autoupdate", opts->allow_rerere_auto == RERERE_NOAUTOUPDATE,
NULL);
}
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh
index af316cb40b7b16c95881eb8483eea4f6191c7cfa..a267b2d144df4a84f18ba4907b317e757ba98f16 100755
--- a/t/t3504-cherry-pick-rerere.sh
+++ b/t/t3504-cherry-pick-rerere.sh
@@ -65,6 +65,19 @@ test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
git reset --hard bar-dev
'
+test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
+ test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
+ test_cmp foo-expect foo &&
+ git diff-files --quiet &&
+ test_must_fail git cherry-pick --continue --rerere-autoupdate >actual 2>&1 &&
+ echo "fatal: cherry-pick: --rerere-autoupdate cannot be used with --continue" >expect &&
+ test_i18ncmp expect actual &&
+ test_must_fail git cherry-pick --continue --no-rerere-autoupdate >actual 2>&1 &&
+ echo "fatal: cherry-pick: --no-rerere-autoupdate cannot be used with --continue" >expect &&
+ test_i18ncmp expect actual &&
+ git cherry-pick --abort
+'
+
test_expect_success 'cherry-pick --rerere-autoupdate more than once' '
test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-master &&
test_cmp foo-expect foo &&
--
2.13.3
next prev parent reply other threads:[~2017-08-02 10:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-02 10:44 [PATCH 0/6] am/cherry-pick/rebase/revert --rerere-autoupdate fixes Phillip Wood
2017-08-02 10:44 ` [PATCH 1/6] am: remember --rerere-autoupdate setting Phillip Wood
2017-08-02 10:44 ` [PATCH 2/6] rebase: honor --rerere-autoupdate Phillip Wood
2017-08-02 10:44 ` [PATCH 3/6] rebase -i: " Phillip Wood
2017-08-02 10:44 ` [PATCH 4/6] t3504: use test_commit Phillip Wood
2017-08-02 10:44 ` [PATCH 5/6] cherry-pick/revert: remember --rerere-autoupdate Phillip Wood
2017-08-02 10:44 ` Phillip Wood [this message]
2017-08-02 21:57 ` [PATCH 6/6] cherry-pick/revert: reject --rerere-autoupdate when continuing Junio C Hamano
2017-08-02 22:29 ` Junio C Hamano
2017-08-03 10:15 ` Phillip Wood
2017-08-03 17:19 ` Junio C Hamano
2017-08-07 10:17 ` Phillip Wood
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170802104420.12809-7-phillip.wood@talktalk.net \
--to=phillip.wood@talktalk.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood@dunelm.org.uk \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).