git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>,
	Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
	Phil Hord <phil.hord@gmail.com>
Subject: [PATCH 1/3] revert: rename --reset option to --quit
Date: Sun, 20 Nov 2011 03:48:24 -0600	[thread overview]
Message-ID: <20111120094824.GC2278@elie.hsd1.il.comcast.net> (raw)
In-Reply-To: <20111120094650.GB2278@elie.hsd1.il.comcast.net>

The option to "git cherry-pick" and "git revert" to discard the
sequencer state introduced by v1.7.8-rc0~141^2~6 (revert: Introduce
--reset to remove sequencer state, 2011-08-04) has a confusing name.
Change it now, while we still have the time.

Mechanics:

This commit removes the "git cherry-pick --reset" option.  Hopefully
nobody was using it.  If somebody was, we can add it back again as a
synonym.

The new name for "cherry-pick, please get out of my way, since I've
long forgotten about the sequence of commits I was cherry-picking when
you wrote that old .git/sequencer directory" is --quit.  Mnemonic:
this is analagous to quiting a program the user is no longer using ---
we just want to get out of the multiple-command cherry-pick procedure
and not to reset HEAD or restore any other old state.

Adjust documentation and tests to match.  While at it, let's clarify
the short descriptions of these operations in "-h" output.

Before:

	--reset		forget the current operation
	--continue	continue the current operation

After:

	--quit		end revert or cherry-pick sequence
	--continue	resume revert or cherry-pick sequence

Noticed-by: Phil Hord <phil.hord@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Documentation/git-cherry-pick.txt |    2 +-
 Documentation/git-revert.txt      |    2 +-
 Documentation/sequencer.txt       |   10 +++++-----
 builtin/revert.c                  |   22 +++++++++++-----------
 sequencer.h                       |    2 +-
 t/t3510-cherry-pick-sequence.sh   |   10 +++++-----
 t/t7106-reset-sequence.sh         |    2 +-
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 2660a842..21998b82 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -9,8 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>...
-'git cherry-pick' --reset
 'git cherry-pick' --continue
+'git cherry-pick' --quit
 
 DESCRIPTION
 -----------
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index f3519413..b0fcabc8 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -9,8 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] <commit>...
-'git revert' --reset
 'git revert' --continue
+'git revert' --quit
 
 DESCRIPTION
 -----------
diff --git a/Documentation/sequencer.txt b/Documentation/sequencer.txt
index 3e6df338..75f8e869 100644
--- a/Documentation/sequencer.txt
+++ b/Documentation/sequencer.txt
@@ -1,9 +1,9 @@
---reset::
-	Forget about the current operation in progress.  Can be used
-	to clear the sequencer state after a failed cherry-pick or
-	revert.
-
 --continue::
 	Continue the operation in progress using the information in
 	'.git/sequencer'.  Can be used to continue after resolving
 	conflicts in a failed cherry-pick or revert.
+
+--quit::
+	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 544e8c30..b59dd68c 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -40,7 +40,7 @@ static const char * const cherry_pick_usage[] = {
 };
 
 enum replay_action { REVERT, CHERRY_PICK };
-enum replay_subcommand { REPLAY_NONE, REPLAY_RESET, REPLAY_CONTINUE };
+enum replay_subcommand { REPLAY_NONE, REPLAY_REMOVE_STATE, REPLAY_CONTINUE };
 
 struct replay_opts {
 	enum replay_action action;
@@ -133,11 +133,11 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
 {
 	const char * const * usage_str = revert_or_cherry_pick_usage(opts);
 	const char *me = action_name(opts);
-	int reset = 0;
+	int remove_state = 0;
 	int contin = 0;
 	struct option options[] = {
-		OPT_BOOLEAN(0, "reset", &reset, "forget the current operation"),
-		OPT_BOOLEAN(0, "continue", &contin, "continue the current operation"),
+		OPT_BOOLEAN(0, "quit", &remove_state, "end revert or cherry-pick sequence"),
+		OPT_BOOLEAN(0, "continue", &contin, "resume revert or cherry-pick sequence"),
 		OPT_BOOLEAN('n', "no-commit", &opts->no_commit, "don't automatically commit"),
 		OPT_BOOLEAN('e', "edit", &opts->edit, "edit the commit message"),
 		OPT_NOOP_NOARG('r', NULL),
@@ -168,13 +168,13 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
 
 	/* Check for incompatible subcommands */
 	verify_opt_mutually_compatible(me,
-				"--reset", reset,
+				"--quit", remove_state,
 				"--continue", contin,
 				NULL);
 
 	/* Set the subcommand */
-	if (reset)
-		opts->subcommand = REPLAY_RESET;
+	if (remove_state)
+		opts->subcommand = REPLAY_REMOVE_STATE;
 	else if (contin)
 		opts->subcommand = REPLAY_CONTINUE;
 	else
@@ -183,8 +183,8 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
 	/* Check for incompatible command line arguments */
 	if (opts->subcommand != REPLAY_NONE) {
 		char *this_operation;
-		if (opts->subcommand == REPLAY_RESET)
-			this_operation = "--reset";
+		if (opts->subcommand == REPLAY_REMOVE_STATE)
+			this_operation = "--quit";
 		else
 			this_operation = "--continue";
 
@@ -965,7 +965,7 @@ static int pick_revisions(struct replay_opts *opts)
 	 * cherry-pick should be handled differently from an existing
 	 * one that is being continued
 	 */
-	if (opts->subcommand == REPLAY_RESET) {
+	if (opts->subcommand == REPLAY_REMOVE_STATE) {
 		remove_sequencer_state(1);
 		return 0;
 	} else if (opts->subcommand == REPLAY_CONTINUE) {
@@ -988,7 +988,7 @@ static int pick_revisions(struct replay_opts *opts)
 		if (create_seq_dir() < 0) {
 			error(_("A cherry-pick or revert is in progress."));
 			advise(_("Use --continue to continue the operation"));
-			advise(_("or --reset to forget about it"));
+			advise(_("or --quit to forget about it"));
 			return -1;
 		}
 		if (get_sha1("HEAD", sha1)) {
diff --git a/sequencer.h b/sequencer.h
index 905d2950..f435fdb4 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -13,7 +13,7 @@
  *
  * With the aggressive flag, it additionally removes SEQ_OLD_DIR,
  * ignoring any errors.  Inteded to be used by the sequencer's
- * '--reset' subcommand.
+ * '--quit' subcommand.
  */
 void remove_sequencer_state(int aggressive);
 
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index 3bca2b3d..913435e2 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -13,7 +13,7 @@ test_description='Test cherry-pick continuation features
 . ./test-lib.sh
 
 pristine_detach () {
-	git cherry-pick --reset &&
+	git cherry-pick --quit &&
 	git checkout -f "$1^0" &&
 	git read-tree -u --reset HEAD &&
 	git clean -d -f -f -q -x
@@ -70,15 +70,15 @@ test_expect_success 'cherry-pick cleans up sequencer state upon success' '
 	test_path_is_missing .git/sequencer
 '
 
-test_expect_success '--reset does not complain when no cherry-pick is in progress' '
+test_expect_success '--quit does not complain when no cherry-pick is in progress' '
 	pristine_detach initial &&
-	git cherry-pick --reset
+	git cherry-pick --quit
 '
 
-test_expect_success '--reset cleans up sequencer state' '
+test_expect_success '--quit cleans up sequencer state' '
 	pristine_detach initial &&
 	test_must_fail git cherry-pick base..picked &&
-	git cherry-pick --reset &&
+	git cherry-pick --quit &&
 	test_path_is_missing .git/sequencer
 '
 
diff --git a/t/t7106-reset-sequence.sh b/t/t7106-reset-sequence.sh
index 4956caaf..3f86e8c5 100755
--- a/t/t7106-reset-sequence.sh
+++ b/t/t7106-reset-sequence.sh
@@ -12,7 +12,7 @@ test_description='Test interaction of reset --hard with sequencer
 . ./test-lib.sh
 
 pristine_detach () {
-	git cherry-pick --reset &&
+	git cherry-pick --quit &&
 	git checkout -f "$1^0" &&
 	git read-tree -u --reset HEAD &&
 	git clean -d -f -f -q -x
-- 
1.7.8.rc3

  reply	other threads:[~2011-11-20  9:48 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-20  7:30 cherry-pick/revert error messages Jonathan Nieder
2011-11-20  8:02 ` Ramkumar Ramachandra
2011-11-20  9:46   ` [RFC/PATCH 0/3] " Jonathan Nieder
2011-11-20  9:48     ` Jonathan Nieder [this message]
2011-11-21 20:36       ` [PATCH 1/3] revert: rename --reset option to --quit Junio C Hamano
2011-11-21 22:35         ` Jakub Narebski
2011-11-21 22:43           ` Jonathan Nieder
2011-11-20  9:50     ` [PATCH 2/3] revert: rearrange pick_revisions() for clarity Jonathan Nieder
2011-11-20  9:51     ` [PATCH 3/3] revert: improve error message for cherry-pick during cherry-pick Jonathan Nieder
2011-11-22 11:12     ` [PATCH v2 0/3] Re: cherry-pick/revert error messages Jonathan Nieder
2011-11-22 11:14       ` [PATCH 1/3] revert: rename --reset option to --quit Jonathan Nieder
2011-11-22 11:15       ` [PATCH 2/3] revert: rearrange pick_revisions() for clarity Jonathan Nieder
2011-11-22 11:15       ` [PATCH 3/3] revert: improve error message for cherry-pick during cherry-pick Jonathan Nieder
2011-11-22 11:17       ` [PATCH 4/3] revert: write REVERT_HEAD pseudoref during conflicted revert Jonathan Nieder
2011-11-22 21:40         ` Thiago Farina
2011-12-01  9:34         ` Ramkumar Ramachandra
2011-11-22 11:20       ` [PATCH 5/3] revert: introduce --abort to cancel a failed cherry-pick Jonathan Nieder
2011-11-23  0:43         ` Junio C Hamano
2011-11-23  1:27           ` Jonathan Nieder
2011-11-23  8:49             ` [PATCH] Fix revert --abort on Windows Johannes Sixt
2011-11-23 10:04               ` Jonathan Nieder
2011-11-23 10:21                 ` Johannes Sixt
2011-12-10 12:46                   ` [RFC/PATCH 0/7] some sequencer loose ends (Re: Fix revert --abort on Windows) Jonathan Nieder
2011-12-10 12:47                     ` [PATCH 1/7] revert: give --continue handling its own function Jonathan Nieder
2011-12-14 13:16                       ` Ramkumar Ramachandra
2011-12-10 12:49                     ` [PATCH 2/7] revert: allow cherry-pick --continue to commit before resuming Jonathan Nieder
2011-12-14 14:26                       ` Ramkumar Ramachandra
2011-12-14 16:48                         ` Jonathan Nieder
2011-12-10 12:58                     ` [PATCH 3/7] revert: pass around rev-list args in already-parsed form Jonathan Nieder
2011-12-14 14:51                       ` Ramkumar Ramachandra
2011-12-10 12:59                     ` [PATCH 4/7] revert: allow single-pick in the middle of cherry-pick sequence Jonathan Nieder
2011-12-14 15:48                       ` Ramkumar Ramachandra
2011-12-14 16:21                         ` Jonathan Nieder
2012-04-05 11:49                       ` Ævar Arnfjörð Bjarmason
2012-04-05 12:15                         ` Jonathan Nieder
2011-12-10 13:02                     ` [PATCH 5/7] revert: do not remove state until sequence is finished Jonathan Nieder
2011-12-14 16:02                       ` Ramkumar Ramachandra
2011-12-10 13:03                     ` [PATCH 6/7] Revert "reset: Make reset remove the sequencer state" Jonathan Nieder
2011-12-14 16:06                       ` Ramkumar Ramachandra
2011-12-10 13:06                     ` [PATCH 7/7] revert: stop creating and removing sequencer-old directory Jonathan Nieder
2011-12-14 16:10                       ` Ramkumar Ramachandra
2011-12-11 19:58                     ` [RFC/PATCH 0/7] some sequencer loose ends (Re: Fix revert --abort on Windows) Jonathan Nieder
2011-12-12  8:15                       ` Junio C Hamano
2011-12-12 21:31                     ` Junio C Hamano
2011-12-14  9:57                       ` Jonathan Nieder
2011-11-23 17:23               ` [PATCH] Fix revert --abort on Windows Alex Riesen
2011-11-30 22:52         ` [PATCH 5/3] revert: introduce --abort to cancel a failed cherry-pick Junio C Hamano
2011-11-22 11:20       ` [PATCH 6/3] revert: remove --reset compatibility option Jonathan Nieder
2011-11-22 21:49         ` Junio C Hamano
2011-11-22 23:11           ` Jonathan Nieder
2011-11-22 23:38             ` Junio C Hamano
2011-11-22 11:27       ` [PATCH v2 0/3] Re: cherry-pick/revert error messages Jonathan Nieder

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=20111120094824.GC2278@elie.hsd1.il.comcast.net \
    --to=jrnieder@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=martin.von.zweigbergk@gmail.com \
    --cc=phil.hord@gmail.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.
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).