Skip to content

Commit d38c7b2

Browse files
peffgitster
authored andcommitted
doc/pretty-formats: explain shortening of %gd
The actual shortening rules aren't that interesting and probably not worth getting into (I gloss over them here as "shortened for human readability"). But the fact that %gD shows whatever you gave on the command line is subtle and worth mentioning. Since most people will feed a shortened refname in the first place, it otherwise makes it hard to understand the difference between the two. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 522259d commit d38c7b2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Documentation/pretty-formats.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,12 @@ endif::git-rev-list[]
149149
- '%GK': show the key used to sign a signed commit
150150
- '%gD': reflog selector, e.g., `refs/stash@{1}` or
151151
`refs/stash@{2 minutes ago`}; the format follows the rules described
152-
for the `-g` option
153-
- '%gd': shortened reflog selector, e.g., `stash@{1}` or
154-
`stash@{2 minutes ago}`
152+
for the `-g` option. The portion before the `@` is the refname as
153+
given on the command line (so `git log -g refs/heads/master` would
154+
yield `refs/heads/master@{0}`).
155+
- '%gd': shortened reflog selector; same as `%gD`, but the refname
156+
portion is shortened for human readability (so `refs/heads/master`
157+
becomes just `master`).
155158
- '%gn': reflog identity name
156159
- '%gN': reflog identity name (respecting .mailmap, see
157160
linkgit:git-shortlog[1] or linkgit:git-blame[1])

0 commit comments

Comments
 (0)