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

[RFC PATCH 2/5] Documentation/reset: separate options by mode

From
Thomas Rast <trast@student.ethz.ch>
Date
Jul 16, 2010, 09:44 UTC
Message-ID
<0bfc95a7c144ccc811b58321a33caf89d20495e1.1279273256.git.trast@student.ethz.ch>
In-Reply-To
<cover.1279273256.git.trast@student.ethz.ch>

Remove all but -q from the OPTIONS section, and instead explain the options separated by usage mode, since they only apply to one each.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
fixup! Documentation/reset: separate options by mode
---
 Documentation/git-reset.txt |   58 +++++++++++++++++++++++-------------------
 1 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index dbb810d..46b2d2a 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -8,29 +8,38 @@ git-reset - Reset current HEAD to the specified state
 SYNOPSIS
 --------
 [verse]
-'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
 'git reset' [-q] [<commit>] [--] <paths>...
 'git reset' --patch [<commit>] [--] [<paths>...]
+'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
 
 DESCRIPTION
 -----------
-Sets the current head to the specified commit and optionally resets the
-index and working tree to match.
-
-This command is useful if you notice some small error in a recent
-commit (or set of commits) and want to redo that part without showing
-the undo in the history.
-
-If you want to undo a commit other than the latest on a branch,
-linkgit:git-revert[1] is your friend.
-
-The second and third forms with 'paths' and/or --patch are used to
-revert selected paths in the index from a given commit, without moving
-HEAD.
+Sets the current branch to the specified <commit> and optionally
+resets the index and working tree to match.  The <commit> defaults to
+HEAD in all forms.
+
+'git reset' [-q] [<commit>] [--] <paths>...::
+	This form resets the index entries for all <paths> to their
+	state at the <commit>.  (It does not affect the worktree, nor
+	the current branch.)
++
+This means that `git reset <paths>` is the opposite of `git add
+<paths>`, provided that the <paths> were already tracked.
 
+'git reset' --patch|-p [<commit>] [--] [<paths>...]::
+	Interactively select hunks in the difference between the index
+	and <commit> (defaults to HEAD).  The chosen hunks are applied
+	in reverse to the index.
++
+This means that `git reset -p` is the opposite of `git add -p` (see
+linkgit:git-add[1]).
 
-OPTIONS
--------
+'git reset' [--<mode>] [<commit>]::
+	This form points the current branch to <commit> and then
+	updates index and working tree according to <mode>, which must
+	be one of the following:
++
+--
 --soft::
 	Does not touch the index file nor the working tree at all, but
 	requires them to be in a good order. This leaves all your changed
@@ -59,22 +68,19 @@ OPTIONS
 	the given commit.  If a file that is different between the
 	current commit and the given commit has local changes, reset
 	is aborted.
+--
 
--p::
---patch::
-	Interactively select hunks in the difference between the index
-	and <commit> (defaults to HEAD).  The chosen hunks are applied
-	in reverse to the index.
-+
-This means that `git reset -p` is the opposite of `git add -p` (see
-linkgit:git-add[1]).
+If you want to undo a commit other than the latest on a branch,
+linkgit:git-revert[1] is your friend.
+
+
+OPTIONS
+-------
 
 -q::
 --quiet::
 	Be quiet, only report errors.
 
-<commit>::
-	Commit to make the current HEAD. If not given defaults to HEAD.
 
 DISCUSSION
 ----------
-- 
1.7.2.rc3.259.g43154
Previous: Thomas RastNext: Junio C Hamano
Message 3 of 14 in “git-reset documentation changes”
  1. 0/5 git-reset documentation changesThomas Rast, Jul 16, 2010
  2. 1/5 Documentation/git-reset: reorder modes for soft-mixed-hard progressionThomas Rast, Jul 16, 2010
  3. 2/5 Documentation/reset: separate options by modeThomas Rast, Jul 16, 2010
  4. Junio C HamanoJul 16, 2010
  5. 0/5 git-reset documentation changesThomas Rast, Jul 18, 2010
  6. 1/5 Documentation/git-reset: reorder modes for soft-mixed-hard progressionThomas Rast, Jul 18, 2010
  7. 2/5 Documentation/reset: separate options by modeThomas Rast, Jul 18, 2010
  8. 3/5 Documentation/reset: promote 'examples' one section upThomas Rast, Jul 18, 2010
  9. 4/5 Documentation/reset: reorder examples to match descriptionThomas Rast, Jul 18, 2010
  10. 5/5 Documentation/reset: move "undo permanently" example behind "make topic"Thomas Rast, Jul 18, 2010
  11. 3/5 Documentation/reset: promote 'examples' one section upThomas Rast, Jul 16, 2010
  12. 4/5 Documentation/reset: reorder examples to match descriptionThomas Rast, Jul 16, 2010
  13. 5/5 Documentation/reset: move "undo permanently" example behind "make topic"Thomas Rast, Jul 16, 2010
  14. Junio C HamanoJul 16, 2010

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.