Skip to content

Commit bc11bac

Browse files
phil-blaingitster
authored andcommitted
revisions.txt: use description list for special refs
The special refs listed in 'gitrevisions' (under the '<refname>' entry) are on separate lines in the Asciidoc source, but end up as a single continuous paragraph in the rendered documentation (see e.g. [1]). In following commits we will mention additional special refs, so to improve legibility, use a description list such that every entry appears on its own line. Since we are already in a description list, use ':::' as the term delimiter. In order for the new description list to be aligned with the description under the '<refname>' entry, instead of being aligned with the last entry of the "in the following rules" nested list, use the "ancestor list continuation" syntax [2], i.e., leave an empty line before the continuation '+'. Do the same for the paragraph following the new description list ("Note that any..."). While at it, also use a continuation '+' before the "in the following rules" list, for correctness. The parser seems not to care here, but it's best to keep the sources correct. [1] https://git-scm.com/docs/gitrevisions#Documentation/gitrevisions.txt-emltrefnamegtemegemmasterememheadsmasterememrefsheadsmasterem [2] https://docs.asciidoctor.org/asciidoc/latest/lists/continuation/#ancestor-list-continuation Suggested-by: Victoria Dye <[email protected]> Based-on-patch-by: Taylor Blau <[email protected]> Signed-off-by: Philippe Blain <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9e49351 commit bc11bac

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

Documentation/revisions.txt

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ characters and to avoid word splitting.
3030
explicitly say 'heads/master' to tell Git which one you mean.
3131
When ambiguous, a '<refname>' is disambiguated by taking the
3232
first match in the following rules:
33-
33+
+
3434
. If '$GIT_DIR/<refname>' exists, that is what you mean (this is usually
3535
useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`
3636
and `CHERRY_PICK_HEAD`);
@@ -44,19 +44,25 @@ characters and to avoid word splitting.
4444
. otherwise, 'refs/remotes/<refname>' if it exists;
4545

4646
. otherwise, 'refs/remotes/<refname>/HEAD' if it exists.
47+
4748
+
48-
`HEAD` names the commit on which you based the changes in the working tree.
49-
`FETCH_HEAD` records the branch which you fetched from a remote repository
50-
with your last `git fetch` invocation.
51-
`ORIG_HEAD` is created by commands that move your `HEAD` in a drastic
52-
way (`git am`, `git merge`, `git rebase`, `git reset`),
53-
to record the position of the `HEAD` before their operation, so that
54-
you can easily change the tip of the branch back to the state before you ran
55-
them.
56-
`MERGE_HEAD` records the commit(s) which you are merging into your branch
57-
when you run `git merge`.
58-
`CHERRY_PICK_HEAD` records the commit which you are cherry-picking
59-
when you run `git cherry-pick`.
49+
`HEAD`:::
50+
names the commit on which you based the changes in the working tree.
51+
`FETCH_HEAD`:::
52+
records the branch which you fetched from a remote repository with
53+
your last `git fetch` invocation.
54+
`ORIG_HEAD`:::
55+
is created by commands that move your `HEAD` in a drastic way (`git
56+
am`, `git merge`, `git rebase`, `git reset`), to record the position
57+
of the `HEAD` before their operation, so that you can easily change
58+
the tip of the branch back to the state before you ran them.
59+
`MERGE_HEAD`:::
60+
records the commit(s) which you are merging into your branch when you
61+
run `git merge`.
62+
`CHERRY_PICK_HEAD`:::
63+
records the commit which you are cherry-picking when you run `git
64+
cherry-pick`.
65+
6066
+
6167
Note that any of the 'refs/*' cases above may come either from
6268
the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.

0 commit comments

Comments
 (0)