diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-06-10 12:04:25 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-06-10 12:04:25 +0900 |
commit | b009fd41e8d66e6a1fb4e59f95ea48a18fc0194c (patch) | |
tree | de58994a784562a3a34d9972fa710c1d1aa1c869 | |
parent | Merge branch 'ah/doc-describe' (diff) | |
parent | revisions(7): clarify that most commands take a single revision range (diff) | |
download | tgif-b009fd41e8d66e6a1fb4e59f95ea48a18fc0194c.tar.xz |
Merge branch 'jc/clarify-revision-range'
Doc update.
* jc/clarify-revision-range:
revisions(7): clarify that most commands take a single revision range
-rw-r--r-- | Documentation/revisions.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt index d9169c062e..f5f17b65a1 100644 --- a/Documentation/revisions.txt +++ b/Documentation/revisions.txt @@ -260,6 +260,9 @@ any of the given commits. A commit's reachable set is the commit itself and the commits in its ancestry chain. +There are several notations to specify a set of connected commits +(called a "revision range"), illustrated below. + Commit Exclusions ~~~~~~~~~~~~~~~~~ @@ -294,6 +297,26 @@ is a shorthand for 'HEAD..origin' and asks "What did the origin do since I forked from them?" Note that '..' would mean 'HEAD..HEAD' which is an empty range that is both reachable and unreachable from HEAD. +Commands that are specifically designed to take two distinct ranges +(e.g. "git range-diff R1 R2" to compare two ranges) do exist, but +they are exceptions. Unless otherwise noted, all "git" commands +that operate on a set of commits work on a single revision range. +In other words, writing two "two-dot range notation" next to each +other, e.g. + + $ git log A..B C..D + +does *not* specify two revision ranges for most commands. Instead +it will name a single connected set of commits, i.e. those that are +reachable from either B or D but are reachable from neither A or C. +In a linear history like this: + + ---A---B---o---o---C---D + +because A and B are reachable from C, the revision range specified +by these two dotted ranges is a single commit D. + + Other <rev>{caret} Parent Shorthand Notations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Three other shorthands exist, particularly useful for merge commits, |