Skip to content

Commit 5d1faf8

Browse files
Chris RiddochJunio C Hamano
authored andcommitted
Move --pretty options into Documentation/pretty-formats.txt
Asciidoc-include it into the manuals for programs that use the --pretty command-line option, for consistency among the docs. This describes all the pretty-formats currently listed in the cmit_fmt enum in commit.h, and also briefly describes the presence and format of the 'Merge: ' line in some pretty formats. There's a hedge that limiting your view of history can affect what goes in the Merge: line, and that --abbrev/--no-abbrev do nothing to the 'raw' format. Signed-off-by: Chris Riddoch <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5942706 commit 5d1faf8

File tree

5 files changed

+83
-15
lines changed

5 files changed

+83
-15
lines changed

Documentation/git-diff-tree.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ separated with a single space are given.
7373
This flag causes "git-diff-tree --stdin" to also show
7474
the commit message before the differences.
7575

76-
--pretty[=(raw|medium|short)]::
77-
This is used to control "pretty printing" format of the
78-
commit message. Without "=<style>", it defaults to
79-
medium.
76+
include::pretty-formats.txt[]
8077

8178
--no-commit-id::
8279
git-diff-tree outputs a line with the commit ID when

Documentation/git-log.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ This manual page describes only the most frequently used options.
2424

2525
OPTIONS
2626
-------
27-
--pretty=<format>::
28-
Controls the way the commit log is formatted.
27+
28+
include::pretty-formats.txt[]
2929

3030
--max-count=<n>::
3131
Limits the number of commits to show.

Documentation/git-rev-list.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ Using these options, gitlink:git-rev-list[1] will act similar to the
7979
more specialized family of commit log tools: gitlink:git-log[1],
8080
gitlink:git-show[1], and gitlink:git-whatchanged[1]
8181

82-
--pretty[='<format>']::
83-
84-
Pretty print the contents of the commit logs in a given format,
85-
where '<format>' can be one of 'raw', 'medium', 'short', 'full',
86-
and 'oneline'. When left out the format default to 'medium'.
82+
include::pretty-formats.txt[]
8783

8884
--relative-date::
8985

Documentation/git-show.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ OPTIONS
2626
<commitid>::
2727
ID of the commit to show.
2828

29-
--pretty=<format>::
30-
Controls the output format for the commit logs.
31-
<format> can be one of 'raw', 'medium', 'short', 'full',
32-
and 'oneline'.
29+
include::pretty-formats.txt[]
3330

3431
Author
3532
------

Documentation/pretty-formats.txt

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--pretty[='<format>']::
2+
3+
Pretty-prints the details of a commit. `--pretty`
4+
without an explicit `=<format>` defaults to 'medium'.
5+
If the commit is a merge, and if the pretty-format
6+
is not 'oneline', 'email' or 'raw', an additional line is
7+
inserted before the 'Author:' line. This line begins with
8+
"Merge: " and the sha1s of ancestral commits are printed,
9+
separated by spaces. Note that the listed commits may not
10+
necessarily be the list of the *direct* parent commits if you
11+
have limited your view of history: for example, if you are
12+
only interested in changes related to a certain directory or
13+
file. Here are some additional details for each format:
14+
15+
* 'oneline'
16+
17+
<sha1> <title line>
18+
+
19+
This is designed to be as compact as possible.
20+
21+
* 'short'
22+
23+
commit <sha1>
24+
Author: <author>
25+
26+
<title line>
27+
28+
* 'medium'
29+
30+
commit <sha1>
31+
Author: <author>
32+
Date: <date>
33+
34+
<title line>
35+
36+
<full commit message>
37+
38+
* 'full'
39+
40+
commit <sha1>
41+
Author: <author>
42+
Commit: <committer>
43+
44+
<title line>
45+
46+
<full commit message>
47+
48+
* 'fuller'
49+
50+
commit <sha1>
51+
Author: <author>
52+
AuthorDate: <date & time>
53+
Commit: <committer>
54+
CommitDate: <date & time>
55+
56+
<title line>
57+
58+
<full commit message>
59+
60+
61+
* 'email'
62+
63+
From <sha1> <date>
64+
From: <author>
65+
Date: <date & time>
66+
Subject: [PATCH] <title line>
67+
68+
full commit message>
69+
70+
71+
* 'raw'
72+
+
73+
The 'raw' format shows the entire commit exactly as
74+
stored in the commit object. Notably, the SHA1s are
75+
displayed in full, regardless of whether --abbrev or
76+
--no-abbrev are used, and 'parents' information show the
77+
true parent commits, without taking grafts nor history
78+
simplification into account.

0 commit comments

Comments
 (0)