You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most interesting option is `format`, which allows you to specify your own log output format.
147
+
The most interesting option value is `format`, which allows you to specify your own log output format.
148
148
This is especially useful when you're generating output for machine parsing -- because you specify the format explicitly, you know it won't change with updates to Git:(((log formatting)))
149
149
150
150
[source,console]
@@ -155,36 +155,36 @@ ca82a6d - Scott Chacon, 6 years ago : Change version number
155
155
a11bef0 - Scott Chacon, 6 years ago : Initial commit
156
156
----
157
157
158
-
<<pretty_format>> lists some of the more useful options that `format` takes.
158
+
<<pretty_format>> lists some of the more useful specifiers that `format` takes.
159
159
160
160
[[pretty_format]]
161
-
.Useful options for `git log --pretty=format`
161
+
.Useful specifiers for `git log --pretty=format`
162
162
[cols="1,4",options="header"]
163
163
|================================
164
-
| Option | Description of Output
165
-
| `%H` | Commit hash
166
-
| `%h` | Abbreviated commit hash
167
-
| `%T` | Tree hash
168
-
| `%t` | Abbreviated tree hash
169
-
| `%P` | Parent hashes
170
-
| `%p` | Abbreviated parent hashes
171
-
| `%an` | Author name
172
-
| `%ae` | Author email
173
-
| `%ad` | Author date (format respects the --date=option)
174
-
| `%ar` | Author date, relative
175
-
| `%cn` | Committer name
176
-
| `%ce` | Committer email
177
-
| `%cd` | Committer date
178
-
| `%cr` | Committer date, relative
179
-
| `%s` | Subject
164
+
| Specifier | Description of Output
165
+
| `%H` | Commit hash
166
+
| `%h` | Abbreviated commit hash
167
+
| `%T` | Tree hash
168
+
| `%t` | Abbreviated tree hash
169
+
| `%P` | Parent hashes
170
+
| `%p` | Abbreviated parent hashes
171
+
| `%an` | Author name
172
+
| `%ae` | Author email
173
+
| `%ad` | Author date (format respects the --date=option)
174
+
| `%ar` | Author date, relative
175
+
| `%cn` | Committer name
176
+
| `%ce` | Committer email
177
+
| `%cd` | Committer date
178
+
| `%cr` | Committer date, relative
179
+
| `%s` | Subject
180
180
|================================
181
181
182
182
You may be wondering what the difference is between _author_ and _committer_.
183
183
The author is the person who originally wrote the work, whereas the committer is the person who last applied the work.
184
184
So, if you send in a patch to a project and one of the core members applies the patch, both of you get credit -- you as the author, and the core member as the committer.
185
185
We'll cover this distinction a bit more in <<ch05-distributed-git#ch05-distributed-git>>.
186
186
187
-
The `oneline` and `format` options are particularly useful with another `log` option called `--graph`.
187
+
The `oneline` and `format` option values are particularly useful with another `log` option called `--graph`.
188
188
This option adds a nice little ASCII graph showing your branch and merge history:
189
189
190
190
[source,console]
@@ -220,7 +220,7 @@ Those are only some simple output-formatting options to `git log` -- there are m
220
220
| `--abbrev-commit` | Show only the first few characters of the SHA-1 checksum instead of all 40.
221
221
| `--relative-date` | Display the date in a relative format (for example, ``2 weeks ago'') instead of using the full date format.
222
222
| `--graph` | Display an ASCII graph of the branch and merge history beside the log output.
223
-
| `--pretty` | Show commits in an alternate format. Options include oneline, short, full, fuller, and format (where you specify your own format).
223
+
| `--pretty` | Show commits in an alternate format. Option values include oneline, short, full, fuller, and format (where you specify your own format).
224
224
| `--oneline` | Shorthand for `--pretty=oneline --abbrev-commit` used together.
0 commit comments