git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Joshua Jensen <jjensen@workspacewhiz.com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Thomas Rast <trast@student.ethz.ch>,
	Nicolas Sebrecht <nicolas.s.dev@gmx.fr>,
	git@vger.kernel.org, Kevin Ballard <kevin@sb.org>,
	Yann Dirson <dirson@bertin.fr>, Eric Raible <raible@nextest.com>
Subject: [PATCH] Documentation: do not treat reset --keep as a special case
Date: Fri, 21 Jan 2011 12:37:34 -0600	[thread overview]
Message-ID: <20110121183734.GB16325@burratino> (raw)
In-Reply-To: <4D39C923.20202@workspacewhiz.com>

The current treatment of "git reset --keep" emphasizes how it
differs from --hard (treatment of local changes) and how it breaks
down into plumbing (git read-tree -m -u HEAD <commit> followed by git
update-ref HEAD <commit>).  This can discourage people from using
it, since it might seem to be a complex or niche option.

Better to emphasize what the --keep flag is intended for --- moving
the index and worktree from one commit to another, like "git checkout"
would --- so the reader can make a more informed decision about the
appropriate situations in which to use it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Joshua Jensen wrote:

> I've always wished "git reset --hard" would tell me there are
> modified files and force me to type "git reset --hard --force" to
> overwrite them.  It is a dangerous command, and I stupidly run it
> sometimes without running "git status" first.

Have you tried "git reset --keep"?  How does it compare to your
wish?

 Documentation/git-reset.txt |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index fd72976..927ecee 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -76,15 +76,10 @@ In other words, --merge does something like a 'git read-tree -u -m <commit>',
 but carries forward unmerged index entries.
 
 --keep::
-	Resets the index, updates files in the working tree that are
-	different between <commit> and HEAD, but keeps those
-	which are different between HEAD and the working tree (i.e.
-	which have local changes).
+	Resets index entries and updates files in the working tree that are
+	different between <commit> and HEAD.
 	If a file that is different between <commit> and HEAD has local changes,
 	reset is aborted.
-+
-In other words, --keep does a 2-way merge between <commit> and HEAD followed by
-'git reset --mixed <commit>'.
 --
 
 If you want to undo a commit other than the latest on a branch,
-- 
1.7.4.rc2

  reply	other threads:[~2011-01-21 18:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 13:08 Black smoke from git rebase -i exec Ævar Arnfjörð Bjarmason
2010-08-10 13:37 ` Matthieu Moy
2010-08-10 13:57   ` Ævar Arnfjörð Bjarmason
2010-08-10 14:12     ` Johannes Sixt
2010-08-10 14:16       ` Ævar Arnfjörð Bjarmason
2010-08-10 15:05         ` Matthieu Moy
2010-08-10 15:17           ` [PATCH 1/2 (fix broken test)] rebase -i: add exec command to launch a shell command Matthieu Moy
2010-08-11 18:31             ` Junio C Hamano
2010-08-12  7:47               ` Matthieu Moy
2011-01-16  1:59             ` [PATCH 0/2] rebase -i: in-editor documentation nits Jonathan Nieder
2011-01-16  2:01               ` [PATCH 1/2] rebase -i: reword in-editor documentation of "exec" Jonathan Nieder
2011-01-16 10:27                 ` Matthieu Moy
2011-01-18 15:05                   ` Junio C Hamano
2011-01-20 20:09                   ` Jonathan Nieder
2011-01-20 20:59                     ` Junio C Hamano
2011-01-21  0:36                       ` [PATCH 1/2 v2] rebase -i: clarify " Jonathan Nieder
2011-01-21  6:59                         ` Matthieu Moy
2011-01-21  7:47                           ` Jonathan Nieder
2011-01-21 10:43                             ` Matthieu Moy
2011-01-16  2:02               ` [PATCH 2/2] rebase -i: explain how to discard all commits Jonathan Nieder
2011-01-20 19:39                 ` [PATCH 2/2] " Nicolas Sebrecht
2011-01-20 19:57                   ` Jonathan Nieder
2011-01-20 20:08                     ` Nicolas Sebrecht
2011-01-20 20:34                       ` Thomas Rast
2011-01-20 21:28                         ` Junio C Hamano
2011-01-21  7:04                           ` Johannes Schindelin
2011-01-21  7:37                             ` [PATCH] Documentation: suggest "reset --keep" to undo a commit Jonathan Nieder
2011-01-21 17:34                               ` Junio C Hamano
2011-01-21 19:14                                 ` Jonathan Nieder
2011-01-21 20:28                                   ` Junio C Hamano
2011-01-21 16:51                             ` [PATCH 2/2] Re: rebase -i: explain how to discard all commits Junio C Hamano
2011-01-21 17:05                               ` Matthieu Moy
2011-01-21 17:57                                 ` Joshua Jensen
2011-01-21 18:37                                   ` Jonathan Nieder [this message]
2011-01-21 20:35                                     ` [PATCH] Documentation: do not treat reset --keep as a special case Junio C Hamano
2011-01-26  7:33                                   ` [PATCH 2/2] Re: rebase -i: explain how to discard all commits Jay Soffian
2011-01-23 20:10                               ` Johannes Schindelin
2010-08-10 15:17           ` [PATCH 2/2] test-lib: user-friendly alternatives to test [-d|-f|-e] Matthieu Moy

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=20110121183734.GB16325@burratino \
    --to=jrnieder@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=dirson@bertin.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jjensen@workspacewhiz.com \
    --cc=kevin@sb.org \
    --cc=nicolas.s.dev@gmx.fr \
    --cc=raible@nextest.com \
    --cc=trast@student.ethz.ch \
    /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).