git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Horn <max@quendi.de>
To: git@vger.kernel.org
Cc: Max Horn <max@quendi.de>
Subject: [PATCH 2/2] Document rev^! and rev^@ as revision specifiers
Date: Fri,  6 Jul 2012 02:01:30 +0200	[thread overview]
Message-ID: <1341532890-13829-2-git-send-email-max@quendi.de> (raw)
In-Reply-To: <1341532890-13829-1-git-send-email-max@quendi.de>

Previously, the rev^! and rev^@ syntax were only described in the
SPECIFYING RANGES section of revisions.txt, making it a bit harder to
find information about it. Moreover, that description was slightly
confusing as it described the technical definition of rev^! and rev^@
without making it completely clear what the end effect was.
This patch attempts to address this by adding dedicate entries
for rev^! and rev^@ in the SPECIFYING REVISIONS section, rewording
the existing explanation, and adding two select additional examples.

Finally, it also adds an example for the B..C range syntax, to
help illustrate how it differs from B...C.

Signed-off-by: Max Horn <max@quendi.de>
---
 Documentation/revisions.txt | 24 +++++++++++++++++++++---
 1 Datei geändert, 21 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)

diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index f4f6f28..2784298 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -128,6 +128,20 @@ the '$GIT_DIR/refs' directory or from the '$GIT_DIR/packed-refs' file.
   it returns the youngest matching commit which is reachable from
   the '<rev>' before '{caret}'.
 
+'<rev>{caret}@', e.g. 'HEAD{caret}@'::
+  A suffix '{caret}' followed by an at sign
+  means all parents of '<rev>'.
+  This is somewhat different from the other specifiers in this
+  section in that it may refer to multiple commits at once.
+  See also the next section on SPECIFYING RANGES.
+
+'<rev>{caret}!', e.g. 'HEAD{caret}!'::
+  A suffix '{caret}' followed by an exclamation mark
+  means commit '<rev>' but forces all of its parents to be excluded. For
+  commands that deal with a single revision, this is the same as '<rev>".
+  Hence it is primarily used with commands expecting commit ranges.
+  See also the next section on SPECIFYING RANGES.
+
 ':/<text>', e.g. ':/fix nasty bug'::
   A colon, followed by a slash, followed by a text, names
   a commit whose commit message matches the specified regular expression.
@@ -214,9 +228,10 @@ It is the set of commits that are reachable from either one of
 'r1' or 'r2' but not from both.
 
 Two other shorthands for naming a set that is formed by a commit
-and its parent commits exist.  The 'r1{caret}@' notation means all
-parents of 'r1'.  'r1{caret}!' includes commit 'r1' but excludes
-all of its parents.
+and its parent commits exist.  Recall that 'r1{caret}@' means all
+parents of 'r1'. When specifying ranges, this effectively includes
+all ancestors of 'r1' but excludes 'r1' itself. In contrast to this,
+'r1{caret}!' includes commit 'r1' but excludes all of its ancestors.
 
 Here are a handful of examples:
 
@@ -224,7 +239,10 @@ Here are a handful of examples:
    D F              G H I J D F
    ^G D             H D
    ^D B             E I J F B
+   B..C             C
    B...C            G H D E B C
    ^D B C           E I J F B C
+   C                I J F C
    C^@              I J F
+   C^!              C
    F^! D            G H D F
-- 
1.7.11.1.145.g4722b29.dirty

  reply	other threads:[~2012-07-06  0:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-05 16:45 [PATCH] Improve revisions.txt Max Horn
2012-07-05 18:06 ` Junio C Hamano
2012-07-06  0:01   ` [PATCH 1/2] Make <refname> documentation more consistent Max Horn
2012-07-06  0:01     ` Max Horn [this message]
2012-07-06  7:21       ` [PATCH 2/2] Document rev^! and rev^@ as revision specifiers Junio C Hamano
2012-07-06  9:00         ` Max Horn
2012-07-06 19:18           ` Junio C Hamano
2012-07-09 15:02             ` Max Horn
2012-07-23 19:27               ` Junio C Hamano

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341532890-13829-2-git-send-email-max@quendi.de \
    --to=max@quendi.de \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).