summaryrefslogtreecommitdiff
path: root/Documentation/revisions.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/revisions.txt')
-rw-r--r--Documentation/revisions.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index fe846f0..04fceee 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -25,7 +25,8 @@ blobs contained in a commit.
first match in the following rules:
. if `$GIT_DIR/<name>` exists, that is what you mean (this is usually
- useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD` and `MERGE_HEAD`);
+ useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`
+ and `CHERRY_PICK_HEAD`);
. otherwise, `refs/<name>` if exists;
@@ -46,6 +47,8 @@ you can change the tip of the branch back to the state before you ran
them easily.
MERGE_HEAD records the commit(s) you are merging into your branch
when you run 'git merge'.
+CHERRY_PICK_HEAD records the commit you are cherry-picking
+when you run 'git cherry-pick'.
+
Note that any of the `refs/*` cases above may come either from
the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
@@ -106,12 +109,20 @@ the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
and dereference the tag recursively until a non-tag object is
found.
+* A suffix '{caret}' to a revision parameter followed by a brace
+ pair that contains a text led by a slash (e.g. `HEAD^{/fix nasty bug}`):
+ this is the same as `:/fix nasty bug` syntax below except that
+ it returns the youngest matching commit which is reachable from
+ the ref before '{caret}'.
+
* A colon, followed by a slash, followed by a text (e.g. `:/fix nasty bug`): this names
- a commit whose commit message starts with the specified text.
+ a commit whose commit message matches the specified regular expression.
This name returns the youngest matching commit which is
reachable from any ref. If the commit message starts with a
'!', you have to repeat that; the special sequence ':/!',
followed by something else than '!' is reserved for now.
+ The regular expression can match any part of the commit message. To
+ match messages starting with a string, one can use e.g. `:/^foo`.
* A suffix ':' followed by a path (e.g. `HEAD:README`); this names the blob or tree
at the given path in the tree-ish object named by the part
@@ -119,6 +130,10 @@ the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
':path' (with an empty part before the colon, e.g. `:README`)
is a special case of the syntax described next: content
recorded in the index at the given path.
+ A path starting with './' or '../' is relative to current working directory.
+ The given path will be converted to be relative to working tree's root directory.
+ This is most useful to address a blob or tree from a commit or tree that has
+ the same tree structure with the working tree.
* A colon, optionally followed by a stage number (0 to 3) and a
colon, followed by a path (e.g. `:0:README`); this names a blob object in the