From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
s-beyer@gmx.net, christian.couder@gmail.com, szeder@ira.uka.de,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH] revert, cherry-pick: rename --quit to be consistent with rebase
Date: Fri, 9 Dec 2016 18:34:27 +0700 [thread overview]
Message-ID: <20161209113427.6039-2-pclouds@gmail.com> (raw)
In-Reply-To: <20161209113427.6039-1-pclouds@gmail.com>
The old --quit remains supported, just hidden away.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Documentation/git-cherry-pick.txt | 2 +-
Documentation/git-revert.txt | 2 +-
Documentation/sequencer.txt | 2 +-
builtin/revert.c | 7 +++++--
contrib/completion/git-completion.bash | 4 ++--
sequencer.c | 2 +-
t/t3510-cherry-pick-sequence.sh | 14 +++++++-------
t/t3511-cherry-pick-x.sh | 2 +-
8 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 6154e57..de878ff 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -11,7 +11,7 @@ SYNOPSIS
'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
[-S[<keyid>]] <commit>...
'git cherry-pick' --continue
-'git cherry-pick' --quit
+'git cherry-pick' --forget
'git cherry-pick' --abort
DESCRIPTION
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 573616a..c21a43b 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -10,7 +10,7 @@ SYNOPSIS
[verse]
'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>...
'git revert' --continue
-'git revert' --quit
+'git revert' --forget
'git revert' --abort
DESCRIPTION
diff --git a/Documentation/sequencer.txt b/Documentation/sequencer.txt
index 5747f44..ddfaad6 100644
--- a/Documentation/sequencer.txt
+++ b/Documentation/sequencer.txt
@@ -3,7 +3,7 @@
'.git/sequencer'. Can be used to continue after resolving
conflicts in a failed cherry-pick or revert.
---quit::
+--forget::
Forget about the current operation in progress. Can be used
to clear the sequencer state after a failed cherry-pick or
revert.
diff --git a/builtin/revert.c b/builtin/revert.c
index 56a2c36..663eaf7 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -77,7 +77,10 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
const char *me = action_name(opts);
int cmd = 0;
struct option options[] = {
- OPT_CMDMODE(0, "quit", &cmd, N_("end revert or cherry-pick sequence"), 'q'),
+ OPT_CMDMODE(0, "forget", &cmd, N_("end revert or cherry-pick sequence"), 'q'),
+ { OPTION_CMDMODE, 0, "quit", &cmd, NULL,
+ N_("end revert or cherry-pick sequence"),
+ PARSE_OPT_NOARG|PARSE_OPT_NONEG|PARSE_OPT_HIDDEN, NULL, 'q' },
OPT_CMDMODE(0, "continue", &cmd, N_("resume revert or cherry-pick sequence"), 'c'),
OPT_CMDMODE(0, "abort", &cmd, N_("cancel revert or cherry-pick sequence"), 'a'),
OPT_BOOL('n', "no-commit", &opts->no_commit, N_("don't automatically commit")),
@@ -134,7 +137,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
if (opts->subcommand != REPLAY_NONE) {
char *this_operation;
if (opts->subcommand == REPLAY_REMOVE_STATE)
- this_operation = "--quit";
+ this_operation = "--forget";
else if (opts->subcommand == REPLAY_CONTINUE)
this_operation = "--continue";
else {
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8159f28..d5c74e7 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1047,7 +1047,7 @@ _git_cherry_pick ()
{
local dir="$(__gitdir)"
if [ -f "$dir"/CHERRY_PICK_HEAD ]; then
- __gitcomp "--continue --quit --abort"
+ __gitcomp "--continue --forget --abort"
return
fi
case "$cur" in
@@ -2303,7 +2303,7 @@ _git_revert ()
{
local dir="$(__gitdir)"
if [ -f "$dir"/REVERT_HEAD ]; then
- __gitcomp "--continue --quit --abort"
+ __gitcomp "--continue --forget --abort"
return
fi
case "$cur" in
diff --git a/sequencer.c b/sequencer.c
index e66f2fe..12d10d0 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -812,7 +812,7 @@ static int create_seq_dir(void)
{
if (file_exists(git_path_seq_dir())) {
error(_("a cherry-pick or revert is already in progress"));
- advise(_("try \"git cherry-pick (--continue | --quit | --abort)\""));
+ advise(_("try \"git cherry-pick (--continue | --forget | --abort)\""));
return -1;
}
else if (mkdir(git_path_seq_dir(), 0777) < 0)
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index 7b7a89d..d84fafa 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -18,7 +18,7 @@ test_description='Test cherry-pick continuation features
_r10='\1\1\1\1\1\1\1\1\1\1'
pristine_detach () {
- git cherry-pick --quit &&
+ git cherry-pick --forget &&
git checkout -f "$1^0" &&
git read-tree -u --reset HEAD &&
git clean -d -f -f -q -x
@@ -89,9 +89,9 @@ test_expect_success 'cherry-pick cleans up sequencer state upon success' '
test_path_is_missing .git/sequencer
'
-test_expect_success '--quit does not complain when no cherry-pick is in progress' '
+test_expect_success '--forget does not complain when no cherry-pick is in progress' '
pristine_detach initial &&
- git cherry-pick --quit
+ git cherry-pick --forget
'
test_expect_success '--abort requires cherry-pick in progress' '
@@ -99,14 +99,14 @@ test_expect_success '--abort requires cherry-pick in progress' '
test_must_fail git cherry-pick --abort
'
-test_expect_success '--quit cleans up sequencer state' '
+test_expect_success '--forget cleans up sequencer state' '
pristine_detach initial &&
test_expect_code 1 git cherry-pick base..picked &&
- git cherry-pick --quit &&
+ git cherry-pick --forget &&
test_path_is_missing .git/sequencer
'
-test_expect_success '--quit keeps HEAD and conflicted index intact' '
+test_expect_success '--forget keeps HEAD and conflicted index intact' '
pristine_detach initial &&
cat >expect <<-\EOF &&
OBJID
@@ -116,7 +116,7 @@ test_expect_success '--quit keeps HEAD and conflicted index intact' '
:000000 100644 OBJID OBJID A unrelated
EOF
test_expect_code 1 git cherry-pick base..picked &&
- git cherry-pick --quit &&
+ git cherry-pick --forget &&
test_path_is_missing .git/sequencer &&
test_must_fail git update-index --refresh &&
{
diff --git a/t/t3511-cherry-pick-x.sh b/t/t3511-cherry-pick-x.sh
index 9cce5ae..a56d48e 100755
--- a/t/t3511-cherry-pick-x.sh
+++ b/t/t3511-cherry-pick-x.sh
@@ -5,7 +5,7 @@ test_description='Test cherry-pick -x and -s'
. ./test-lib.sh
pristine_detach () {
- git cherry-pick --quit &&
+ git cherry-pick --forget &&
git checkout -f "$1^0" &&
git read-tree -u --reset HEAD &&
git clean -d -f -f -q -x
--
2.8.2.524.g6ff3d78
next prev parent reply other threads:[~2016-12-09 11:35 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 18:58 BUG: "cherry-pick A..B || git reset --hard OTHER" Junio C Hamano
2016-12-07 14:31 ` Christian Couder
2016-12-07 18:36 ` Stephan Beyer
2016-12-07 20:04 ` Junio C Hamano
2016-12-07 20:35 ` Stephan Beyer
2016-12-07 23:21 ` Duy Nguyen
2016-12-09 11:33 ` Duy Nguyen
2016-12-09 11:34 ` [PATCH] rebase: rename --forget to be consistent with sequencer Nguyễn Thái Ngọc Duy
2016-12-09 11:34 ` Nguyễn Thái Ngọc Duy [this message]
2016-12-09 18:07 ` BUG: "cherry-pick A..B || git reset --hard OTHER" Junio C Hamano
2016-12-09 19:24 ` Stephan Beyer
2016-12-09 19:28 ` Stephan Beyer
2016-12-10 11:00 ` Duy Nguyen
2016-12-10 21:23 ` Junio C Hamano
2016-12-08 7:50 ` Christian Couder
2016-12-07 21:51 ` [PATCH 1/5] am: Fix filename in safe_to_abort() error message Stephan Beyer
2016-12-08 10:21 ` Paul Tan
2016-12-07 21:51 ` [PATCH 2/5] am: Change safe_to_abort()'s not rewinding error into a warning Stephan Beyer
2016-12-07 21:51 ` [PATCH 3/5] Add test that cherry-pick --abort does not unsafely change HEAD Stephan Beyer
2016-12-07 21:51 ` [PATCH 4/5] Make sequencer abort safer Stephan Beyer
2016-12-08 15:28 ` Johannes Schindelin
2016-12-08 17:27 ` Junio C Hamano
2016-12-08 19:17 ` Stephan Beyer
2016-12-09 18:33 ` Junio C Hamano
2016-12-09 19:01 ` [PATCH v2 1/5] am: Fix filename in safe_to_abort() error message Stephan Beyer
2016-12-09 19:01 ` [PATCH v2 2/5] am: Change safe_to_abort()'s not rewinding error into a warning Stephan Beyer
2016-12-09 19:01 ` [PATCH v2 3/5] Add test that cherry-pick --abort does not unsafely change HEAD Stephan Beyer
2016-12-09 19:01 ` [PATCH v2 4/5] Make sequencer abort safer Stephan Beyer
2016-12-10 19:56 ` Christian Couder
2016-12-10 20:04 ` Jeff King
2016-12-10 20:20 ` Stephan Beyer
2016-12-09 19:01 ` [PATCH v2 5/5] sequencer: Remove useless get_dir() function Stephan Beyer
2016-12-07 21:51 ` [PATCH " Stephan Beyer
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=20161209113427.6039-2-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=s-beyer@gmx.net \
--cc=szeder@ira.uka.de \
/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).