git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* documentation of git read-tree
@ 2010-03-13 22:32 Christian Halstrick
  2010-03-15 10:54 ` [PATCH 1/2] Documentation/git-read-tree: fix table layout Michael J Gruber
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Halstrick @ 2010-03-13 22:32 UTC (permalink / raw
  To: git

Hi,

the docu for "git read-tree" [1] talk about 21 "carry forward" rules.
In the tables describing the rules 4-21 the first column is named
"clean". But the text doesn't explain exactly what "clean" means. I
can guess, but does anybody know?

Ciao
  Chris

[1] http://www.kernel.org/pub/software/scm/git/docs/git-read-tree.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Documentation/git-read-tree: fix table layout
  2010-03-13 22:32 documentation of git read-tree Christian Halstrick
@ 2010-03-15 10:54 ` Michael J Gruber
  2010-03-15 10:54   ` [PATCH 2/2] Documentation/git-read-tree: clarify 2-tree merge Michael J Gruber
  0 siblings, 1 reply; 3+ messages in thread
From: Michael J Gruber @ 2010-03-15 10:54 UTC (permalink / raw
  To: git; +Cc: Christian Halstrick, Junio C Hamano

Asciidoc takes the first non-space character in the first line of the
paragraph as a reference point for preformatted layout, so adjust to
that to make the table align.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 Documentation/git-read-tree.txt |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 567671c..5aaf0d5 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -164,23 +164,23 @@ Here are the "carry forward" rules:
 
         I (index)           H        M        Result
        -------------------------------------------------------
-      0 nothing             nothing  nothing  (does not happen)
-      1 nothing             nothing  exists   use M
-      2 nothing             exists   nothing  remove path from index
-      3 nothing             exists   exists,  use M if "initial checkout"
+     0  nothing             nothing  nothing  (does not happen)
+     1  nothing             nothing  exists   use M
+     2  nothing             exists   nothing  remove path from index
+     3  nothing             exists   exists,  use M if "initial checkout"
 				     H == M   keep index otherwise
 				     exists   fail
 				     H != M
 
         clean I==H  I==M
        ------------------
-      4 yes   N/A   N/A     nothing  nothing  keep index
-      5 no    N/A   N/A     nothing  nothing  keep index
+     4  yes   N/A   N/A     nothing  nothing  keep index
+     5  no    N/A   N/A     nothing  nothing  keep index
 
-      6 yes   N/A   yes     nothing  exists   keep index
-      7 no    N/A   yes     nothing  exists   keep index
-      8 yes   N/A   no      nothing  exists   fail
-      9 no    N/A   no      nothing  exists   fail
+     6  yes   N/A   yes     nothing  exists   keep index
+     7  no    N/A   yes     nothing  exists   keep index
+     8  yes   N/A   no      nothing  exists   fail
+     9  no    N/A   no      nothing  exists   fail
 
      10 yes   yes   N/A     exists   nothing  remove path from index
      11 no    yes   N/A     exists   nothing  fail
-- 
1.7.0.1.300.gd855a

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Documentation/git-read-tree: clarify 2-tree merge
  2010-03-15 10:54 ` [PATCH 1/2] Documentation/git-read-tree: fix table layout Michael J Gruber
@ 2010-03-15 10:54   ` Michael J Gruber
  0 siblings, 0 replies; 3+ messages in thread
From: Michael J Gruber @ 2010-03-15 10:54 UTC (permalink / raw
  To: git; +Cc: Christian Halstrick, Junio C Hamano

Clarify the description of the 2-tree merge by defining the terms
which are used in the table, and by applying some small linguistic
changes.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 Documentation/git-read-tree.txt |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 5aaf0d5..88b20e3 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -130,7 +130,7 @@ Single Tree Merge
 ~~~~~~~~~~~~~~~~~
 If only 1 tree is specified, 'git read-tree' operates as if the user did not
 specify `-m`, except that if the original index has an entry for a
-given pathname, and the contents of the path matches with the tree
+given pathname, and the contents of the path match with the tree
 being read, the stat info from the index is used. (In other words, the
 index's stat()s take precedence over the merged tree's).
 
@@ -154,22 +154,24 @@ When two trees are specified, the user is telling 'git read-tree'
 the following:
 
      1. The current index and work tree is derived from $H, but
-        the user may have local changes in them since $H;
+        the user may have local changes in them since $H.
 
      2. The user wants to fast-forward to $M.
 
 In this case, the `git read-tree -m $H $M` command makes sure
 that no local change is lost as the result of this "merge".
-Here are the "carry forward" rules:
+Here are the "carry forward" rules, where "I" denotes the index,
+"clean" means that index and work tree coincide, and "exists"/"nothing"
+refer to the presence of a path in the specified commit:
 
-        I (index)           H        M        Result
+        I                   H        M        Result
        -------------------------------------------------------
      0  nothing             nothing  nothing  (does not happen)
      1  nothing             nothing  exists   use M
      2  nothing             exists   nothing  remove path from index
-     3  nothing             exists   exists,  use M if "initial checkout"
+     3  nothing             exists   exists,  use M if "initial checkout",
 				     H == M   keep index otherwise
-				     exists   fail
+				     exists,  fail
 				     H != M
 
         clean I==H  I==M
@@ -187,7 +189,7 @@ Here are the "carry forward" rules:
      12 yes   no    N/A     exists   nothing  fail
      13 no    no    N/A     exists   nothing  fail
 
-        clean (H=M)
+        clean (H==M)
        ------
      14 yes                 exists   exists   keep index
      15 no                  exists   exists   keep index
@@ -202,26 +204,26 @@ Here are the "carry forward" rules:
      21 no    yes   no      exists   exists   fail
 
 In all "keep index" cases, the index entry stays as in the
-original index file.  If the entry were not up to date,
+original index file.  If the entry is not up to date,
 'git read-tree' keeps the copy in the work tree intact when
 operating under the -u flag.
 
 When this form of 'git read-tree' returns successfully, you can
-see what "local changes" you made are carried forward by running
+see which of the "local changes" that you made were carried forward by running
 `git diff-index --cached $M`.  Note that this does not
-necessarily match `git diff-index --cached $H` would have
+necessarily match what `git diff-index --cached $H` would have
 produced before such a two tree merge.  This is because of cases
 18 and 19 --- if you already had the changes in $M (e.g. maybe
 you picked it up via e-mail in a patch form), `git diff-index
 --cached $H` would have told you about the change before this
 merge, but it would not show in `git diff-index --cached $M`
-output after two-tree merge.
+output after the two-tree merge.
 
-Case #3 is slightly tricky and needs explanation.  The result from this
+Case 3 is slightly tricky and needs explanation.  The result from this
 rule logically should be to remove the path if the user staged the removal
 of the path and then switching to a new branch.  That however will prevent
 the initial checkout from happening, so the rule is modified to use M (new
-tree) only when the contents of the index is empty.  Otherwise the removal
+tree) only when the content of the index is empty.  Otherwise the removal
 of the path is kept as long as $H and $M are the same.
 
 3-Way Merge
-- 
1.7.0.1.300.gd855a

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-15 10:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-13 22:32 documentation of git read-tree Christian Halstrick
2010-03-15 10:54 ` [PATCH 1/2] Documentation/git-read-tree: fix table layout Michael J Gruber
2010-03-15 10:54   ` [PATCH 2/2] Documentation/git-read-tree: clarify 2-tree merge Michael J Gruber

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).