git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] add--interactive: rename [r]evert command to [r]eset

From
MWMarc Weber <marco-oweber@gmx.de>
Date
Oct 6, 2008, 15:51 UTC
Message-ID
<20081006155141.GA28582@gmx.de>
In-Reply-To
<20081006145509.GD8203@spearce.org>
> This patch is mangled.  The context line immediately above is
Sorry, I thought set paste sets noexpandtab as well, I was wrong.

============= patch starting at commit message ======================= The term "revert" is used very confusingly here. In git, to "revert" is to take the changes made by a previous commit and un-apply them, creating a new commit. The act of changing what is in the index to match HEAD is called "reset".

Furthermore, incoming svn users will also find this confusing, since to them, "revert" means to reset the working tree, which corresponds to "checkout" in git.

Signed-off-by: Marc Weber <marco-oweber@gmx.de>
commit message rewritten by: Jeff King <peff@peff.net>
---
 git-add--interactive.perl |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index da768ee..5352d16 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -498,8 +498,8 @@ sub update_cmd {
 	print "\n";
 }
 
-sub revert_cmd {
-	my @update = list_and_choose({ PROMPT => 'Revert',
+sub reset_cmd {
+	my @update = list_and_choose({ PROMPT => 'Reset',
 				       HEADER => $status_head, },
 				     list_modified());
 	if (@update) {
@@ -527,7 +527,7 @@ sub revert_cmd {
 			}
 		}
 		refresh();
-		say_n_paths('reverted', @update);
+		say_n_paths('reset', @update);
 	}
 	print "\n";
 }
@@ -1046,7 +1046,7 @@ sub help_cmd {
 	print colored $help_color, <<\EOF ;
 status        - show paths with changes
 update        - add working tree state to the staged set of changes
-revert        - revert staged set of changes back to the HEAD version
+reset         - reset staged set of changes back to the HEAD version
 patch         - pick hunks and update selectively
 diff	      - view diff between HEAD and index
 add untracked - add contents of untracked files to the staged set of changes
@@ -1070,7 +1070,7 @@ sub process_args {
 sub main_loop {
 	my @cmd = ([ 'status', \&status_cmd, ],
 		   [ 'update', \&update_cmd, ],
-		   [ 'revert', \&revert_cmd, ],
+		   [ 'reset', \&reset_cmd, ],
 		   [ 'add untracked', \&add_untracked_cmd, ],
 		   [ 'patch', \&patch_update_cmd, ],
 		   [ 'diff', \&diff_cmd, ],
-- 
1.6.0.2.GIT
Previous: Shawn O. Pearce
Message 10 of 10 in “What about renaming ga -i [r]evert to [r]eset ?”
  1. Marc WeberOct 5, 2008
  2. Jeff KingOct 5, 2008
  3. renaming git add -i [r]evert -> reset and adding gitt add -i [c]heckoutMarc Weber, Oct 5, 2008
  4. Jeff KingOct 5, 2008
  5. 1/2 add--interactive: rename [r]evert command to [r]esetMarc Weber, Oct 6, 2008
  6. 2/2 add--interactive: added [c]heckoutMarc Weber, Oct 6, 2008
  7. Shawn O. PearceOct 6, 2008
  8. Marc WeberOct 6, 2008
  9. Shawn O. PearceOct 6, 2008
  10. Marc WeberOct 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.