From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael J Gruber Subject: [PATCH 6/6] git-reset.txt: make modes description more consistent Date: Mon, 13 Sep 2010 10:06:36 +0200 Message-ID: References: Cc: Junio C Hamano , Christian Couder To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Sep 13 10:16:32 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov4DG-0004Wz-HA for gcvg-git-2@lo.gmane.org; Mon, 13 Sep 2010 10:16:30 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754596Ab0IMIQY (ORCPT ); Mon, 13 Sep 2010 04:16:24 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:39155 "EHLO out2.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582Ab0IMIQV (ORCPT ); Mon, 13 Sep 2010 04:16:21 -0400 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id A1658E2; Mon, 13 Sep 2010 04:06:45 -0400 (EDT) Received: from frontend1.messagingengine.com ([10.202.2.160]) by compute3.internal (MEProxy); Mon, 13 Sep 2010 04:06:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; s=smtpout; bh=w1iVD87mTNpvUm15mll7PQtVmLI=; b=tqfvTSvN9FepL91EB/MnpbvjbqGF1G2uyE9e5x28K9F/A38ANIB9uAMcOa11OQpAL28S6TFjBmHwIOUIy2y2ttaGAujhf2P2vK0oiTlxb3E9D2jQl90NR9VgzAS7qOgyn39Mhe4ZvJWh9G7RMKfOrxJfvBFrvg/Rk7uvwWWCzcI= X-Sasl-enc: BDDBmSpLe6ye64mFFb8t31fzz3XOtsJGsNPIn89iUFDB 1284365205 Received: from localhost (heawood.math.tu-clausthal.de [139.174.44.4]) by mail.messagingengine.com (Postfix) with ESMTPSA id F354D4053A4; Mon, 13 Sep 2010 04:06:44 -0400 (EDT) X-Mailer: git-send-email 1.7.3.rc1.215.g6997c In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Currently, the structure of the individual mode entries is different which makes it difficult to grasp the differences between the modes. Also, the same items are named differently (e.g. , "the named commit", "the given commit", "the commit being switched to"). Structure and word all mode entries consistently. Signed-off-by: Michael J Gruber --- Documentation/git-reset.txt | 43 ++++++++++++++++++++++++++----------------- 1 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index 40e2fd8..6b60b59 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -15,13 +15,13 @@ SYNOPSIS DESCRIPTION ----------- In the first and second form, copy entries from to the index. -In the third form, set the current branch head to , optionally +In the third form, set the current branch head (HEAD) to , optionally modifying index and working tree to match. The defaults to HEAD in all forms. 'git reset' [-q] [] [--] ...:: This form resets the index entries for all to their - state at the . (It does not affect the working tree, nor + state at . (It does not affect the working tree, nor the current branch.) + This means that `git reset ` is the opposite of `git add @@ -39,9 +39,10 @@ This means that `git reset -p` is the opposite of `git add -p` (see linkgit:git-add[1]). 'git reset' [--] []:: - This form sets the current branch head to and then - updates index and working tree according to , which must - be one of the following: + This form sets the current branch head to and + possibly updates the index (resetting it to the tree of ) and + the working tree depending on , which + must be one of the following: + -- --soft:: @@ -57,22 +58,30 @@ linkgit:git-add[1]). been updated. This is the default action. --hard:: - Matches the working tree and index to that of the tree being - switched to. Any changes to tracked files in the working tree - since are lost. + Resets the index and working tree. Any changes to tracked files in the + working tree since are lost. --merge:: - Resets the index to match the tree recorded by the named commit, - and updates the files that are different between the named commit - and the current commit in the working tree. + Resets the index and updates the files in the working tree that are + different between and HEAD, but keeps those which are + different between the index and working tree (i.e. which have unstaged + changes). + If a file that is different between and the index has unstaged + changes, reset is aborted. ++ +In other words, --merge does something like a 'git read-tree -u -m ', +but carries forward unmerged index entries. --keep:: - Reset the index to the given commit, keeping local changes in - the working tree since the current commit, while updating - working tree files without local changes to what appears in - the given commit. If a file that is different between the - current commit and the given commit has local changes, reset - is aborted. + Resets the index, updates files in the working tree that are + different between and HEAD, but keeps those + which are different between HEAD and the working tree (i.e. + which have local changes). + If a file that is different between and HEAD has local changes, + reset is aborted. ++ +In other words, --keep does a 2-way merge between and HEAD followed by +'git reset --mixed '. -- If you want to undo a commit other than the latest on a branch, -- 1.7.3.rc1.215.g6997c