logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-log.1 (132337B)


  1. '\" t
  2. .\" Title: git-log
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-LOG" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-log \- Show commit logs
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit log\fR [<options>] [<revision\-range>] [[\-\-] <path>\&...\:]
  36. .fi
  37. .SH "DESCRIPTION"
  38. .sp
  39. Shows the commit logs\&.
  40. .sp
  41. List commits that are reachable by following the \fBparent\fR links from the given commit(s), but exclude commits that are reachable from the one(s) given with a \fI^\fR in front of them\&. The output is given in reverse chronological order by default\&.
  42. .sp
  43. You can think of this as a set operation\&. Commits reachable from any of the commits given on the command line form a set, and then commits reachable from any of the ones given with \fI^\fR in front are subtracted from that set\&. The remaining commits are what comes out in the command\(cqs output\&. Various other options and paths parameters can be used to further limit the result\&.
  44. .sp
  45. Thus, the following command:
  46. .sp
  47. .if n \{\
  48. .RS 4
  49. .\}
  50. .nf
  51. $ git log foo bar ^baz
  52. .fi
  53. .if n \{\
  54. .RE
  55. .\}
  56. .sp
  57. means "list all the commits which are reachable from \fIfoo\fR or \fIbar\fR, but not from \fIbaz\fR"\&.
  58. .sp
  59. A special notation "\fI<commit1>\fR\&.\&.\fI<commit2>\fR" can be used as a short\-hand for "^\fI<commit1>\fR \fI<commit2>\fR"\&. For example, either of the following may be used interchangeably:
  60. .sp
  61. .if n \{\
  62. .RS 4
  63. .\}
  64. .nf
  65. $ git log origin\&.\&.HEAD
  66. $ git log HEAD ^origin
  67. .fi
  68. .if n \{\
  69. .RE
  70. .\}
  71. .sp
  72. Another special notation is "\fI<commit1>\fR\&...\:\fI<commit2>\fR" which is useful for merges\&. The resulting set of commits is the symmetric difference between the two operands\&. The following two commands are equivalent:
  73. .sp
  74. .if n \{\
  75. .RS 4
  76. .\}
  77. .nf
  78. $ git log A B \-\-not $(git merge\-base \-\-all A B)
  79. $ git log A\&.\&.\&.B
  80. .fi
  81. .if n \{\
  82. .RE
  83. .\}
  84. .sp
  85. The command takes options applicable to the \fBgit-rev-list\fR(1) command to control what is shown and how, and options applicable to the \fBgit-diff\fR(1) command to control how the changes each commit introduces are shown\&.
  86. .SH "OPTIONS"
  87. .PP
  88. \-\-follow
  89. .RS 4
  90. Continue listing the history of a file beyond renames (works only for a single file)\&.
  91. .RE
  92. .PP
  93. \-\-no\-decorate, \-\-decorate[=short|full|auto|no]
  94. .RS 4
  95. Print out the ref names of any commits that are shown\&. If
  96. \fIshort\fR
  97. is specified, the ref name prefixes
  98. \fIrefs/heads/\fR,
  99. \fIrefs/tags/\fR
  100. and
  101. \fIrefs/remotes/\fR
  102. will not be printed\&. If
  103. \fIfull\fR
  104. is specified, the full ref name (including prefix) will be printed\&. If
  105. \fIauto\fR
  106. is specified, then if the output is going to a terminal, the ref names are shown as if
  107. \fIshort\fR
  108. were given, otherwise no ref names are shown\&. The option
  109. \fB\-\-decorate\fR
  110. is short\-hand for
  111. \fB\-\-decorate=short\fR\&. Default to configuration value of
  112. \fBlog\&.decorate\fR
  113. if configured, otherwise,
  114. \fBauto\fR\&.
  115. .RE
  116. .PP
  117. \-\-decorate\-refs=<pattern>, \-\-decorate\-refs\-exclude=<pattern>
  118. .RS 4
  119. For each candidate reference, do not use it for decoration if it matches any patterns given to
  120. \fB\-\-decorate\-refs\-exclude\fR
  121. or if it doesn\(cqt match any of the patterns given to
  122. \fB\-\-decorate\-refs\fR\&. The
  123. \fBlog\&.excludeDecoration\fR
  124. config option allows excluding refs from the decorations, but an explicit
  125. \fB\-\-decorate\-refs\fR
  126. pattern will override a match in
  127. \fBlog\&.excludeDecoration\fR\&.
  128. .sp
  129. If none of these options or config settings are given, then references are used as decoration if they match
  130. \fBHEAD\fR,
  131. \fBrefs/heads/\fR,
  132. \fBrefs/remotes/\fR,
  133. \fBrefs/stash/\fR, or
  134. \fBrefs/tags/\fR\&.
  135. .RE
  136. .PP
  137. \-\-clear\-decorations
  138. .RS 4
  139. When specified, this option clears all previous
  140. \fB\-\-decorate\-refs\fR
  141. or
  142. \fB\-\-decorate\-refs\-exclude\fR
  143. options and relaxes the default decoration filter to include all references\&. This option is assumed if the config value
  144. \fBlog\&.initialDecorationSet\fR
  145. is set to
  146. \fBall\fR\&.
  147. .RE
  148. .PP
  149. \-\-source
  150. .RS 4
  151. Print out the ref name given on the command line by which each commit was reached\&.
  152. .RE
  153. .PP
  154. \-\-[no\-]mailmap, \-\-[no\-]use\-mailmap
  155. .RS 4
  156. Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses\&. See
  157. \fBgit-shortlog\fR(1)\&.
  158. .RE
  159. .PP
  160. \-\-full\-diff
  161. .RS 4
  162. Without this flag,
  163. \fBgit\fR
  164. \fBlog\fR
  165. \fB\-p\fR
  166. \fI<path>\fR\&.\&.\&. shows commits that touch the specified paths, and diffs about the same specified paths\&. With this, the full diff is shown for commits that touch the specified paths; this means that "<path>\&...\:" limits only commits, and doesn\(cqt limit diff for those commits\&.
  167. .sp
  168. Note that this affects all diff\-based output types, e\&.g\&. those produced by
  169. \fB\-\-stat\fR, etc\&.
  170. .RE
  171. .PP
  172. \-\-log\-size
  173. .RS 4
  174. Include a line
  175. \(lqlog size <number>\(rq
  176. in the output for each commit, where <number> is the length of that commit\(cqs message in bytes\&. Intended to speed up tools that read log messages from
  177. \fBgit\fR
  178. \fBlog\fR
  179. output by allowing them to allocate space in advance\&.
  180. .RE
  181. .PP
  182. \-L<start>,<end>:<file>, \-L:<funcname>:<file>
  183. .RS 4
  184. Trace the evolution of the line range given by
  185. \fI<start>,<end>\fR, or by the function name regex
  186. \fI<funcname>\fR, within the
  187. \fI<file>\fR\&. You may not give any pathspec limiters\&. This is currently limited to a walk starting from a single revision, i\&.e\&., you may only give zero or one positive revision arguments, and
  188. \fI<start>\fR
  189. and
  190. \fI<end>\fR
  191. (or
  192. \fI<funcname>\fR) must exist in the starting revision\&. You can specify this option more than once\&. Implies
  193. \fB\-\-patch\fR\&. Patch output can be suppressed using
  194. \fB\-\-no\-patch\fR, but other diff formats (namely
  195. \fB\-\-raw\fR,
  196. \fB\-\-numstat\fR,
  197. \fB\-\-shortstat\fR,
  198. \fB\-\-dirstat\fR,
  199. \fB\-\-summary\fR,
  200. \fB\-\-name\-only\fR,
  201. \fB\-\-name\-status\fR,
  202. \fB\-\-check\fR) are not currently implemented\&.
  203. .sp
  204. \fI<start>\fR
  205. and
  206. \fI<end>\fR
  207. can take one of these forms:
  208. .sp
  209. .RS 4
  210. .ie n \{\
  211. \h'-04'\(bu\h'+03'\c
  212. .\}
  213. .el \{\
  214. .sp -1
  215. .IP \(bu 2.3
  216. .\}
  217. number
  218. .sp
  219. If
  220. \fI<start>\fR
  221. or
  222. \fI<end>\fR
  223. is a number, it specifies an absolute line number (lines count from 1)\&.
  224. .RE
  225. .sp
  226. .RS 4
  227. .ie n \{\
  228. \h'-04'\(bu\h'+03'\c
  229. .\}
  230. .el \{\
  231. .sp -1
  232. .IP \(bu 2.3
  233. .\}
  234. \fB/regex/\fR
  235. .sp
  236. This form will use the first line matching the given POSIX regex\&. If
  237. \fI<start>\fR
  238. is a regex, it will search from the end of the previous
  239. \fB\-L\fR
  240. range, if any, otherwise from the start of file\&. If
  241. \fI<start>\fR
  242. is
  243. \fB^/regex/\fR, it will search from the start of file\&. If
  244. \fI<end>\fR
  245. is a regex, it will search starting at the line given by
  246. \fI<start>\fR\&.
  247. .RE
  248. .sp
  249. .RS 4
  250. .ie n \{\
  251. \h'-04'\(bu\h'+03'\c
  252. .\}
  253. .el \{\
  254. .sp -1
  255. .IP \(bu 2.3
  256. .\}
  257. +offset or \-offset
  258. .sp
  259. This is only valid for
  260. \fI<end>\fR
  261. and will specify a number of lines before or after the line given by
  262. \fI<start>\fR\&.
  263. .RE
  264. .sp
  265. If
  266. \fB:\fR\fI<funcname>\fR
  267. is given in place of
  268. \fI<start>\fR
  269. and
  270. \fI<end>\fR, it is a regular expression that denotes the range from the first funcname line that matches
  271. \fI<funcname>\fR, up to the next funcname line\&.
  272. \fB:\fR\fI<funcname>\fR
  273. searches from the end of the previous
  274. \fB\-L\fR
  275. range, if any, otherwise from the start of file\&.
  276. \fB^:\fR\fI<funcname>\fR
  277. searches from the start of file\&. The function names are determined in the same way as
  278. \fBgit\fR
  279. \fBdiff\fR
  280. works out patch hunk headers (see
  281. \fIDefining a custom hunk\-header\fR
  282. in
  283. \fBgitattributes\fR(5))\&.
  284. .RE
  285. .PP
  286. <revision\-range>
  287. .RS 4
  288. Show only commits in the specified revision range\&. When no <revision\-range> is specified, it defaults to
  289. \fBHEAD\fR
  290. (i\&.e\&. the whole history leading to the current commit)\&.
  291. \fBorigin\fR\fB\&.\&.\fR\fBHEAD\fR
  292. specifies all the commits reachable from the current commit (i\&.e\&.
  293. \fBHEAD\fR), but not from
  294. \fBorigin\fR\&. For a complete list of ways to spell <revision\-range>, see the
  295. \fISpecifying Ranges\fR
  296. section of
  297. \fBgitrevisions\fR(7)\&.
  298. .RE
  299. .PP
  300. [\-\-] <path>\&...\:
  301. .RS 4
  302. Show only commits that are enough to explain how the files that match the specified paths came to be\&. See
  303. \fIHistory Simplification\fR
  304. below for details and other simplification modes\&.
  305. .sp
  306. Paths may need to be prefixed with
  307. \fB\-\-\fR
  308. to separate them from options or the revision range, when confusion arises\&.
  309. .RE
  310. .SS "Commit Limiting"
  311. .sp
  312. Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
  313. .sp
  314. Using more options generally further limits the output (e\&.g\&. \fB\-\-since=\fR\fI<date1>\fR limits to commits newer than \fI<date1>\fR, and using it with \fB\-\-grep=\fR\fI<pattern>\fR further limits to commits whose log message has a line that matches \fI<pattern>\fR), unless otherwise noted\&.
  315. .sp
  316. Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
  317. .PP
  318. \-<number>, \-n <number>, \-\-max\-count=<number>
  319. .RS 4
  320. Limit the number of commits to output\&.
  321. .RE
  322. .PP
  323. \-\-skip=<number>
  324. .RS 4
  325. Skip
  326. \fInumber\fR
  327. commits before starting to show the commit output\&.
  328. .RE
  329. .PP
  330. \-\-since=<date>, \-\-after=<date>
  331. .RS 4
  332. Show commits more recent than a specific date\&.
  333. .RE
  334. .PP
  335. \-\-since\-as\-filter=<date>
  336. .RS 4
  337. Show all commits more recent than a specific date\&. This visits all commits in the range, rather than stopping at the first commit which is older than a specific date\&.
  338. .RE
  339. .PP
  340. \-\-until=<date>, \-\-before=<date>
  341. .RS 4
  342. Show commits older than a specific date\&.
  343. .RE
  344. .PP
  345. \-\-author=<pattern>, \-\-committer=<pattern>
  346. .RS 4
  347. Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
  348. \fB\-\-author=\fR\fI<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
  349. \fB\-\-committer=\fR\fI<pattern>\fR)\&.
  350. .RE
  351. .PP
  352. \-\-grep\-reflog=<pattern>
  353. .RS 4
  354. Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
  355. \fB\-\-grep\-reflog\fR, commits whose reflog message matches any of the given patterns are chosen\&. It is an error to use this option unless
  356. \fB\-\-walk\-reflogs\fR
  357. is in use\&.
  358. .RE
  359. .PP
  360. \-\-grep=<pattern>
  361. .RS 4
  362. Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
  363. \fB\-\-grep=\fR\fI<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
  364. \fB\-\-all\-match\fR)\&.
  365. .sp
  366. When
  367. \fB\-\-notes\fR
  368. is in effect, the message from the notes is matched as if it were part of the log message\&.
  369. .RE
  370. .PP
  371. \-\-all\-match
  372. .RS 4
  373. Limit the commits output to ones that match all given
  374. \fB\-\-grep\fR, instead of ones that match at least one\&.
  375. .RE
  376. .PP
  377. \-\-invert\-grep
  378. .RS 4
  379. Limit the commits output to ones with a log message that do not match the pattern specified with
  380. \fB\-\-grep=\fR\fI<pattern>\fR\&.
  381. .RE
  382. .PP
  383. \-i, \-\-regexp\-ignore\-case
  384. .RS 4
  385. Match the regular expression limiting patterns without regard to letter case\&.
  386. .RE
  387. .PP
  388. \-\-basic\-regexp
  389. .RS 4
  390. Consider the limiting patterns to be basic regular expressions; this is the default\&.
  391. .RE
  392. .PP
  393. \-E, \-\-extended\-regexp
  394. .RS 4
  395. Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
  396. .RE
  397. .PP
  398. \-F, \-\-fixed\-strings
  399. .RS 4
  400. Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
  401. .RE
  402. .PP
  403. \-P, \-\-perl\-regexp
  404. .RS 4
  405. Consider the limiting patterns to be Perl\-compatible regular expressions\&.
  406. .sp
  407. Support for these types of regular expressions is an optional compile\-time dependency\&. If Git wasn\(cqt compiled with support for them providing this option will cause it to die\&.
  408. .RE
  409. .PP
  410. \-\-remove\-empty
  411. .RS 4
  412. Stop when a given path disappears from the tree\&.
  413. .RE
  414. .PP
  415. \-\-merges
  416. .RS 4
  417. Print only merge commits\&. This is exactly the same as
  418. \fB\-\-min\-parents=2\fR\&.
  419. .RE
  420. .PP
  421. \-\-no\-merges
  422. .RS 4
  423. Do not print commits with more than one parent\&. This is exactly the same as
  424. \fB\-\-max\-parents=1\fR\&.
  425. .RE
  426. .PP
  427. \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
  428. .RS 4
  429. Show only commits which have at least (or at most) that many parent commits\&. In particular,
  430. \fB\-\-max\-parents=1\fR
  431. is the same as
  432. \fB\-\-no\-merges\fR,
  433. \fB\-\-min\-parents=2\fR
  434. is the same as
  435. \fB\-\-merges\fR\&.
  436. \fB\-\-max\-parents=0\fR
  437. gives all root commits and
  438. \fB\-\-min\-parents=3\fR
  439. all octopus merges\&.
  440. .sp
  441. \fB\-\-no\-min\-parents\fR
  442. and
  443. \fB\-\-no\-max\-parents\fR
  444. reset these limits (to no limit) again\&. Equivalent forms are
  445. \fB\-\-min\-parents=0\fR
  446. (any commit has 0 or more parents) and
  447. \fB\-\-max\-parents=\-1\fR
  448. (negative numbers denote no upper limit)\&.
  449. .RE
  450. .PP
  451. \-\-first\-parent
  452. .RS 4
  453. When finding commits to include, follow only the first parent commit upon seeing a merge commit\&. This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge\&.
  454. .sp
  455. This option also changes default diff format for merge commits to
  456. \fBfirst\-parent\fR, see
  457. \fB\-\-diff\-merges=first\-parent\fR
  458. for details\&.
  459. .RE
  460. .PP
  461. \-\-exclude\-first\-parent\-only
  462. .RS 4
  463. When finding commits to exclude (with a
  464. \fI^\fR), follow only the first parent commit upon seeing a merge commit\&. This can be used to find the set of changes in a topic branch from the point where it diverged from the remote branch, given that arbitrary merges can be valid topic branch changes\&.
  465. .RE
  466. .PP
  467. \-\-not
  468. .RS 4
  469. Reverses the meaning of the
  470. \fI^\fR
  471. prefix (or lack thereof) for all following revision specifiers, up to the next
  472. \fB\-\-not\fR\&. When used on the command line before \-\-stdin, the revisions passed through stdin will not be affected by it\&. Conversely, when passed via standard input, the revisions passed on the command line will not be affected by it\&.
  473. .RE
  474. .PP
  475. \-\-all
  476. .RS 4
  477. Pretend as if all the refs in
  478. \fBrefs/\fR, along with
  479. \fBHEAD\fR, are listed on the command line as
  480. \fI<commit>\fR\&.
  481. .RE
  482. .PP
  483. \-\-branches[=<pattern>]
  484. .RS 4
  485. Pretend as if all the refs in
  486. \fBrefs/heads\fR
  487. are listed on the command line as
  488. \fI<commit>\fR\&. If
  489. \fI<pattern>\fR
  490. is given, limit branches to ones matching given shell glob\&. If pattern lacks
  491. \fI?\fR,
  492. \fI*\fR, or
  493. \fI[\fR,
  494. \fI/*\fR
  495. at the end is implied\&.
  496. .RE
  497. .PP
  498. \-\-tags[=<pattern>]
  499. .RS 4
  500. Pretend as if all the refs in
  501. \fBrefs/tags\fR
  502. are listed on the command line as
  503. \fI<commit>\fR\&. If
  504. \fI<pattern>\fR
  505. is given, limit tags to ones matching given shell glob\&. If pattern lacks
  506. \fI?\fR,
  507. \fI*\fR, or
  508. \fI[\fR,
  509. \fI/*\fR
  510. at the end is implied\&.
  511. .RE
  512. .PP
  513. \-\-remotes[=<pattern>]
  514. .RS 4
  515. Pretend as if all the refs in
  516. \fBrefs/remotes\fR
  517. are listed on the command line as
  518. \fI<commit>\fR\&. If
  519. \fI<pattern>\fR
  520. is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
  521. \fI?\fR,
  522. \fI*\fR, or
  523. \fI[\fR,
  524. \fI/*\fR
  525. at the end is implied\&.
  526. .RE
  527. .PP
  528. \-\-glob=<glob\-pattern>
  529. .RS 4
  530. Pretend as if all the refs matching shell glob
  531. \fI<glob\-pattern>\fR
  532. are listed on the command line as
  533. \fI<commit>\fR\&. Leading
  534. \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
  535. \fI?\fR,
  536. \fI*\fR, or
  537. \fI[\fR,
  538. \fI/*\fR
  539. at the end is implied\&.
  540. .RE
  541. .PP
  542. \-\-exclude=<glob\-pattern>
  543. .RS 4
  544. Do not include refs matching
  545. \fI<glob\-pattern>\fR
  546. that the next
  547. \fB\-\-all\fR,
  548. \fB\-\-branches\fR,
  549. \fB\-\-tags\fR,
  550. \fB\-\-remotes\fR, or
  551. \fB\-\-glob\fR
  552. would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
  553. \fB\-\-all\fR,
  554. \fB\-\-branches\fR,
  555. \fB\-\-tags\fR,
  556. \fB\-\-remotes\fR, or
  557. \fB\-\-glob\fR
  558. option (other options or arguments do not clear accumulated patterns)\&.
  559. .sp
  560. The patterns given should not begin with
  561. \fBrefs/heads\fR,
  562. \fBrefs/tags\fR, or
  563. \fBrefs/remotes\fR
  564. when applied to
  565. \fB\-\-branches\fR,
  566. \fB\-\-tags\fR, or
  567. \fB\-\-remotes\fR, respectively, and they must begin with
  568. \fBrefs/\fR
  569. when applied to
  570. \fB\-\-glob\fR
  571. or
  572. \fB\-\-all\fR\&. If a trailing
  573. \fI/*\fR
  574. is intended, it must be given explicitly\&.
  575. .RE
  576. .PP
  577. \-\-exclude\-hidden=[fetch|receive|uploadpack]
  578. .RS 4
  579. Do not include refs that would be hidden by
  580. \fBgit\-fetch\fR,
  581. \fBgit\-receive\-pack\fR
  582. or
  583. \fBgit\-upload\-pack\fR
  584. by consulting the appropriate
  585. \fBfetch\&.hideRefs\fR,
  586. \fBreceive\&.hideRefs\fR
  587. or
  588. \fBuploadpack\&.hideRefs\fR
  589. configuration along with
  590. \fBtransfer\&.hideRefs\fR
  591. (see
  592. \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
  593. \fB\-\-all\fR
  594. or
  595. \fB\-\-glob\fR
  596. and is cleared after processing them\&.
  597. .RE
  598. .PP
  599. \-\-reflog
  600. .RS 4
  601. Pretend as if all objects mentioned by reflogs are listed on the command line as
  602. \fI<commit>\fR\&.
  603. .RE
  604. .PP
  605. \-\-alternate\-refs
  606. .RS 4
  607. Pretend as if all objects mentioned as ref tips of alternate repositories were listed on the command line\&. An alternate repository is any repository whose object directory is specified in
  608. \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
  609. \fBcore\&.alternateRefsCommand\fR, etc\&. See
  610. \fBgit-config\fR(1)\&.
  611. .RE
  612. .PP
  613. \-\-single\-worktree
  614. .RS 4
  615. By default, all working trees will be examined by the following options when there are more than one (see
  616. \fBgit-worktree\fR(1)):
  617. \fB\-\-all\fR,
  618. \fB\-\-reflog\fR
  619. and
  620. \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
  621. .RE
  622. .PP
  623. \-\-ignore\-missing
  624. .RS 4
  625. Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
  626. .RE
  627. .PP
  628. \-\-bisect
  629. .RS 4
  630. Pretend as if the bad bisection ref
  631. \fBrefs/bisect/bad\fR
  632. was listed and as if it was followed by
  633. \fB\-\-not\fR
  634. and the good bisection refs
  635. \fBrefs/bisect/good\-\fR* on the command line\&.
  636. .RE
  637. .PP
  638. \-\-stdin
  639. .RS 4
  640. In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
  641. \fB\-\-all\fR
  642. and
  643. \fB\-\-glob=\fR\&. When a
  644. \fB\-\-\fR
  645. separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
  646. \fB\-\-not\fR
  647. which are read via standard input are only respected for arguments passed in the same way and will not influence any subsequent command line arguments\&.
  648. .RE
  649. .PP
  650. \-\-cherry\-mark
  651. .RS 4
  652. Like
  653. \fB\-\-cherry\-pick\fR
  654. (see below) but mark equivalent commits with
  655. \fB=\fR
  656. rather than omitting them, and inequivalent ones with
  657. \fB+\fR\&.
  658. .RE
  659. .PP
  660. \-\-cherry\-pick
  661. .RS 4
  662. Omit any commit that introduces the same change as another commit on the
  663. \(lqother side\(rq
  664. when the set of commits are limited with symmetric difference\&.
  665. .sp
  666. For example, if you have two branches,
  667. \fBA\fR
  668. and
  669. \fBB\fR, a usual way to list all commits on only one side of them is with
  670. \fB\-\-left\-right\fR
  671. (see the example below in the description of the
  672. \fB\-\-left\-right\fR
  673. option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
  674. \(lq3rd on b\(rq
  675. may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
  676. .RE
  677. .PP
  678. \-\-left\-only, \-\-right\-only
  679. .RS 4
  680. List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked < resp\&. > by
  681. \fB\-\-left\-right\fR\&.
  682. .sp
  683. For example,
  684. \fB\-\-cherry\-pick\fR
  685. \fB\-\-right\-only\fR
  686. \fBA\fR\fB\&.\&.\&.\fR\fBB\fR
  687. omits those commits from
  688. \fBB\fR
  689. which are in
  690. \fBA\fR
  691. or are patch\-equivalent to a commit in
  692. \fBA\fR\&. In other words, this lists the
  693. \fB+\fR
  694. commits from
  695. \fBgit\fR
  696. \fBcherry\fR
  697. \fBA\fR
  698. \fBB\fR\&. More precisely,
  699. \fB\-\-cherry\-pick\fR
  700. \fB\-\-right\-only\fR
  701. \fB\-\-no\-merges\fR
  702. gives the exact list\&.
  703. .RE
  704. .PP
  705. \-\-cherry
  706. .RS 4
  707. A synonym for
  708. \fB\-\-right\-only\fR
  709. \fB\-\-cherry\-mark\fR
  710. \fB\-\-no\-merges\fR; useful to limit the output to the commits on our side and mark those that have been applied to the other side of a forked history with
  711. \fBgit\fR
  712. \fBlog\fR
  713. \fB\-\-cherry\fR
  714. \fBupstream\fR\fB\&.\&.\&.\fR\fBmybranch\fR, similar to
  715. \fBgit\fR
  716. \fBcherry\fR
  717. \fBupstream\fR
  718. \fBmybranch\fR\&.
  719. .RE
  720. .PP
  721. \-g, \-\-walk\-reflogs
  722. .RS 4
  723. Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones\&. When this option is used you cannot specify commits to exclude (that is,
  724. \fI^commit\fR,
  725. \fIcommit1\&.\&.commit2\fR, and
  726. \fIcommit1\&.\&.\&.commit2\fR
  727. notations cannot be used)\&.
  728. .sp
  729. With
  730. \fB\-\-pretty\fR
  731. format other than
  732. \fBoneline\fR
  733. and
  734. \fBreference\fR
  735. (for obvious reasons), this causes the output to have two extra lines of information taken from the reflog\&. The reflog designator in the output may be shown as
  736. \fBref@\fR{\fI<Nth>\fR} (where
  737. \fI<Nth>\fR
  738. is the reverse\-chronological index in the reflog) or as
  739. \fBref@\fR{\fI<timestamp>\fR} (with the
  740. \fI<timestamp>\fR
  741. for that entry), depending on a few rules:
  742. .sp
  743. .RS 4
  744. .ie n \{\
  745. \h'-04' 1.\h'+01'\c
  746. .\}
  747. .el \{\
  748. .sp -1
  749. .IP " 1." 4.2
  750. .\}
  751. If the starting point is specified as
  752. \fBref@\fR{\fI<Nth>\fR}, show the index format\&.
  753. .RE
  754. .sp
  755. .RS 4
  756. .ie n \{\
  757. \h'-04' 2.\h'+01'\c
  758. .\}
  759. .el \{\
  760. .sp -1
  761. .IP " 2." 4.2
  762. .\}
  763. If the starting point was specified as
  764. \fBref@\fR{now}, show the timestamp format\&.
  765. .RE
  766. .sp
  767. .RS 4
  768. .ie n \{\
  769. \h'-04' 3.\h'+01'\c
  770. .\}
  771. .el \{\
  772. .sp -1
  773. .IP " 3." 4.2
  774. .\}
  775. If neither was used, but
  776. \fB\-\-date\fR
  777. was given on the command line, show the timestamp in the format requested by
  778. \fB\-\-date\fR\&.
  779. .RE
  780. .sp
  781. .RS 4
  782. .ie n \{\
  783. \h'-04' 4.\h'+01'\c
  784. .\}
  785. .el \{\
  786. .sp -1
  787. .IP " 4." 4.2
  788. .\}
  789. Otherwise, show the index format\&.
  790. .RE
  791. .sp
  792. Under
  793. \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
  794. \fB\-\-reverse\fR\&. See also
  795. \fBgit-reflog\fR(1)\&.
  796. .sp
  797. Under
  798. \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
  799. .RE
  800. .PP
  801. \-\-merge
  802. .RS 4
  803. Show commits touching conflicted paths in the range
  804. \fBHEAD\fR\fB\&.\&.\&.\fR\fI<other>\fR, where
  805. \fI<other>\fR
  806. is the first existing pseudoref in
  807. \fBMERGE_HEAD\fR,
  808. \fBCHERRY_PICK_HEAD\fR,
  809. \fBREVERT_HEAD\fR
  810. or
  811. \fBREBASE_HEAD\fR\&. Only works when the index has unmerged entries\&. This option can be used to show relevant commits when resolving conflicts from a 3\-way merge\&.
  812. .RE
  813. .PP
  814. \-\-boundary
  815. .RS 4
  816. Output excluded boundary commits\&. Boundary commits are prefixed with
  817. \fB\-\fR\&.
  818. .RE
  819. .SS "History Simplification"
  820. .sp
  821. Sometimes you are only interested in parts of the history, for example the commits modifying a particular <path>\&. But there are two parts of \fIHistory Simplification\fR, one part is selecting the commits and the other is how to do it, as there are various strategies to simplify the history\&.
  822. .sp
  823. The following options select the commits to be shown:
  824. .PP
  825. <paths>
  826. .RS 4
  827. Commits modifying the given <paths> are selected\&.
  828. .RE
  829. .PP
  830. \-\-simplify\-by\-decoration
  831. .RS 4
  832. Commits that are referred by some branch or tag are selected\&.
  833. .RE
  834. .sp
  835. Note that extra commits can be shown to give a meaningful history\&.
  836. .sp
  837. The following options affect the way the simplification is performed:
  838. .PP
  839. Default mode
  840. .RS 4
  841. Simplifies the history to the simplest history explaining the final state of the tree\&. Simplest because it prunes some side branches if the end result is the same (i\&.e\&. merging branches with the same content)
  842. .RE
  843. .PP
  844. \-\-show\-pulls
  845. .RS 4
  846. Include all commits from the default mode, but also any merge commits that are not TREESAME to the first parent but are TREESAME to a later parent\&. This mode is helpful for showing the merge commits that "first introduced" a change to a branch\&.
  847. .RE
  848. .PP
  849. \-\-full\-history
  850. .RS 4
  851. Same as the default mode, but does not prune some history\&.
  852. .RE
  853. .PP
  854. \-\-dense
  855. .RS 4
  856. Only the selected commits are shown, plus some to have a meaningful history\&.
  857. .RE
  858. .PP
  859. \-\-sparse
  860. .RS 4
  861. All commits in the simplified history are shown\&.
  862. .RE
  863. .PP
  864. \-\-simplify\-merges
  865. .RS 4
  866. Additional option to
  867. \fB\-\-full\-history\fR
  868. to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
  869. .RE
  870. .PP
  871. \-\-ancestry\-path[=<commit>]
  872. .RS 4
  873. When given a range of commits to display (e\&.g\&.
  874. \fIcommit1\&.\&.commit2\fR
  875. or
  876. \fIcommit2 ^commit1\fR), and a commit <commit> in that range, only display commits in that range that are ancestors of <commit>, descendants of <commit>, or <commit> itself\&. If no commit is specified, use
  877. \fIcommit1\fR
  878. (the excluded part of the range) as <commit>\&. Can be passed multiple times; if so, a commit is included if it is any of the commits given or if it is an ancestor or descendant of one of them\&.
  879. .RE
  880. .sp
  881. A more detailed explanation follows\&.
  882. .sp
  883. Suppose you specified \fBfoo\fR as the <paths>\&. We shall call commits that modify \fBfoo\fR !TREESAME, and the rest TREESAME\&. (In a diff filtered for \fBfoo\fR, they look different and equal, respectively\&.)
  884. .sp
  885. In the following, we will always refer to the same example history to illustrate the differences between simplification settings\&. We assume that you are filtering for a file \fBfoo\fR in this commit graph:
  886. .sp
  887. .if n \{\
  888. .RS 4
  889. .\}
  890. .nf
  891. \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
  892. / / / / / /
  893. I B C D E Y
  894. \e / / / / /
  895. `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
  896. .fi
  897. .if n \{\
  898. .RE
  899. .\}
  900. .sp
  901. The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
  902. .sp
  903. .RS 4
  904. .ie n \{\
  905. \h'-04'\(bu\h'+03'\c
  906. .\}
  907. .el \{\
  908. .sp -1
  909. .IP \(bu 2.3
  910. .\}
  911. \fBI\fR
  912. is the initial commit, in which
  913. \fBfoo\fR
  914. exists with contents
  915. \(lqasdf\(rq, and a file
  916. \fBquux\fR
  917. exists with contents
  918. \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
  919. \fBI\fR
  920. is !TREESAME\&.
  921. .RE
  922. .sp
  923. .RS 4
  924. .ie n \{\
  925. \h'-04'\(bu\h'+03'\c
  926. .\}
  927. .el \{\
  928. .sp -1
  929. .IP \(bu 2.3
  930. .\}
  931. In
  932. \fBA\fR,
  933. \fBfoo\fR
  934. contains just
  935. \(lqfoo\(rq\&.
  936. .RE
  937. .sp
  938. .RS 4
  939. .ie n \{\
  940. \h'-04'\(bu\h'+03'\c
  941. .\}
  942. .el \{\
  943. .sp -1
  944. .IP \(bu 2.3
  945. .\}
  946. \fBB\fR
  947. contains the same change as
  948. \fBA\fR\&. Its merge
  949. \fBM\fR
  950. is trivial and hence TREESAME to all parents\&.
  951. .RE
  952. .sp
  953. .RS 4
  954. .ie n \{\
  955. \h'-04'\(bu\h'+03'\c
  956. .\}
  957. .el \{\
  958. .sp -1
  959. .IP \(bu 2.3
  960. .\}
  961. \fBC\fR
  962. does not change
  963. \fBfoo\fR, but its merge
  964. \fBN\fR
  965. changes it to
  966. \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
  967. .RE
  968. .sp
  969. .RS 4
  970. .ie n \{\
  971. \h'-04'\(bu\h'+03'\c
  972. .\}
  973. .el \{\
  974. .sp -1
  975. .IP \(bu 2.3
  976. .\}
  977. \fBD\fR
  978. sets
  979. \fBfoo\fR
  980. to
  981. \(lqbaz\(rq\&. Its merge
  982. \fBO\fR
  983. combines the strings from
  984. \fBN\fR
  985. and
  986. \fBD\fR
  987. to
  988. \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
  989. .RE
  990. .sp
  991. .RS 4
  992. .ie n \{\
  993. \h'-04'\(bu\h'+03'\c
  994. .\}
  995. .el \{\
  996. .sp -1
  997. .IP \(bu 2.3
  998. .\}
  999. \fBE\fR
  1000. changes
  1001. \fBquux\fR
  1002. to
  1003. \(lqxyzzy\(rq, and its merge
  1004. \fBP\fR
  1005. combines the strings to
  1006. \(lqquux xyzzy\(rq\&.
  1007. \fBP\fR
  1008. is TREESAME to
  1009. \fBO\fR, but not to
  1010. \fBE\fR\&.
  1011. .RE
  1012. .sp
  1013. .RS 4
  1014. .ie n \{\
  1015. \h'-04'\(bu\h'+03'\c
  1016. .\}
  1017. .el \{\
  1018. .sp -1
  1019. .IP \(bu 2.3
  1020. .\}
  1021. \fBX\fR
  1022. is an independent root commit that added a new file
  1023. \fBside\fR, and
  1024. \fBY\fR
  1025. modified it\&.
  1026. \fBY\fR
  1027. is TREESAME to
  1028. \fBX\fR\&. Its merge
  1029. \fBQ\fR
  1030. added
  1031. \fBside\fR
  1032. to
  1033. \fBP\fR, and
  1034. \fBQ\fR
  1035. is TREESAME to
  1036. \fBP\fR, but not to
  1037. \fBY\fR\&.
  1038. .RE
  1039. .sp
  1040. \fBrev\-list\fR walks backwards through history, including or excluding commits based on whether \fB\-\-full\-history\fR and/or parent rewriting (via \fB\-\-parents\fR or \fB\-\-children\fR) are used\&. The following settings are available\&.
  1041. .PP
  1042. Default mode
  1043. .RS 4
  1044. Commits are included if they are not TREESAME to any parent (though this can be changed, see
  1045. \fB\-\-sparse\fR
  1046. below)\&. If the commit was a merge, and it was TREESAME to one parent, follow only that parent\&. (Even if there are several TREESAME parents, follow only one of them\&.) Otherwise, follow all parents\&.
  1047. .sp
  1048. This results in:
  1049. .sp
  1050. .if n \{\
  1051. .RS 4
  1052. .\}
  1053. .nf
  1054. \&.\-A\-\-\-N\-\-\-O
  1055. / / /
  1056. I\-\-\-\-\-\-\-\-\-D
  1057. .fi
  1058. .if n \{\
  1059. .RE
  1060. .\}
  1061. .sp
  1062. Note how the rule to only follow the TREESAME parent, if one is available, removed
  1063. \fBB\fR
  1064. from consideration entirely\&.
  1065. \fBC\fR
  1066. was considered via
  1067. \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
  1068. \fBI\fR
  1069. is !TREESAME\&.
  1070. .sp
  1071. Parent/child relations are only visible with
  1072. \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
  1073. .RE
  1074. .PP
  1075. \-\-full\-history without parent rewriting
  1076. .RS 4
  1077. This mode differs from the default in one point: always follow all parents of a merge, even if it is TREESAME to one of them\&. Even if more than one side of the merge has commits that are included, this does not imply that the merge itself is! In the example, we get
  1078. .sp
  1079. .if n \{\
  1080. .RS 4
  1081. .\}
  1082. .nf
  1083. I A B N D O P Q
  1084. .fi
  1085. .if n \{\
  1086. .RE
  1087. .\}
  1088. .sp
  1089. \fBM\fR
  1090. was excluded because it is TREESAME to both parents\&.
  1091. \fBE\fR,
  1092. \fBC\fR
  1093. and
  1094. \fBB\fR
  1095. were all walked, but only
  1096. \fBB\fR
  1097. was !TREESAME, so the others do not appear\&.
  1098. .sp
  1099. Note that without parent rewriting, it is not really possible to talk about the parent/child relationships between the commits, so we show them disconnected\&.
  1100. .RE
  1101. .PP
  1102. \-\-full\-history with parent rewriting
  1103. .RS 4
  1104. Ordinary commits are only included if they are !TREESAME (though this can be changed, see
  1105. \fB\-\-sparse\fR
  1106. below)\&.
  1107. .sp
  1108. Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
  1109. .sp
  1110. .if n \{\
  1111. .RS 4
  1112. .\}
  1113. .nf
  1114. \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
  1115. / / / / /
  1116. I B / D /
  1117. \e / / / /
  1118. `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
  1119. .fi
  1120. .if n \{\
  1121. .RE
  1122. .\}
  1123. .sp
  1124. Compare to
  1125. \fB\-\-full\-history\fR
  1126. without rewriting above\&. Note that
  1127. \fBE\fR
  1128. was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
  1129. \fBE\fR\*(Aqs parent
  1130. \fBI\fR\&. The same happened for
  1131. \fBC\fR
  1132. and
  1133. \fBN\fR, and
  1134. \fBX\fR,
  1135. \fBY\fR
  1136. and
  1137. \fBQ\fR\&.
  1138. .RE
  1139. .sp
  1140. In addition to the above settings, you can change whether TREESAME affects inclusion:
  1141. .PP
  1142. \-\-dense
  1143. .RS 4
  1144. Commits that are walked are included if they are not TREESAME to any parent\&.
  1145. .RE
  1146. .PP
  1147. \-\-sparse
  1148. .RS 4
  1149. All commits that are walked are included\&.
  1150. .sp
  1151. Note that without
  1152. \fB\-\-full\-history\fR, this still simplifies merges: if one of the parents is TREESAME, we follow only that one, so the other sides of the merge are never walked\&.
  1153. .RE
  1154. .PP
  1155. \-\-simplify\-merges
  1156. .RS 4
  1157. First, build a history graph in the same way that
  1158. \fB\-\-full\-history\fR
  1159. with parent rewriting does (see above)\&.
  1160. .sp
  1161. Then simplify each commit
  1162. \fBC\fR
  1163. to its replacement
  1164. \fBC\fR\*(Aq in the final history according to the following rules:
  1165. .sp
  1166. .RS 4
  1167. .ie n \{\
  1168. \h'-04'\(bu\h'+03'\c
  1169. .\}
  1170. .el \{\
  1171. .sp -1
  1172. .IP \(bu 2.3
  1173. .\}
  1174. Set
  1175. \fBC\fR\*(Aq to
  1176. \fBC\fR\&.
  1177. .RE
  1178. .sp
  1179. .RS 4
  1180. .ie n \{\
  1181. \h'-04'\(bu\h'+03'\c
  1182. .\}
  1183. .el \{\
  1184. .sp -1
  1185. .IP \(bu 2.3
  1186. .\}
  1187. Replace each parent
  1188. \fBP\fR
  1189. of
  1190. \fBC\fR\*(Aq with its simplification
  1191. \fBP\fR\*(Aq\&. In the process, drop parents that are ancestors of other parents or that are root commits TREESAME to an empty tree, and remove duplicates, but take care to never drop all parents that we are TREESAME to\&.
  1192. .RE
  1193. .sp
  1194. .RS 4
  1195. .ie n \{\
  1196. \h'-04'\(bu\h'+03'\c
  1197. .\}
  1198. .el \{\
  1199. .sp -1
  1200. .IP \(bu 2.3
  1201. .\}
  1202. If after this parent rewriting,
  1203. \fBC\fR\*(Aq is a root or merge commit (has zero or >1 parents), a boundary commit, or !TREESAME, it remains\&. Otherwise, it is replaced with its only parent\&.
  1204. .RE
  1205. .sp
  1206. The effect of this is best shown by way of comparing to
  1207. \fB\-\-full\-history\fR
  1208. with parent rewriting\&. The example turns into:
  1209. .sp
  1210. .if n \{\
  1211. .RS 4
  1212. .\}
  1213. .nf
  1214. \&.\-A\-\-\-M\-\-\-N\-\-\-O
  1215. / / /
  1216. I B D
  1217. \e / /
  1218. `\-\-\-\-\-\-\-\-\-\*(Aq
  1219. .fi
  1220. .if n \{\
  1221. .RE
  1222. .\}
  1223. .sp
  1224. Note the major differences in
  1225. \fBN\fR,
  1226. \fBP\fR, and
  1227. \fBQ\fR
  1228. over
  1229. \fB\-\-full\-history\fR:
  1230. .sp
  1231. .RS 4
  1232. .ie n \{\
  1233. \h'-04'\(bu\h'+03'\c
  1234. .\}
  1235. .el \{\
  1236. .sp -1
  1237. .IP \(bu 2.3
  1238. .\}
  1239. \fBN\fR\*(Aqs parent list had
  1240. \fBI\fR
  1241. removed, because it is an ancestor of the other parent
  1242. \fBM\fR\&. Still,
  1243. \fBN\fR
  1244. remained because it is !TREESAME\&.
  1245. .RE
  1246. .sp
  1247. .RS 4
  1248. .ie n \{\
  1249. \h'-04'\(bu\h'+03'\c
  1250. .\}
  1251. .el \{\
  1252. .sp -1
  1253. .IP \(bu 2.3
  1254. .\}
  1255. \fBP\fR\*(Aqs parent list similarly had
  1256. \fBI\fR
  1257. removed\&.
  1258. \fBP\fR
  1259. was then removed completely, because it had one parent and is TREESAME\&.
  1260. .RE
  1261. .sp
  1262. .RS 4
  1263. .ie n \{\
  1264. \h'-04'\(bu\h'+03'\c
  1265. .\}
  1266. .el \{\
  1267. .sp -1
  1268. .IP \(bu 2.3
  1269. .\}
  1270. \fBQ\fR\*(Aqs parent list had
  1271. \fBY\fR
  1272. simplified to
  1273. \fBX\fR\&.
  1274. \fBX\fR
  1275. was then removed, because it was a TREESAME root\&.
  1276. \fBQ\fR
  1277. was then removed completely, because it had one parent and is TREESAME\&.
  1278. .RE
  1279. .RE
  1280. .sp
  1281. There is another simplification mode available:
  1282. .PP
  1283. \-\-ancestry\-path[=<commit>]
  1284. .RS 4
  1285. Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
  1286. .sp
  1287. As an example use case, consider the following commit history:
  1288. .sp
  1289. .if n \{\
  1290. .RS 4
  1291. .\}
  1292. .nf
  1293. D\-\-\-E\-\-\-\-\-\-\-F
  1294. / \e \e
  1295. B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
  1296. / \e
  1297. A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
  1298. .fi
  1299. .if n \{\
  1300. .RE
  1301. .\}
  1302. .sp
  1303. A regular
  1304. \fID\&.\&.M\fR
  1305. computes the set of commits that are ancestors of
  1306. \fBM\fR, but excludes the ones that are ancestors of
  1307. \fBD\fR\&. This is useful to see what happened to the history leading to
  1308. \fBM\fR
  1309. since
  1310. \fBD\fR, in the sense that
  1311. \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
  1312. \fBA\fR
  1313. and
  1314. \fBB\fR
  1315. (and
  1316. \fBD\fR
  1317. itself, of course)\&.
  1318. .sp
  1319. When we want to find out what commits in
  1320. \fBM\fR
  1321. are contaminated with the bug introduced by
  1322. \fBD\fR
  1323. and need fixing, however, we might want to view only the subset of
  1324. \fID\&.\&.M\fR
  1325. that are actually descendants of
  1326. \fBD\fR, i\&.e\&. excluding
  1327. \fBC\fR
  1328. and
  1329. \fBK\fR\&. This is exactly what the
  1330. \fB\-\-ancestry\-path\fR
  1331. option does\&. Applied to the
  1332. \fID\&.\&.M\fR
  1333. range, it results in:
  1334. .sp
  1335. .if n \{\
  1336. .RS 4
  1337. .\}
  1338. .nf
  1339. E\-\-\-\-\-\-\-F
  1340. \e \e
  1341. G\-\-\-H\-\-\-I\-\-\-J
  1342. \e
  1343. L\-\-M
  1344. .fi
  1345. .if n \{\
  1346. .RE
  1347. .\}
  1348. .sp
  1349. We can also use
  1350. \fB\-\-ancestry\-path=D\fR
  1351. instead of
  1352. \fB\-\-ancestry\-path\fR
  1353. which means the same thing when applied to the
  1354. \fID\&.\&.M\fR
  1355. range but is just more explicit\&.
  1356. .sp
  1357. If we instead are interested in a given topic within this range, and all commits affected by that topic, we may only want to view the subset of
  1358. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1359. which contain that topic in their ancestry path\&. So, using
  1360. \fB\-\-ancestry\-path=H\fR
  1361. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1362. for example would result in:
  1363. .sp
  1364. .if n \{\
  1365. .RS 4
  1366. .\}
  1367. .nf
  1368. E
  1369. \e
  1370. G\-\-\-H\-\-\-I\-\-\-J
  1371. \e
  1372. L\-\-M
  1373. .fi
  1374. .if n \{\
  1375. .RE
  1376. .\}
  1377. .sp
  1378. Whereas
  1379. \fB\-\-ancestry\-path=K\fR
  1380. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1381. would result in
  1382. .sp
  1383. .if n \{\
  1384. .RS 4
  1385. .\}
  1386. .nf
  1387. K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
  1388. .fi
  1389. .if n \{\
  1390. .RE
  1391. .\}
  1392. .RE
  1393. .sp
  1394. Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
  1395. .sp
  1396. A common problem users face when looking at simplified history is that a commit they know changed a file somehow does not appear in the file\(cqs simplified history\&. Let\(cqs demonstrate a new example and show how options such as \fB\-\-full\-history\fR and \fB\-\-simplify\-merges\fR works in that case:
  1397. .sp
  1398. .if n \{\
  1399. .RS 4
  1400. .\}
  1401. .nf
  1402. \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
  1403. / / \e \e \e/ / /
  1404. I B \e R\-\*(Aq`\-Z\*(Aq /
  1405. \e / \e/ /
  1406. \e / /\e /
  1407. `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
  1408. .fi
  1409. .if n \{\
  1410. .RE
  1411. .\}
  1412. .sp
  1413. For this example, suppose \fBI\fR created \fBfile\&.txt\fR which was modified by \fBA\fR, \fBB\fR, and \fBX\fR in different ways\&. The single\-parent commits \fBC\fR, \fBZ\fR, and \fBY\fR do not change \fBfile\&.txt\fR\&. The merge commit \fBM\fR was created by resolving the merge conflict to include both changes from \fBA\fR and \fBB\fR and hence is not TREESAME to either\&. The merge commit \fBR\fR, however, was created by ignoring the contents of \fBfile\&.txt\fR at \fBM\fR and taking only the contents of \fBfile\&.txt\fR at \fBX\fR\&. Hence, \fBR\fR is TREESAME to \fBX\fR but not \fBM\fR\&. Finally, the natural merge resolution to create \fBN\fR is to take the contents of \fBfile\&.txt\fR at \fBR\fR, so \fBN\fR is TREESAME to \fBR\fR but not \fBC\fR\&. The merge commits \fBO\fR and \fBP\fR are TREESAME to their first parents, but not to their second parents, \fBZ\fR and \fBY\fR respectively\&.
  1414. .sp
  1415. When using the default mode, \fBN\fR and \fBR\fR both have a TREESAME parent, so those edges are walked and the others are ignored\&. The resulting history graph is:
  1416. .sp
  1417. .if n \{\
  1418. .RS 4
  1419. .\}
  1420. .nf
  1421. I\-\-\-X
  1422. .fi
  1423. .if n \{\
  1424. .RE
  1425. .\}
  1426. .sp
  1427. When using \fB\-\-full\-history\fR, Git walks every edge\&. This will discover the commits \fBA\fR and \fBB\fR and the merge \fBM\fR, but also will reveal the merge commits \fBO\fR and \fBP\fR\&. With parent rewriting, the resulting graph is:
  1428. .sp
  1429. .if n \{\
  1430. .RS 4
  1431. .\}
  1432. .nf
  1433. \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
  1434. / / \e \e \e/ / /
  1435. I B \e R\-\*(Aq`\-\-\*(Aq /
  1436. \e / \e/ /
  1437. \e / /\e /
  1438. `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
  1439. .fi
  1440. .if n \{\
  1441. .RE
  1442. .\}
  1443. .sp
  1444. Here, the merge commits \fBO\fR and \fBP\fR contribute extra noise, as they did not actually contribute a change to \fBfile\&.txt\fR\&. They only merged a topic that was based on an older version of \fBfile\&.txt\fR\&. This is a common issue in repositories using a workflow where many contributors work in parallel and merge their topic branches along a single trunk: many unrelated merges appear in the \fB\-\-full\-history\fR results\&.
  1445. .sp
  1446. When using the \fB\-\-simplify\-merges\fR option, the commits \fBO\fR and \fBP\fR disappear from the results\&. This is because the rewritten second parents of \fBO\fR and \fBP\fR are reachable from their first parents\&. Those edges are removed and then the commits look like single\-parent commits that are TREESAME to their parent\&. This also happens to the commit \fBN\fR, resulting in a history view as follows:
  1447. .sp
  1448. .if n \{\
  1449. .RS 4
  1450. .\}
  1451. .nf
  1452. \&.\-A\-\-\-M\-\-\&.
  1453. / / \e
  1454. I B R
  1455. \e / /
  1456. \e / /
  1457. `\-\-\-X\-\-\*(Aq
  1458. .fi
  1459. .if n \{\
  1460. .RE
  1461. .\}
  1462. .sp
  1463. In this view, we see all of the important single\-parent changes from \fBA\fR, \fBB\fR, and \fBX\fR\&. We also see the carefully\-resolved merge \fBM\fR and the not\-so\-carefully\-resolved merge \fBR\fR\&. This is usually enough information to determine why the commits \fBA\fR and \fBB\fR "disappeared" from history in the default view\&. However, there are a few issues with this approach\&.
  1464. .sp
  1465. The first issue is performance\&. Unlike any previous option, the \fB\-\-simplify\-merges\fR option requires walking the entire commit history before returning a single result\&. This can make the option difficult to use for very large repositories\&.
  1466. .sp
  1467. The second issue is one of auditing\&. When many contributors are working on the same repository, it is important which merge commits introduced a change into an important branch\&. The problematic merge \fBR\fR above is not likely to be the merge commit that was used to merge into an important branch\&. Instead, the merge \fBN\fR was used to merge \fBR\fR and \fBX\fR into the important branch\&. This commit may have information about why the change \fBX\fR came to override the changes from \fBA\fR and \fBB\fR in its commit message\&.
  1468. .PP
  1469. \-\-show\-pulls
  1470. .RS 4
  1471. In addition to the commits shown in the default history, show each merge commit that is not TREESAME to its first parent but is TREESAME to a later parent\&.
  1472. .sp
  1473. When a merge commit is included by
  1474. \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
  1475. \fB\-\-show\-pulls\fR
  1476. on this example (and no other options) the resulting graph is:
  1477. .sp
  1478. .if n \{\
  1479. .RS 4
  1480. .\}
  1481. .nf
  1482. I\-\-\-X\-\-\-R\-\-\-N
  1483. .fi
  1484. .if n \{\
  1485. .RE
  1486. .\}
  1487. .sp
  1488. Here, the merge commits
  1489. \fBR\fR
  1490. and
  1491. \fBN\fR
  1492. are included because they pulled the commits
  1493. \fBX\fR
  1494. and
  1495. \fBR\fR
  1496. into the base branch, respectively\&. These merges are the reason the commits
  1497. \fBA\fR
  1498. and
  1499. \fBB\fR
  1500. do not appear in the default history\&.
  1501. .sp
  1502. When
  1503. \fB\-\-show\-pulls\fR
  1504. is paired with
  1505. \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
  1506. .sp
  1507. .if n \{\
  1508. .RS 4
  1509. .\}
  1510. .nf
  1511. \&.\-A\-\-\-M\-\-\&. N
  1512. / / \e /
  1513. I B R
  1514. \e / /
  1515. \e / /
  1516. `\-\-\-X\-\-\*(Aq
  1517. .fi
  1518. .if n \{\
  1519. .RE
  1520. .\}
  1521. .sp
  1522. Notice that since
  1523. \fBM\fR
  1524. is reachable from
  1525. \fBR\fR, the edge from
  1526. \fBN\fR
  1527. to
  1528. \fBM\fR
  1529. was simplified away\&. However,
  1530. \fBN\fR
  1531. still appears in the history as an important commit because it "pulled" the change
  1532. \fBR\fR
  1533. into the main branch\&.
  1534. .RE
  1535. .sp
  1536. The \fB\-\-simplify\-by\-decoration\fR option allows you to view only the big picture of the topology of the history, by omitting commits that are not referenced by tags\&. Commits are marked as !TREESAME (in other words, kept after history simplification rules described above) if (1) they are referenced by tags, or (2) they change the contents of the paths given on the command line\&. All other commits are marked as TREESAME (subject to be simplified away)\&.
  1537. .SS "Commit Ordering"
  1538. .sp
  1539. By default, the commits are shown in reverse chronological order\&.
  1540. .PP
  1541. \-\-date\-order
  1542. .RS 4
  1543. Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
  1544. .RE
  1545. .PP
  1546. \-\-author\-date\-order
  1547. .RS 4
  1548. Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
  1549. .RE
  1550. .PP
  1551. \-\-topo\-order
  1552. .RS 4
  1553. Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
  1554. .sp
  1555. For example, in a commit history like this:
  1556. .sp
  1557. .if n \{\
  1558. .RS 4
  1559. .\}
  1560. .nf
  1561. \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
  1562. \e \e
  1563. 3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
  1564. .fi
  1565. .if n \{\
  1566. .RE
  1567. .\}
  1568. .sp
  1569. where the numbers denote the order of commit timestamps,
  1570. \fBgit\fR
  1571. \fBrev\-list\fR
  1572. and friends with
  1573. \fB\-\-date\-order\fR
  1574. show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
  1575. .sp
  1576. With
  1577. \fB\-\-topo\-order\fR, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 3 1); some older commits are shown before newer ones in order to avoid showing the commits from two parallel development track mixed together\&.
  1578. .RE
  1579. .PP
  1580. \-\-reverse
  1581. .RS 4
  1582. Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
  1583. \fB\-\-walk\-reflogs\fR\&.
  1584. .RE
  1585. .SS "Object Traversal"
  1586. .sp
  1587. These options are mostly targeted for packing of Git repositories\&.
  1588. .PP
  1589. \-\-no\-walk[=(sorted|unsorted)]
  1590. .RS 4
  1591. Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
  1592. \fBunsorted\fR
  1593. is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
  1594. \fBsorted\fR
  1595. or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
  1596. \fB\-\-graph\fR\&.
  1597. .RE
  1598. .PP
  1599. \-\-do\-walk
  1600. .RS 4
  1601. Overrides a previous
  1602. \fB\-\-no\-walk\fR\&.
  1603. .RE
  1604. .SS "Commit Formatting"
  1605. .PP
  1606. \-\-pretty[=<format>], \-\-format=<format>
  1607. .RS 4
  1608. Pretty\-print the contents of the commit logs in a given format, where
  1609. \fI<format>\fR
  1610. can be one of
  1611. \fIoneline\fR,
  1612. \fIshort\fR,
  1613. \fImedium\fR,
  1614. \fIfull\fR,
  1615. \fIfuller\fR,
  1616. \fIreference\fR,
  1617. \fIemail\fR,
  1618. \fIraw\fR,
  1619. \fIformat:<string>\fR
  1620. and
  1621. \fItformat:<string>\fR\&. When
  1622. \fI<format>\fR
  1623. is none of the above, and has
  1624. \fI%placeholder\fR
  1625. in it, it acts as if
  1626. \fI\-\-pretty=tformat:<format>\fR
  1627. were given\&.
  1628. .sp
  1629. See the "PRETTY FORMATS" section for some additional details for each format\&. When
  1630. \fI=<format>\fR
  1631. part is omitted, it defaults to
  1632. \fImedium\fR\&.
  1633. .sp
  1634. Note: you can specify the default pretty format in the repository configuration (see
  1635. \fBgit-config\fR(1))\&.
  1636. .RE
  1637. .PP
  1638. \-\-abbrev\-commit
  1639. .RS 4
  1640. Instead of showing the full 40\-byte hexadecimal commit object name, show a prefix that names the object uniquely\&. "\-\-abbrev=<n>" (which also modifies diff output, if it is displayed) option can be used to specify the minimum length of the prefix\&.
  1641. .sp
  1642. This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
  1643. .RE
  1644. .PP
  1645. \-\-no\-abbrev\-commit
  1646. .RS 4
  1647. Show the full 40\-byte hexadecimal commit object name\&. This negates
  1648. \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
  1649. \fBlog\&.abbrevCommit\fR
  1650. variable\&.
  1651. .RE
  1652. .PP
  1653. \-\-oneline
  1654. .RS 4
  1655. This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
  1656. .RE
  1657. .PP
  1658. \-\-encoding=<encoding>
  1659. .RS 4
  1660. Commit objects record the character encoding used for the log message in their encoding header; this option can be used to tell the command to re\-code the commit log message in the encoding preferred by the user\&. For non plumbing commands this defaults to UTF\-8\&. Note that if an object claims to be encoded in
  1661. \fBX\fR
  1662. and we are outputting in
  1663. \fBX\fR, we will output the object verbatim; this means that invalid sequences in the original commit may be copied to the output\&. Likewise, if iconv(3) fails to convert the commit, we will quietly output the original object verbatim\&.
  1664. .RE
  1665. .PP
  1666. \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
  1667. .RS 4
  1668. Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
  1669. \fI<n>\fR) in the log message before showing it in the output\&.
  1670. \fB\-\-expand\-tabs\fR
  1671. is a short\-hand for
  1672. \fB\-\-expand\-tabs=8\fR, and
  1673. \fB\-\-no\-expand\-tabs\fR
  1674. is a short\-hand for
  1675. \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
  1676. .sp
  1677. By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
  1678. \fImedium\fR, which is the default,
  1679. \fIfull\fR, and
  1680. \fIfuller\fR)\&.
  1681. .RE
  1682. .PP
  1683. \-\-notes[=<ref>]
  1684. .RS 4
  1685. Show the notes (see
  1686. \fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for
  1687. \fBgit\fR
  1688. \fBlog\fR,
  1689. \fBgit\fR
  1690. \fBshow\fR
  1691. and
  1692. \fBgit\fR
  1693. \fBwhatchanged\fR
  1694. commands when there is no
  1695. \fB\-\-pretty\fR,
  1696. \fB\-\-format\fR, or
  1697. \fB\-\-oneline\fR
  1698. option given on the command line\&.
  1699. .sp
  1700. By default, the notes shown are from the notes refs listed in the
  1701. \fBcore\&.notesRef\fR
  1702. and
  1703. \fBnotes\&.displayRef\fR
  1704. variables (or corresponding environment overrides)\&. See
  1705. \fBgit-config\fR(1)
  1706. for more details\&.
  1707. .sp
  1708. With an optional
  1709. \fI<ref>\fR
  1710. argument, use the ref to find the notes to display\&. The ref can specify the full refname when it begins with
  1711. \fBrefs/notes/\fR; when it begins with
  1712. \fBnotes/\fR,
  1713. \fBrefs/\fR
  1714. and otherwise
  1715. \fBrefs/notes/\fR
  1716. is prefixed to form the full name of the ref\&.
  1717. .sp
  1718. Multiple \-\-notes options can be combined to control which notes are being displayed\&. Examples: "\-\-notes=foo" will show only notes from "refs/notes/foo"; "\-\-notes=foo \-\-notes" will show both notes from "refs/notes/foo" and from the default notes ref(s)\&.
  1719. .RE
  1720. .PP
  1721. \-\-no\-notes
  1722. .RS 4
  1723. Do not show notes\&. This negates the above
  1724. \fB\-\-notes\fR
  1725. option, by resetting the list of notes refs from which notes are shown\&. Options are parsed in the order given on the command line, so e\&.g\&. "\-\-notes \-\-notes=foo \-\-no\-notes \-\-notes=bar" will only show notes from "refs/notes/bar"\&.
  1726. .RE
  1727. .PP
  1728. \-\-show\-notes\-by\-default
  1729. .RS 4
  1730. Show the default notes unless options for displaying specific notes are given\&.
  1731. .RE
  1732. .PP
  1733. \-\-show\-notes[=<ref>], \-\-[no\-]standard\-notes
  1734. .RS 4
  1735. These options are deprecated\&. Use the above \-\-notes/\-\-no\-notes options instead\&.
  1736. .RE
  1737. .PP
  1738. \-\-show\-signature
  1739. .RS 4
  1740. Check the validity of a signed commit object by passing the signature to
  1741. \fBgpg\fR
  1742. \fB\-\-verify\fR
  1743. and show the output\&.
  1744. .RE
  1745. .PP
  1746. \-\-relative\-date
  1747. .RS 4
  1748. Synonym for
  1749. \fB\-\-date=relative\fR\&.
  1750. .RE
  1751. .PP
  1752. \-\-date=<format>
  1753. .RS 4
  1754. Only takes effect for dates shown in human\-readable format, such as when using
  1755. \fB\-\-pretty\fR\&.
  1756. \fBlog\&.date\fR
  1757. config variable sets a default value for the log command\(cqs
  1758. \fB\-\-date\fR
  1759. option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
  1760. \fB\-local\fR
  1761. is appended to the format (e\&.g\&.,
  1762. \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
  1763. .sp
  1764. \fB\-\-date=relative\fR
  1765. shows dates relative to the current time, e\&.g\&.
  1766. \(lq2 hours ago\(rq\&. The
  1767. \fB\-local\fR
  1768. option has no effect for
  1769. \fB\-\-date=relative\fR\&.
  1770. .sp
  1771. \fB\-\-date=local\fR
  1772. is an alias for
  1773. \fB\-\-date=default\-local\fR\&.
  1774. .sp
  1775. \fB\-\-date=iso\fR
  1776. (or
  1777. \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
  1778. .sp
  1779. .RS 4
  1780. .ie n \{\
  1781. \h'-04'\(bu\h'+03'\c
  1782. .\}
  1783. .el \{\
  1784. .sp -1
  1785. .IP \(bu 2.3
  1786. .\}
  1787. a space instead of the
  1788. \fBT\fR
  1789. date/time delimiter
  1790. .RE
  1791. .sp
  1792. .RS 4
  1793. .ie n \{\
  1794. \h'-04'\(bu\h'+03'\c
  1795. .\}
  1796. .el \{\
  1797. .sp -1
  1798. .IP \(bu 2.3
  1799. .\}
  1800. a space between time and time zone
  1801. .RE
  1802. .sp
  1803. .RS 4
  1804. .ie n \{\
  1805. \h'-04'\(bu\h'+03'\c
  1806. .\}
  1807. .el \{\
  1808. .sp -1
  1809. .IP \(bu 2.3
  1810. .\}
  1811. no colon between hours and minutes of the time zone
  1812. .RE
  1813. .sp
  1814. \fB\-\-date=iso\-strict\fR
  1815. (or
  1816. \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
  1817. .sp
  1818. \fB\-\-date=rfc\fR
  1819. (or
  1820. \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
  1821. .sp
  1822. \fB\-\-date=short\fR
  1823. shows only the date, but not the time, in
  1824. \fBYYYY\-MM\-DD\fR
  1825. format\&.
  1826. .sp
  1827. \fB\-\-date=raw\fR
  1828. shows the date as seconds since the epoch (1970\-01\-01 00:00:00 UTC), followed by a space, and then the timezone as an offset from UTC (a
  1829. \fB+\fR
  1830. or
  1831. \fB\-\fR
  1832. with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
  1833. \fBstrftime\fR("%s %z"))\&. Note that the
  1834. \fB\-local\fR
  1835. option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
  1836. .sp
  1837. \fB\-\-date=human\fR
  1838. shows the timezone if the timezone does not match the current time\-zone, and doesn\(cqt print the whole date if that matches (ie skip printing year for dates that are "this year", but also skip the whole date itself if it\(cqs in the last few days and we can just say what weekday it was)\&. For older dates the hour and minute is also omitted\&.
  1839. .sp
  1840. \fB\-\-date=unix\fR
  1841. shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
  1842. \fB\-\-raw\fR, this is always in UTC and therefore
  1843. \fB\-local\fR
  1844. has no effect\&.
  1845. .sp
  1846. \fB\-\-date=format:\&.\&.\fR\&. feeds the format \&.\&.\&. to your system
  1847. \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
  1848. \fB\-\-date=format:\fR%c to show the date in your system locale\(cqs preferred format\&. See the
  1849. \fBstrftime\fR
  1850. manual for a complete list of format placeholders\&. When using
  1851. \fB\-local\fR, the correct syntax is
  1852. \fB\-\-date=format\-local:\&.\&.\fR\&.\&.
  1853. .sp
  1854. \fB\-\-date=default\fR
  1855. is the default format, and is based on ctime(3) output\&. It shows a single line with three\-letter day of the week, three\-letter month, day\-of\-month, hour\-minute\-seconds in "HH:MM:SS" format, followed by 4\-digit year, plus timezone information, unless the local time zone is used, e\&.g\&.
  1856. \fBThu\fR
  1857. \fBJan\fR
  1858. \fB1\fR
  1859. \fB00:00:00\fR
  1860. \fB1970\fR
  1861. \fB+0000\fR\&.
  1862. .RE
  1863. .PP
  1864. \-\-parents
  1865. .RS 4
  1866. Print also the parents of the commit (in the form "commit parent\&...\:")\&. Also enables parent rewriting, see
  1867. \fIHistory Simplification\fR
  1868. above\&.
  1869. .RE
  1870. .PP
  1871. \-\-children
  1872. .RS 4
  1873. Print also the children of the commit (in the form "commit child\&...\:")\&. Also enables parent rewriting, see
  1874. \fIHistory Simplification\fR
  1875. above\&.
  1876. .RE
  1877. .PP
  1878. \-\-left\-right
  1879. .RS 4
  1880. Mark which side of a symmetric difference a commit is reachable from\&. Commits from the left side are prefixed with < and those from the right with >\&. If combined with
  1881. \fB\-\-boundary\fR, those commits are prefixed with
  1882. \fB\-\fR\&.
  1883. .sp
  1884. For example, if you have this topology:
  1885. .sp
  1886. .if n \{\
  1887. .RS 4
  1888. .\}
  1889. .nf
  1890. y\-\-\-b\-\-\-b branch B
  1891. / \e /
  1892. / \&.
  1893. / / \e
  1894. o\-\-\-x\-\-\-a\-\-\-a branch A
  1895. .fi
  1896. .if n \{\
  1897. .RE
  1898. .\}
  1899. .sp
  1900. you would get an output like this:
  1901. .sp
  1902. .if n \{\
  1903. .RS 4
  1904. .\}
  1905. .nf
  1906. $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
  1907. >bbbbbbb\&.\&.\&. 3rd on b
  1908. >bbbbbbb\&.\&.\&. 2nd on b
  1909. <aaaaaaa\&.\&.\&. 3rd on a
  1910. <aaaaaaa\&.\&.\&. 2nd on a
  1911. \-yyyyyyy\&.\&.\&. 1st on b
  1912. \-xxxxxxx\&.\&.\&. 1st on a
  1913. .fi
  1914. .if n \{\
  1915. .RE
  1916. .\}
  1917. .RE
  1918. .PP
  1919. \-\-graph
  1920. .RS 4
  1921. Draw a text\-based graphical representation of the commit history on the left hand side of the output\&. This may cause extra lines to be printed in between commits, in order for the graph history to be drawn properly\&. Cannot be combined with
  1922. \fB\-\-no\-walk\fR\&.
  1923. .sp
  1924. This enables parent rewriting, see
  1925. \fIHistory Simplification\fR
  1926. above\&.
  1927. .sp
  1928. This implies the
  1929. \fB\-\-topo\-order\fR
  1930. option by default, but the
  1931. \fB\-\-date\-order\fR
  1932. option may also be specified\&.
  1933. .RE
  1934. .PP
  1935. \-\-show\-linear\-break[=<barrier>]
  1936. .RS 4
  1937. When \-\-graph is not used, all history branches are flattened which can make it hard to see that the two consecutive commits do not belong to a linear branch\&. This option puts a barrier in between them in that case\&. If
  1938. \fI<barrier>\fR
  1939. is specified, it is the string that will be shown instead of the default one\&.
  1940. .RE
  1941. .SH "PRETTY FORMATS"
  1942. .sp
  1943. If the commit is a merge, and if the pretty\-format is not \fIoneline\fR, \fIemail\fR or \fIraw\fR, an additional line is inserted before the \fIAuthor:\fR line\&. This line begins with "Merge: " and the hashes of ancestral commits are printed, separated by spaces\&. Note that the listed commits may not necessarily be the list of the \fBdirect\fR parent commits if you have limited your view of history: for example, if you are only interested in changes related to a certain directory or file\&.
  1944. .sp
  1945. There are several built\-in formats, and you can define additional formats by setting a pretty\&.<name> config option to either another format name, or a \fIformat:\fR string, as described below (see \fBgit-config\fR(1))\&. Here are the details of the built\-in formats:
  1946. .sp
  1947. .RS 4
  1948. .ie n \{\
  1949. \h'-04'\(bu\h'+03'\c
  1950. .\}
  1951. .el \{\
  1952. .sp -1
  1953. .IP \(bu 2.3
  1954. .\}
  1955. \fIoneline\fR
  1956. .sp
  1957. .if n \{\
  1958. .RS 4
  1959. .\}
  1960. .nf
  1961. <hash> <title\-line>
  1962. .fi
  1963. .if n \{\
  1964. .RE
  1965. .\}
  1966. .sp
  1967. This is designed to be as compact as possible\&.
  1968. .RE
  1969. .sp
  1970. .RS 4
  1971. .ie n \{\
  1972. \h'-04'\(bu\h'+03'\c
  1973. .\}
  1974. .el \{\
  1975. .sp -1
  1976. .IP \(bu 2.3
  1977. .\}
  1978. \fIshort\fR
  1979. .sp
  1980. .if n \{\
  1981. .RS 4
  1982. .\}
  1983. .nf
  1984. commit <hash>
  1985. Author: <author>
  1986. .fi
  1987. .if n \{\
  1988. .RE
  1989. .\}
  1990. .sp
  1991. .if n \{\
  1992. .RS 4
  1993. .\}
  1994. .nf
  1995. <title\-line>
  1996. .fi
  1997. .if n \{\
  1998. .RE
  1999. .\}
  2000. .RE
  2001. .sp
  2002. .RS 4
  2003. .ie n \{\
  2004. \h'-04'\(bu\h'+03'\c
  2005. .\}
  2006. .el \{\
  2007. .sp -1
  2008. .IP \(bu 2.3
  2009. .\}
  2010. \fImedium\fR
  2011. .sp
  2012. .if n \{\
  2013. .RS 4
  2014. .\}
  2015. .nf
  2016. commit <hash>
  2017. Author: <author>
  2018. Date: <author\-date>
  2019. .fi
  2020. .if n \{\
  2021. .RE
  2022. .\}
  2023. .sp
  2024. .if n \{\
  2025. .RS 4
  2026. .\}
  2027. .nf
  2028. <title\-line>
  2029. .fi
  2030. .if n \{\
  2031. .RE
  2032. .\}
  2033. .sp
  2034. .if n \{\
  2035. .RS 4
  2036. .\}
  2037. .nf
  2038. <full\-commit\-message>
  2039. .fi
  2040. .if n \{\
  2041. .RE
  2042. .\}
  2043. .RE
  2044. .sp
  2045. .RS 4
  2046. .ie n \{\
  2047. \h'-04'\(bu\h'+03'\c
  2048. .\}
  2049. .el \{\
  2050. .sp -1
  2051. .IP \(bu 2.3
  2052. .\}
  2053. \fIfull\fR
  2054. .sp
  2055. .if n \{\
  2056. .RS 4
  2057. .\}
  2058. .nf
  2059. commit <hash>
  2060. Author: <author>
  2061. Commit: <committer>
  2062. .fi
  2063. .if n \{\
  2064. .RE
  2065. .\}
  2066. .sp
  2067. .if n \{\
  2068. .RS 4
  2069. .\}
  2070. .nf
  2071. <title\-line>
  2072. .fi
  2073. .if n \{\
  2074. .RE
  2075. .\}
  2076. .sp
  2077. .if n \{\
  2078. .RS 4
  2079. .\}
  2080. .nf
  2081. <full\-commit\-message>
  2082. .fi
  2083. .if n \{\
  2084. .RE
  2085. .\}
  2086. .RE
  2087. .sp
  2088. .RS 4
  2089. .ie n \{\
  2090. \h'-04'\(bu\h'+03'\c
  2091. .\}
  2092. .el \{\
  2093. .sp -1
  2094. .IP \(bu 2.3
  2095. .\}
  2096. \fIfuller\fR
  2097. .sp
  2098. .if n \{\
  2099. .RS 4
  2100. .\}
  2101. .nf
  2102. commit <hash>
  2103. Author: <author>
  2104. AuthorDate: <author\-date>
  2105. Commit: <committer>
  2106. CommitDate: <committer\-date>
  2107. .fi
  2108. .if n \{\
  2109. .RE
  2110. .\}
  2111. .sp
  2112. .if n \{\
  2113. .RS 4
  2114. .\}
  2115. .nf
  2116. <title\-line>
  2117. .fi
  2118. .if n \{\
  2119. .RE
  2120. .\}
  2121. .sp
  2122. .if n \{\
  2123. .RS 4
  2124. .\}
  2125. .nf
  2126. <full\-commit\-message>
  2127. .fi
  2128. .if n \{\
  2129. .RE
  2130. .\}
  2131. .RE
  2132. .sp
  2133. .RS 4
  2134. .ie n \{\
  2135. \h'-04'\(bu\h'+03'\c
  2136. .\}
  2137. .el \{\
  2138. .sp -1
  2139. .IP \(bu 2.3
  2140. .\}
  2141. \fIreference\fR
  2142. .sp
  2143. .if n \{\
  2144. .RS 4
  2145. .\}
  2146. .nf
  2147. <abbrev\-hash> (<title\-line>, <short\-author\-date>)
  2148. .fi
  2149. .if n \{\
  2150. .RE
  2151. .\}
  2152. .sp
  2153. This format is used to refer to another commit in a commit message and is the same as
  2154. \fB\-\-pretty=\fR\*(Aqformat:%C(\fBauto\fR)%h (%s, %ad)\*(Aq\&. By default, the date is formatted with
  2155. \fB\-\-date=short\fR
  2156. unless another
  2157. \fB\-\-date\fR
  2158. option is explicitly specified\&. As with any
  2159. \fBformat:\fR
  2160. with format placeholders, its output is not affected by other options like
  2161. \fB\-\-decorate\fR
  2162. and
  2163. \fB\-\-walk\-reflogs\fR\&.
  2164. .RE
  2165. .sp
  2166. .RS 4
  2167. .ie n \{\
  2168. \h'-04'\(bu\h'+03'\c
  2169. .\}
  2170. .el \{\
  2171. .sp -1
  2172. .IP \(bu 2.3
  2173. .\}
  2174. \fIemail\fR
  2175. .sp
  2176. .if n \{\
  2177. .RS 4
  2178. .\}
  2179. .nf
  2180. From <hash> <date>
  2181. From: <author>
  2182. Date: <author\-date>
  2183. Subject: [PATCH] <title\-line>
  2184. .fi
  2185. .if n \{\
  2186. .RE
  2187. .\}
  2188. .sp
  2189. .if n \{\
  2190. .RS 4
  2191. .\}
  2192. .nf
  2193. <full\-commit\-message>
  2194. .fi
  2195. .if n \{\
  2196. .RE
  2197. .\}
  2198. .RE
  2199. .sp
  2200. .RS 4
  2201. .ie n \{\
  2202. \h'-04'\(bu\h'+03'\c
  2203. .\}
  2204. .el \{\
  2205. .sp -1
  2206. .IP \(bu 2.3
  2207. .\}
  2208. \fImboxrd\fR
  2209. .sp
  2210. Like
  2211. \fIemail\fR, but lines in the commit message starting with "From " (preceded by zero or more ">") are quoted with ">" so they aren\(cqt confused as starting a new commit\&.
  2212. .RE
  2213. .sp
  2214. .RS 4
  2215. .ie n \{\
  2216. \h'-04'\(bu\h'+03'\c
  2217. .\}
  2218. .el \{\
  2219. .sp -1
  2220. .IP \(bu 2.3
  2221. .\}
  2222. \fIraw\fR
  2223. .sp
  2224. The
  2225. \fIraw\fR
  2226. format shows the entire commit exactly as stored in the commit object\&. Notably, the hashes are displayed in full, regardless of whether \-\-abbrev or \-\-no\-abbrev are used, and
  2227. \fIparents\fR
  2228. information show the true parent commits, without taking grafts or history simplification into account\&. Note that this format affects the way commits are displayed, but not the way the diff is shown e\&.g\&. with
  2229. \fBgit\fR
  2230. \fBlog\fR
  2231. \fB\-\-raw\fR\&. To get full object names in a raw diff format, use
  2232. \fB\-\-no\-abbrev\fR\&.
  2233. .RE
  2234. .sp
  2235. .RS 4
  2236. .ie n \{\
  2237. \h'-04'\(bu\h'+03'\c
  2238. .\}
  2239. .el \{\
  2240. .sp -1
  2241. .IP \(bu 2.3
  2242. .\}
  2243. \fIformat:<format\-string>\fR
  2244. .sp
  2245. The
  2246. \fIformat:<format\-string>\fR
  2247. format allows you to specify which information you want to show\&. It works a little bit like printf format, with the notable exception that you get a newline with
  2248. \fI%n\fR
  2249. instead of
  2250. \fI\en\fR\&.
  2251. .sp
  2252. E\&.g,
  2253. \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
  2254. would show something like this:
  2255. .sp
  2256. .if n \{\
  2257. .RS 4
  2258. .\}
  2259. .nf
  2260. The author of fe6e0ee was Junio C Hamano, 23 hours ago
  2261. The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
  2262. .fi
  2263. .if n \{\
  2264. .RE
  2265. .\}
  2266. .sp
  2267. The placeholders are:
  2268. .sp
  2269. .RS 4
  2270. .ie n \{\
  2271. \h'-04'\(bu\h'+03'\c
  2272. .\}
  2273. .el \{\
  2274. .sp -1
  2275. .IP \(bu 2.3
  2276. .\}
  2277. Placeholders that expand to a single literal character:
  2278. .PP
  2279. \fI%n\fR
  2280. .RS 4
  2281. newline
  2282. .RE
  2283. .PP
  2284. \fI%%\fR
  2285. .RS 4
  2286. a raw
  2287. \fI%\fR
  2288. .RE
  2289. .PP
  2290. \fI%x00\fR
  2291. .RS 4
  2292. \fI%x\fR
  2293. followed by two hexadecimal digits is replaced with a byte with the hexadecimal digits\*(Aq value (we will call this "literal formatting code" in the rest of this document)\&.
  2294. .RE
  2295. .RE
  2296. .sp
  2297. .RS 4
  2298. .ie n \{\
  2299. \h'-04'\(bu\h'+03'\c
  2300. .\}
  2301. .el \{\
  2302. .sp -1
  2303. .IP \(bu 2.3
  2304. .\}
  2305. Placeholders that affect formatting of later placeholders:
  2306. .PP
  2307. \fI%Cred\fR
  2308. .RS 4
  2309. switch color to red
  2310. .RE
  2311. .PP
  2312. \fI%Cgreen\fR
  2313. .RS 4
  2314. switch color to green
  2315. .RE
  2316. .PP
  2317. \fI%Cblue\fR
  2318. .RS 4
  2319. switch color to blue
  2320. .RE
  2321. .PP
  2322. \fI%Creset\fR
  2323. .RS 4
  2324. reset color
  2325. .RE
  2326. .PP
  2327. \fI%C(\&...\:)\fR
  2328. .RS 4
  2329. color specification, as described under Values in the "CONFIGURATION FILE" section of
  2330. \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by
  2331. \fBcolor\&.diff\fR,
  2332. \fBcolor\&.ui\fR, or
  2333. \fB\-\-color\fR, and respecting the
  2334. \fBauto\fR
  2335. settings of the former if we are going to a terminal)\&. %C(\fBauto,\fR\fB\&.\&.\&.\fR) is accepted as a historical synonym for the default (e\&.g\&., %C(\fBauto,red\fR))\&. Specifying %C(\fBalways,\fR\fB\&.\&.\&.\fR) will show the colors even when color is not otherwise enabled (though consider just using
  2336. \fB\-\-color=always\fR
  2337. to enable color for the whole output, including this format and anything else git might color)\&.
  2338. \fBauto\fR
  2339. alone (i\&.e\&. %C(\fBauto\fR)) will turn on auto coloring on the next placeholders until the color is switched again\&.
  2340. .RE
  2341. .PP
  2342. \fI%m\fR
  2343. .RS 4
  2344. left (<), right (>) or boundary (\fB\-\fR) mark
  2345. .RE
  2346. .PP
  2347. \fI%w([<w>[,<i1>[,<i2>]]])\fR
  2348. .RS 4
  2349. switch line wrapping, like the \-w option of
  2350. \fBgit-shortlog\fR(1)\&.
  2351. .RE
  2352. .PP
  2353. \fI%<( <N> [,trunc|ltrunc|mtrunc])\fR
  2354. .RS 4
  2355. make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis
  2356. \fI\&.\&.\fR) at the left (ltrunc)
  2357. \fB\&.\&.\fR\fBft\fR, the middle (mtrunc)
  2358. \fBmi\fR\fB\&.\&.\fR\fBle\fR, or the end (trunc)
  2359. \fBrig\&.\&.\fR, if the output is longer than N columns\&. Note 1: that truncating only works correctly with N >= 2\&. Note 2: spaces around the N and M (see below) values are optional\&. Note 3: Emojis and other wide characters will take two display columns, which may over\-run column boundaries\&. Note 4: decomposed character combining marks may be misplaced at padding boundaries\&.
  2360. .RE
  2361. .PP
  2362. \fI%<|( <M> )\fR
  2363. .RS 4
  2364. make the next placeholder take at least until Mth display column, padding spaces on the right if necessary\&. Use negative M values for column positions measured from the right hand edge of the terminal window\&.
  2365. .RE
  2366. .PP
  2367. \fI%>( <N> )\fR, \fI%>|( <M> )\fR
  2368. .RS 4
  2369. similar to
  2370. \fI%<( <N> )\fR,
  2371. \fI%<|( <M> )\fR
  2372. respectively, but padding spaces on the left
  2373. .RE
  2374. .PP
  2375. \fI%>>( <N> )\fR, \fI%>>|( <M> )\fR
  2376. .RS 4
  2377. similar to
  2378. \fI%>( <N> )\fR,
  2379. \fI%>|( <M> )\fR
  2380. respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces
  2381. .RE
  2382. .PP
  2383. \fI%><( <N> )\fR, \fI%><|( <M> )\fR
  2384. .RS 4
  2385. similar to
  2386. \fI%<( <N> )\fR,
  2387. \fI%<|( <M> )\fR
  2388. respectively, but padding both sides (i\&.e\&. the text is centered)
  2389. .RE
  2390. .RE
  2391. .sp
  2392. .RS 4
  2393. .ie n \{\
  2394. \h'-04'\(bu\h'+03'\c
  2395. .\}
  2396. .el \{\
  2397. .sp -1
  2398. .IP \(bu 2.3
  2399. .\}
  2400. Placeholders that expand to information extracted from the commit:
  2401. .PP
  2402. \fI%H\fR
  2403. .RS 4
  2404. commit hash
  2405. .RE
  2406. .PP
  2407. \fI%h\fR
  2408. .RS 4
  2409. abbreviated commit hash
  2410. .RE
  2411. .PP
  2412. \fI%T\fR
  2413. .RS 4
  2414. tree hash
  2415. .RE
  2416. .PP
  2417. \fI%t\fR
  2418. .RS 4
  2419. abbreviated tree hash
  2420. .RE
  2421. .PP
  2422. \fI%P\fR
  2423. .RS 4
  2424. parent hashes
  2425. .RE
  2426. .PP
  2427. \fI%p\fR
  2428. .RS 4
  2429. abbreviated parent hashes
  2430. .RE
  2431. .PP
  2432. \fI%an\fR
  2433. .RS 4
  2434. author name
  2435. .RE
  2436. .PP
  2437. \fI%aN\fR
  2438. .RS 4
  2439. author name (respecting \&.mailmap, see
  2440. \fBgit-shortlog\fR(1)
  2441. or
  2442. \fBgit-blame\fR(1))
  2443. .RE
  2444. .PP
  2445. \fI%ae\fR
  2446. .RS 4
  2447. author email
  2448. .RE
  2449. .PP
  2450. \fI%aE\fR
  2451. .RS 4
  2452. author email (respecting \&.mailmap, see
  2453. \fBgit-shortlog\fR(1)
  2454. or
  2455. \fBgit-blame\fR(1))
  2456. .RE
  2457. .PP
  2458. \fI%al\fR
  2459. .RS 4
  2460. author email local\-part (the part before the
  2461. \fI@\fR
  2462. sign)
  2463. .RE
  2464. .PP
  2465. \fI%aL\fR
  2466. .RS 4
  2467. author local\-part (see
  2468. \fI%al\fR) respecting \&.mailmap, see
  2469. \fBgit-shortlog\fR(1)
  2470. or
  2471. \fBgit-blame\fR(1))
  2472. .RE
  2473. .PP
  2474. \fI%ad\fR
  2475. .RS 4
  2476. author date (format respects \-\-date= option)
  2477. .RE
  2478. .PP
  2479. \fI%aD\fR
  2480. .RS 4
  2481. author date, RFC2822 style
  2482. .RE
  2483. .PP
  2484. \fI%ar\fR
  2485. .RS 4
  2486. author date, relative
  2487. .RE
  2488. .PP
  2489. \fI%at\fR
  2490. .RS 4
  2491. author date, UNIX timestamp
  2492. .RE
  2493. .PP
  2494. \fI%ai\fR
  2495. .RS 4
  2496. author date, ISO 8601\-like format
  2497. .RE
  2498. .PP
  2499. \fI%aI\fR
  2500. .RS 4
  2501. author date, strict ISO 8601 format
  2502. .RE
  2503. .PP
  2504. \fI%as\fR
  2505. .RS 4
  2506. author date, short format (\fBYYYY\-MM\-DD\fR)
  2507. .RE
  2508. .PP
  2509. \fI%ah\fR
  2510. .RS 4
  2511. author date, human style (like the
  2512. \fB\-\-date=human\fR
  2513. option of
  2514. \fBgit-rev-list\fR(1))
  2515. .RE
  2516. .PP
  2517. \fI%cn\fR
  2518. .RS 4
  2519. committer name
  2520. .RE
  2521. .PP
  2522. \fI%cN\fR
  2523. .RS 4
  2524. committer name (respecting \&.mailmap, see
  2525. \fBgit-shortlog\fR(1)
  2526. or
  2527. \fBgit-blame\fR(1))
  2528. .RE
  2529. .PP
  2530. \fI%ce\fR
  2531. .RS 4
  2532. committer email
  2533. .RE
  2534. .PP
  2535. \fI%cE\fR
  2536. .RS 4
  2537. committer email (respecting \&.mailmap, see
  2538. \fBgit-shortlog\fR(1)
  2539. or
  2540. \fBgit-blame\fR(1))
  2541. .RE
  2542. .PP
  2543. \fI%cl\fR
  2544. .RS 4
  2545. committer email local\-part (the part before the
  2546. \fI@\fR
  2547. sign)
  2548. .RE
  2549. .PP
  2550. \fI%cL\fR
  2551. .RS 4
  2552. committer local\-part (see
  2553. \fI%cl\fR) respecting \&.mailmap, see
  2554. \fBgit-shortlog\fR(1)
  2555. or
  2556. \fBgit-blame\fR(1))
  2557. .RE
  2558. .PP
  2559. \fI%cd\fR
  2560. .RS 4
  2561. committer date (format respects \-\-date= option)
  2562. .RE
  2563. .PP
  2564. \fI%cD\fR
  2565. .RS 4
  2566. committer date, RFC2822 style
  2567. .RE
  2568. .PP
  2569. \fI%cr\fR
  2570. .RS 4
  2571. committer date, relative
  2572. .RE
  2573. .PP
  2574. \fI%ct\fR
  2575. .RS 4
  2576. committer date, UNIX timestamp
  2577. .RE
  2578. .PP
  2579. \fI%ci\fR
  2580. .RS 4
  2581. committer date, ISO 8601\-like format
  2582. .RE
  2583. .PP
  2584. \fI%cI\fR
  2585. .RS 4
  2586. committer date, strict ISO 8601 format
  2587. .RE
  2588. .PP
  2589. \fI%cs\fR
  2590. .RS 4
  2591. committer date, short format (\fBYYYY\-MM\-DD\fR)
  2592. .RE
  2593. .PP
  2594. \fI%ch\fR
  2595. .RS 4
  2596. committer date, human style (like the
  2597. \fB\-\-date=human\fR
  2598. option of
  2599. \fBgit-rev-list\fR(1))
  2600. .RE
  2601. .PP
  2602. \fI%d\fR
  2603. .RS 4
  2604. ref names, like the \-\-decorate option of
  2605. \fBgit-log\fR(1)
  2606. .RE
  2607. .PP
  2608. \fI%D\fR
  2609. .RS 4
  2610. ref names without the " (", ")" wrapping\&.
  2611. .RE
  2612. .PP
  2613. \fI%(decorate[:<options>])\fR
  2614. .RS 4
  2615. ref names with custom decorations\&. The
  2616. \fBdecorate\fR
  2617. string may be followed by a colon and zero or more comma\-separated options\&. Option values may contain literal formatting codes\&. These must be used for commas (%x2C) and closing parentheses (%x29), due to their role in the option syntax\&.
  2618. .sp
  2619. .RS 4
  2620. .ie n \{\
  2621. \h'-04'\(bu\h'+03'\c
  2622. .\}
  2623. .el \{\
  2624. .sp -1
  2625. .IP \(bu 2.3
  2626. .\}
  2627. \fIprefix=<value>\fR: Shown before the list of ref names\&. Defaults to "\ \&("\&.
  2628. .RE
  2629. .sp
  2630. .RS 4
  2631. .ie n \{\
  2632. \h'-04'\(bu\h'+03'\c
  2633. .\}
  2634. .el \{\
  2635. .sp -1
  2636. .IP \(bu 2.3
  2637. .\}
  2638. \fIsuffix=<value>\fR: Shown after the list of ref names\&. Defaults to ")"\&.
  2639. .RE
  2640. .sp
  2641. .RS 4
  2642. .ie n \{\
  2643. \h'-04'\(bu\h'+03'\c
  2644. .\}
  2645. .el \{\
  2646. .sp -1
  2647. .IP \(bu 2.3
  2648. .\}
  2649. \fIseparator=<value>\fR: Shown between ref names\&. Defaults to "\fB,\fR\ \&"\&.
  2650. .RE
  2651. .sp
  2652. .RS 4
  2653. .ie n \{\
  2654. \h'-04'\(bu\h'+03'\c
  2655. .\}
  2656. .el \{\
  2657. .sp -1
  2658. .IP \(bu 2.3
  2659. .\}
  2660. \fIpointer=<value>\fR: Shown between HEAD and the branch it points to, if any\&. Defaults to "\ \&\fB\-\fR>\ \&"\&.
  2661. .RE
  2662. .sp
  2663. .RS 4
  2664. .ie n \{\
  2665. \h'-04'\(bu\h'+03'\c
  2666. .\}
  2667. .el \{\
  2668. .sp -1
  2669. .IP \(bu 2.3
  2670. .\}
  2671. \fItag=<value>\fR: Shown before tag names\&. Defaults to "\fBtag:\fR\ \&"\&.
  2672. .RE
  2673. .RE
  2674. .RE
  2675. .sp
  2676. For example, to produce decorations with no wrapping or tag annotations, and spaces as separators:
  2677. .sp
  2678. + %(\fBdecorate:prefix=,suffix=,tag=,separator=\fR
  2679. )
  2680. .PP
  2681. \fI%(describe[:<options>])\fR
  2682. .RS 4
  2683. human\-readable name, like
  2684. \fBgit-describe\fR(1); empty string for undescribable commits\&. The
  2685. \fBdescribe\fR
  2686. string may be followed by a colon and zero or more comma\-separated options\&. Descriptions can be inconsistent when tags are added or removed at the same time\&.
  2687. .sp
  2688. .RS 4
  2689. .ie n \{\
  2690. \h'-04'\(bu\h'+03'\c
  2691. .\}
  2692. .el \{\
  2693. .sp -1
  2694. .IP \(bu 2.3
  2695. .\}
  2696. \fItags[=<bool\-value>]\fR: Instead of only considering annotated tags, consider lightweight tags as well\&.
  2697. .RE
  2698. .sp
  2699. .RS 4
  2700. .ie n \{\
  2701. \h'-04'\(bu\h'+03'\c
  2702. .\}
  2703. .el \{\
  2704. .sp -1
  2705. .IP \(bu 2.3
  2706. .\}
  2707. \fIabbrev=<number>\fR: Instead of using the default number of hexadecimal digits (which will vary according to the number of objects in the repository with a default of 7) of the abbreviated object name, use <number> digits, or as many digits as needed to form a unique object name\&.
  2708. .RE
  2709. .sp
  2710. .RS 4
  2711. .ie n \{\
  2712. \h'-04'\(bu\h'+03'\c
  2713. .\}
  2714. .el \{\
  2715. .sp -1
  2716. .IP \(bu 2.3
  2717. .\}
  2718. \fImatch=<pattern>\fR: Only consider tags matching the given
  2719. \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
  2720. .RE
  2721. .sp
  2722. .RS 4
  2723. .ie n \{\
  2724. \h'-04'\(bu\h'+03'\c
  2725. .\}
  2726. .el \{\
  2727. .sp -1
  2728. .IP \(bu 2.3
  2729. .\}
  2730. \fIexclude=<pattern>\fR: Do not consider tags matching the given
  2731. \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
  2732. .RE
  2733. .RE
  2734. .PP
  2735. \fI%S\fR
  2736. .RS 4
  2737. ref name given on the command line by which the commit was reached (like
  2738. \fBgit\fR
  2739. \fBlog\fR
  2740. \fB\-\-source\fR), only works with
  2741. \fBgit\fR
  2742. \fBlog\fR
  2743. .RE
  2744. .PP
  2745. \fI%e\fR
  2746. .RS 4
  2747. encoding
  2748. .RE
  2749. .PP
  2750. \fI%s\fR
  2751. .RS 4
  2752. subject
  2753. .RE
  2754. .PP
  2755. \fI%f\fR
  2756. .RS 4
  2757. sanitized subject line, suitable for a filename
  2758. .RE
  2759. .PP
  2760. \fI%b\fR
  2761. .RS 4
  2762. body
  2763. .RE
  2764. .PP
  2765. \fI%B\fR
  2766. .RS 4
  2767. raw body (unwrapped subject and body)
  2768. .RE
  2769. .PP
  2770. \fI%N\fR
  2771. .RS 4
  2772. commit notes
  2773. .RE
  2774. .PP
  2775. \fI%GG\fR
  2776. .RS 4
  2777. raw verification message from GPG for a signed commit
  2778. .RE
  2779. .PP
  2780. \fI%G?\fR
  2781. .RS 4
  2782. show "G" for a good (valid) signature, "B" for a bad signature, "U" for a good signature with unknown validity, "X" for a good signature that has expired, "Y" for a good signature made by an expired key, "R" for a good signature made by a revoked key, "E" if the signature cannot be checked (e\&.g\&. missing key) and "N" for no signature
  2783. .RE
  2784. .PP
  2785. \fI%GS\fR
  2786. .RS 4
  2787. show the name of the signer for a signed commit
  2788. .RE
  2789. .PP
  2790. \fI%GK\fR
  2791. .RS 4
  2792. show the key used to sign a signed commit
  2793. .RE
  2794. .PP
  2795. \fI%GF\fR
  2796. .RS 4
  2797. show the fingerprint of the key used to sign a signed commit
  2798. .RE
  2799. .PP
  2800. \fI%GP\fR
  2801. .RS 4
  2802. show the fingerprint of the primary key whose subkey was used to sign a signed commit
  2803. .RE
  2804. .PP
  2805. \fI%GT\fR
  2806. .RS 4
  2807. show the trust level for the key used to sign a signed commit
  2808. .RE
  2809. .PP
  2810. \fI%gD\fR
  2811. .RS 4
  2812. reflog selector, e\&.g\&.,
  2813. \fBrefs/stash@\fR{1} or
  2814. \fBrefs/stash@\fR{2
  2815. \fBminutes\fR
  2816. \fBago\fR}; the format follows the rules described for the
  2817. \fB\-g\fR
  2818. option\&. The portion before the
  2819. \fB@\fR
  2820. is the refname as given on the command line (so
  2821. \fBgit\fR
  2822. \fBlog\fR
  2823. \fB\-g\fR
  2824. \fBrefs/heads/master\fR
  2825. would yield
  2826. \fBrefs/heads/master@\fR{0})\&.
  2827. .RE
  2828. .PP
  2829. \fI%gd\fR
  2830. .RS 4
  2831. shortened reflog selector; same as %gD, but the refname portion is shortened for human readability (so
  2832. \fBrefs/heads/master\fR
  2833. becomes just
  2834. \fBmaster\fR)\&.
  2835. .RE
  2836. .PP
  2837. \fI%gn\fR
  2838. .RS 4
  2839. reflog identity name
  2840. .RE
  2841. .PP
  2842. \fI%gN\fR
  2843. .RS 4
  2844. reflog identity name (respecting \&.mailmap, see
  2845. \fBgit-shortlog\fR(1)
  2846. or
  2847. \fBgit-blame\fR(1))
  2848. .RE
  2849. .PP
  2850. \fI%ge\fR
  2851. .RS 4
  2852. reflog identity email
  2853. .RE
  2854. .PP
  2855. \fI%gE\fR
  2856. .RS 4
  2857. reflog identity email (respecting \&.mailmap, see
  2858. \fBgit-shortlog\fR(1)
  2859. or
  2860. \fBgit-blame\fR(1))
  2861. .RE
  2862. .PP
  2863. \fI%gs\fR
  2864. .RS 4
  2865. reflog subject
  2866. .RE
  2867. .PP
  2868. \fI%(trailers[:<options>])\fR
  2869. .RS 4
  2870. display the trailers of the body as interpreted by
  2871. \fBgit-interpret-trailers\fR(1)\&. The
  2872. \fBtrailers\fR
  2873. string may be followed by a colon and zero or more comma\-separated options\&. If any option is provided multiple times, the last occurrence wins\&.
  2874. .sp
  2875. .RS 4
  2876. .ie n \{\
  2877. \h'-04'\(bu\h'+03'\c
  2878. .\}
  2879. .el \{\
  2880. .sp -1
  2881. .IP \(bu 2.3
  2882. .\}
  2883. \fIkey=<key>\fR: only show trailers with specified <key>\&. Matching is done case\-insensitively and trailing colon is optional\&. If option is given multiple times trailer lines matching any of the keys are shown\&. This option automatically enables the
  2884. \fBonly\fR
  2885. option so that non\-trailer lines in the trailer block are hidden\&. If that is not desired it can be disabled with
  2886. \fBonly=false\fR\&. E\&.g\&., %(\fBtrailers:key=Reviewed\-by\fR) shows trailer lines with key
  2887. \fBReviewed\-by\fR\&.
  2888. .RE
  2889. .sp
  2890. .RS 4
  2891. .ie n \{\
  2892. \h'-04'\(bu\h'+03'\c
  2893. .\}
  2894. .el \{\
  2895. .sp -1
  2896. .IP \(bu 2.3
  2897. .\}
  2898. \fIonly[=<bool>]\fR: select whether non\-trailer lines from the trailer block should be included\&.
  2899. .RE
  2900. .sp
  2901. .RS 4
  2902. .ie n \{\
  2903. \h'-04'\(bu\h'+03'\c
  2904. .\}
  2905. .el \{\
  2906. .sp -1
  2907. .IP \(bu 2.3
  2908. .\}
  2909. \fIseparator=<sep>\fR: specify the separator inserted between trailer lines\&. Defaults to a line feed character\&. The string <sep> may contain the literal formatting codes described above\&. To use comma as separator one must use %x2C as it would otherwise be parsed as next option\&. E\&.g\&., %(\fBtrailers:key=Ticket,separator=\fR%x2C ) shows all trailer lines whose key is "Ticket" separated by a comma and a space\&.
  2910. .RE
  2911. .sp
  2912. .RS 4
  2913. .ie n \{\
  2914. \h'-04'\(bu\h'+03'\c
  2915. .\}
  2916. .el \{\
  2917. .sp -1
  2918. .IP \(bu 2.3
  2919. .\}
  2920. \fIunfold[=<bool>]\fR: make it behave as if interpret\-trailer\(cqs
  2921. \fB\-\-unfold\fR
  2922. option was given\&. E\&.g\&., %(\fBtrailers:only,unfold=true\fR) unfolds and shows all trailer lines\&.
  2923. .RE
  2924. .sp
  2925. .RS 4
  2926. .ie n \{\
  2927. \h'-04'\(bu\h'+03'\c
  2928. .\}
  2929. .el \{\
  2930. .sp -1
  2931. .IP \(bu 2.3
  2932. .\}
  2933. \fIkeyonly[=<bool>]\fR: only show the key part of the trailer\&.
  2934. .RE
  2935. .sp
  2936. .RS 4
  2937. .ie n \{\
  2938. \h'-04'\(bu\h'+03'\c
  2939. .\}
  2940. .el \{\
  2941. .sp -1
  2942. .IP \(bu 2.3
  2943. .\}
  2944. \fIvalueonly[=<bool>]\fR: only show the value part of the trailer\&.
  2945. .RE
  2946. .sp
  2947. .RS 4
  2948. .ie n \{\
  2949. \h'-04'\(bu\h'+03'\c
  2950. .\}
  2951. .el \{\
  2952. .sp -1
  2953. .IP \(bu 2.3
  2954. .\}
  2955. \fIkey_value_separator=<sep>\fR: specify the separator inserted between the key and value of each trailer\&. Defaults to ": "\&. Otherwise it shares the same semantics as
  2956. \fIseparator=<sep>\fR
  2957. above\&.
  2958. .RE
  2959. .RE
  2960. .RE
  2961. .if n \{\
  2962. .sp
  2963. .\}
  2964. .RS 4
  2965. .it 1 an-trap
  2966. .nr an-no-space-flag 1
  2967. .nr an-break-flag 1
  2968. .br
  2969. .ps +1
  2970. \fBNote\fR
  2971. .ps -1
  2972. .br
  2973. .sp
  2974. Some placeholders may depend on other options given to the revision traversal engine\&. For example, the %g* reflog options will insert an empty string unless we are traversing reflog entries (e\&.g\&., by \fBgit\fR \fBlog\fR \fB\-g\fR)\&. The %d and %D placeholders will use the "short" decoration format if \fB\-\-decorate\fR was not already provided on the command line\&.
  2975. .sp .5v
  2976. .RE
  2977. .sp
  2978. The boolean options accept an optional value [\fB=\fR\fI<bool\-value>\fR]\&. The values taken by \fB\-\-type=bool\fR git\-config[1], like \fByes\fR and \fBoff\fR, are all accepted\&. Giving a boolean option without \fB=\fR\fI<value>\fR is equivalent to giving it with \fB=true\fR\&.
  2979. .sp
  2980. If you add a \fB+\fR (plus sign) after \fI%\fR of a placeholder, a line\-feed is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
  2981. .sp
  2982. If you add a \fB\-\fR (minus sign) after \fI%\fR of a placeholder, all consecutive line\-feeds immediately preceding the expansion are deleted if and only if the placeholder expands to an empty string\&.
  2983. .sp
  2984. If you add a ` ` (space) after \fI%\fR of a placeholder, a space is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
  2985. .sp
  2986. .RS 4
  2987. .ie n \{\
  2988. \h'-04'\(bu\h'+03'\c
  2989. .\}
  2990. .el \{\
  2991. .sp -1
  2992. .IP \(bu 2.3
  2993. .\}
  2994. \fItformat:\fR
  2995. .sp
  2996. The
  2997. \fItformat:\fR
  2998. format works exactly like
  2999. \fIformat:\fR, except that it provides "terminator" semantics instead of "separator" semantics\&. In other words, each commit has the message terminator character (usually a newline) appended, rather than a separator placed between entries\&. This means that the final entry of a single\-line format will be properly terminated with a new line, just as the "oneline" format does\&. For example:
  3000. .sp
  3001. .if n \{\
  3002. .RS 4
  3003. .\}
  3004. .nf
  3005. $ git log \-2 \-\-pretty=format:%h 4da45bef \e
  3006. | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
  3007. 4da45be
  3008. 7134973 \-\- NO NEWLINE
  3009. $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
  3010. | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
  3011. 4da45be
  3012. 7134973
  3013. .fi
  3014. .if n \{\
  3015. .RE
  3016. .\}
  3017. .sp
  3018. In addition, any unrecognized string that has a % in it is interpreted as if it has
  3019. \fBtformat:\fR
  3020. in front of it\&. For example, these two are equivalent:
  3021. .sp
  3022. .if n \{\
  3023. .RS 4
  3024. .\}
  3025. .nf
  3026. $ git log \-2 \-\-pretty=tformat:%h 4da45bef
  3027. $ git log \-2 \-\-pretty=%h 4da45bef
  3028. .fi
  3029. .if n \{\
  3030. .RE
  3031. .\}
  3032. .RE
  3033. .SH "DIFF FORMATTING"
  3034. .sp
  3035. By default, \fBgit\fR \fBlog\fR does not generate any diff output\&. The options below can be used to show the changes made by each commit\&.
  3036. .sp
  3037. Note that unless one of \fB\-\-diff\-merges\fR variants (including short \fB\-m\fR, \fB\-c\fR, \fB\-\-cc\fR, and \fB\-\-dd\fR options) is explicitly given, merge commits will not show a diff, even if a diff format like \fB\-\-patch\fR is selected, nor will they match search options like \fB\-S\fR\&. The exception is when \fB\-\-first\-parent\fR is in use, in which case \fBfirst\-parent\fR is the default format for merge commits\&.
  3038. .PP
  3039. \fB\-p\fR, \fB\-u\fR, \fB\-\-patch\fR
  3040. .RS 4
  3041. Generate patch (see
  3042. the section called \(lqGENERATING PATCH TEXT WITH \-P\(rq)\&.
  3043. .RE
  3044. .PP
  3045. \fB\-s\fR, \fB\-\-no\-patch\fR
  3046. .RS 4
  3047. Suppress all output from the diff machinery\&. Useful for commands like
  3048. \fBgit\fR
  3049. \fBshow\fR
  3050. that show the patch by default to squelch their output, or to cancel the effect of options like
  3051. \fB\-\-patch\fR,
  3052. \fB\-\-stat\fR
  3053. earlier on the command line in an alias\&.
  3054. .RE
  3055. .PP
  3056. \-m
  3057. .RS 4
  3058. Show diffs for merge commits in the default format\&. This is similar to
  3059. \fB\-\-diff\-merges=on\fR, except
  3060. \fB\-m\fR
  3061. will produce no output unless
  3062. \fB\-p\fR
  3063. is given as well\&.
  3064. .RE
  3065. .PP
  3066. \-c
  3067. .RS 4
  3068. Produce combined diff output for merge commits\&. Shortcut for
  3069. \fB\-\-diff\-merges=combined\fR
  3070. \fB\-p\fR\&.
  3071. .RE
  3072. .PP
  3073. \-\-cc
  3074. .RS 4
  3075. Produce dense combined diff output for merge commits\&. Shortcut for
  3076. \fB\-\-diff\-merges=dense\-combined\fR
  3077. \fB\-p\fR\&.
  3078. .RE
  3079. .PP
  3080. \-\-dd
  3081. .RS 4
  3082. Produce diff with respect to first parent for both merge and regular commits\&. Shortcut for
  3083. \fB\-\-diff\-merges=first\-parent\fR
  3084. \fB\-p\fR\&.
  3085. .RE
  3086. .PP
  3087. \-\-remerge\-diff
  3088. .RS 4
  3089. Produce remerge\-diff output for merge commits\&. Shortcut for
  3090. \fB\-\-diff\-merges=remerge\fR
  3091. \fB\-p\fR\&.
  3092. .RE
  3093. .PP
  3094. \-\-no\-diff\-merges
  3095. .RS 4
  3096. Synonym for
  3097. \fB\-\-diff\-merges=off\fR\&.
  3098. .RE
  3099. .PP
  3100. \-\-diff\-merges=<format>
  3101. .RS 4
  3102. Specify diff format to be used for merge commits\&. Default is `off` unless
  3103. \fB\-\-first\-parent\fR
  3104. is in use, in which case
  3105. \fBfirst\-parent\fR
  3106. is the default\&.
  3107. .sp
  3108. The following formats are supported:
  3109. .PP
  3110. off, none
  3111. .RS 4
  3112. Disable output of diffs for merge commits\&. Useful to override implied value\&.
  3113. .RE
  3114. .PP
  3115. on, m
  3116. .RS 4
  3117. Make diff output for merge commits to be shown in the default format\&. The default format can be changed using
  3118. \fBlog\&.diffMerges\fR
  3119. configuration variable, whose default value is
  3120. \fBseparate\fR\&.
  3121. .RE
  3122. .PP
  3123. first\-parent, 1
  3124. .RS 4
  3125. Show full diff with respect to first parent\&. This is the same format as
  3126. \fB\-\-patch\fR
  3127. produces for non\-merge commits\&.
  3128. .RE
  3129. .PP
  3130. separate
  3131. .RS 4
  3132. Show full diff with respect to each of parents\&. Separate log entry and diff is generated for each parent\&.
  3133. .RE
  3134. .PP
  3135. combined, c
  3136. .RS 4
  3137. Show differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time\&. Furthermore, it lists only files which were modified from all parents\&.
  3138. .RE
  3139. .PP
  3140. dense\-combined, cc
  3141. .RS 4
  3142. Further compress output produced by
  3143. \fB\-\-diff\-merges=combined\fR
  3144. by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification\&.
  3145. .RE
  3146. .PP
  3147. remerge, r
  3148. .RS 4
  3149. Remerge two\-parent merge commits to create a temporary tree object\(em\:potentially containing files with conflict markers and such\&. A diff is then shown between that temporary tree and the actual merge commit\&.
  3150. .sp
  3151. The output emitted when this option is used is subject to change, and so is its interaction with other options (unless explicitly documented)\&.
  3152. .RE
  3153. .RE
  3154. .PP
  3155. \-\-combined\-all\-paths
  3156. .RS 4
  3157. Cause combined diffs (used for merge commits) to list the name of the file from all parents\&. It thus only has effect when
  3158. \fB\-\-diff\-merges=\fR[\fBdense\-\fR]\fBcombined\fR
  3159. is in use, and is likely only useful if filename changes are detected (i\&.e\&. when either rename or copy detection have been requested)\&.
  3160. .RE
  3161. .PP
  3162. \fB\-U\fR\fI<n>\fR, \fB\-\-unified=\fR\fI<n>\fR
  3163. .RS 4
  3164. Generate diffs with
  3165. \fI<n>\fR
  3166. lines of context instead of the usual three\&. Implies
  3167. \fB\-\-patch\fR\&.
  3168. .RE
  3169. .PP
  3170. \fB\-\-output=\fR\fI<file>\fR
  3171. .RS 4
  3172. Output to a specific file instead of stdout\&.
  3173. .RE
  3174. .PP
  3175. \fB\-\-output\-indicator\-new=\fR\fI<char>\fR, \fB\-\-output\-indicator\-old=\fR\fI<char>\fR, \fB\-\-output\-indicator\-context=\fR\fI<char>\fR
  3176. .RS 4
  3177. Specify the character used to indicate new, old or context lines in the generated patch\&. Normally they are
  3178. \fB+\fR,
  3179. \fB\-\fR
  3180. and \*(Aq \*(Aq respectively\&.
  3181. .RE
  3182. .PP
  3183. \fB\-\-raw\fR
  3184. .RS 4
  3185. For each commit, show a summary of changes using the raw diff format\&. See the "RAW OUTPUT FORMAT" section of
  3186. \fBgit-diff\fR(1)\&. This is different from showing the log itself in raw format, which you can achieve with
  3187. \fB\-\-format=raw\fR\&.
  3188. .RE
  3189. .PP
  3190. \fB\-\-patch\-with\-raw\fR
  3191. .RS 4
  3192. Synonym for
  3193. \fB\-p\fR
  3194. \fB\-\-raw\fR\&.
  3195. .RE
  3196. .PP
  3197. \fB\-t\fR
  3198. .RS 4
  3199. Show the tree objects in the diff output\&.
  3200. .RE
  3201. .PP
  3202. \fB\-\-indent\-heuristic\fR
  3203. .RS 4
  3204. Enable the heuristic that shifts diff hunk boundaries to make patches easier to read\&. This is the default\&.
  3205. .RE
  3206. .PP
  3207. \fB\-\-no\-indent\-heuristic\fR
  3208. .RS 4
  3209. Disable the indent heuristic\&.
  3210. .RE
  3211. .PP
  3212. \fB\-\-minimal\fR
  3213. .RS 4
  3214. Spend extra time to make sure the smallest possible diff is produced\&.
  3215. .RE
  3216. .PP
  3217. \fB\-\-patience\fR
  3218. .RS 4
  3219. Generate a diff using the "patience diff" algorithm\&.
  3220. .RE
  3221. .PP
  3222. \fB\-\-histogram\fR
  3223. .RS 4
  3224. Generate a diff using the "histogram diff" algorithm\&.
  3225. .RE
  3226. .PP
  3227. \fB\-\-anchored=\fR\fI<text>\fR
  3228. .RS 4
  3229. Generate a diff using the "anchored diff" algorithm\&.
  3230. .sp
  3231. This option may be specified more than once\&.
  3232. .sp
  3233. If a line exists in both the source and destination, exists only once, and starts with
  3234. \fI<text>\fR, this algorithm attempts to prevent it from appearing as a deletion or addition in the output\&. It uses the "patience diff" algorithm internally\&.
  3235. .RE
  3236. .PP
  3237. \fB\-\-diff\-algorithm=\fR(\fBpatience\fR|\fBminimal\fR|\fBhistogram\fR|\fBmyers\fR)
  3238. .RS 4
  3239. Choose a diff algorithm\&. The variants are as follows:
  3240. .PP
  3241. \fBdefault\fR, \fBmyers\fR
  3242. .RS 4
  3243. The basic greedy diff algorithm\&. Currently, this is the default\&.
  3244. .RE
  3245. .PP
  3246. \fBminimal\fR
  3247. .RS 4
  3248. Spend extra time to make sure the smallest possible diff is produced\&.
  3249. .RE
  3250. .PP
  3251. \fBpatience\fR
  3252. .RS 4
  3253. Use "patience diff" algorithm when generating patches\&.
  3254. .RE
  3255. .PP
  3256. \fBhistogram\fR
  3257. .RS 4
  3258. This algorithm extends the patience algorithm to "support low\-occurrence common elements"\&.
  3259. .RE
  3260. .sp
  3261. For instance, if you configured the
  3262. \fBdiff\&.algorithm\fR
  3263. variable to a non\-default value and want to use the default one, then you have to use
  3264. \fB\-\-diff\-algorithm=default\fR
  3265. option\&.
  3266. .RE
  3267. .PP
  3268. \fB\-\-stat\fR[\fB=\fR\fI<width>\fR[\fB,\fR\fI<name\-width>\fR[\fB,\fR\fI<count>\fR]]]
  3269. .RS 4
  3270. Generate a diffstat\&. By default, as much space as necessary will be used for the filename part, and the rest for the graph part\&. Maximum width defaults to terminal width, or 80 columns if not connected to a terminal, and can be overridden by
  3271. \fI<width>\fR\&. The width of the filename part can be limited by giving another width
  3272. \fI<name\-width>\fR
  3273. after a comma or by setting
  3274. \fBdiff\&.statNameWidth=\fR\fI<name\-width>\fR\&. The width of the graph part can be limited by using
  3275. \fB\-\-stat\-graph\-width=\fR\fI<graph\-width>\fR
  3276. or by setting
  3277. \fBdiff\&.statGraphWidth=\fR\fI<graph\-width>\fR\&. Using
  3278. \fB\-\-stat\fR
  3279. or
  3280. \fB\-\-stat\-graph\-width\fR
  3281. affects all commands generating a stat graph, while setting
  3282. \fBdiff\&.statNameWidth\fR
  3283. or
  3284. \fBdiff\&.statGraphWidth\fR
  3285. does not affect
  3286. \fBgit\fR
  3287. \fBformat\-patch\fR\&. By giving a third parameter
  3288. \fI<count>\fR, you can limit the output to the first
  3289. \fI<count>\fR
  3290. lines, followed by \&.\&.\&. if there are more\&.
  3291. .sp
  3292. These parameters can also be set individually with
  3293. \fB\-\-stat\-width=\fR\fI<width>\fR,
  3294. \fB\-\-stat\-name\-width=\fR\fI<name\-width>\fR
  3295. and
  3296. \fB\-\-stat\-count=\fR\fI<count>\fR\&.
  3297. .RE
  3298. .PP
  3299. \fB\-\-compact\-summary\fR
  3300. .RS 4
  3301. Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally
  3302. \fB+l\fR
  3303. if it\(cqs a symlink) and mode changes (\fB+x\fR
  3304. or
  3305. \fB\-x\fR
  3306. for adding or removing executable bit respectively) in diffstat\&. The information is put between the filename part and the graph part\&. Implies
  3307. \fB\-\-stat\fR\&.
  3308. .RE
  3309. .PP
  3310. \fB\-\-numstat\fR
  3311. .RS 4
  3312. Similar to
  3313. \fB\-\-stat\fR, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\&. For binary files, outputs two
  3314. \fB\-\fR
  3315. instead of saying
  3316. \fB0\fR
  3317. \fB0\fR\&.
  3318. .RE
  3319. .PP
  3320. \fB\-\-shortstat\fR
  3321. .RS 4
  3322. Output only the last line of the
  3323. \fB\-\-stat\fR
  3324. format containing total number of modified files, as well as number of added and deleted lines\&.
  3325. .RE
  3326. .PP
  3327. \fB\-X\fR [\fI<param>\fR\fB,\&.\&.\fR\&.], \fB\-\-dirstat\fR[\fB=\fR\fI<param>\fR\fB,\&.\&.\fR\&.]
  3328. .RS 4
  3329. Output the distribution of relative amount of changes for each sub\-directory\&. The behavior of
  3330. \fB\-\-dirstat\fR
  3331. can be customized by passing it a comma separated list of parameters\&. The defaults are controlled by the
  3332. \fBdiff\&.dirstat\fR
  3333. configuration variable (see
  3334. \fBgit-config\fR(1))\&. The following parameters are available:
  3335. .PP
  3336. \fBchanges\fR
  3337. .RS 4
  3338. Compute the dirstat numbers by counting the lines that have been removed from the source, or added to the destination\&. This ignores the amount of pure code movements within a file\&. In other words, rearranging lines in a file is not counted as much as other changes\&. This is the default behavior when no parameter is given\&.
  3339. .RE
  3340. .PP
  3341. \fBlines\fR
  3342. .RS 4
  3343. Compute the dirstat numbers by doing the regular line\-based diff analysis, and summing the removed/added line counts\&. (For binary files, count 64\-byte chunks instead, since binary files have no natural concept of lines)\&. This is a more expensive
  3344. \fB\-\-dirstat\fR
  3345. behavior than the
  3346. \fBchanges\fR
  3347. behavior, but it does count rearranged lines within a file as much as other changes\&. The resulting output is consistent with what you get from the other
  3348. \fB\-\-\fR*stat options\&.
  3349. .RE
  3350. .PP
  3351. \fBfiles\fR
  3352. .RS 4
  3353. Compute the dirstat numbers by counting the number of files changed\&. Each changed file counts equally in the dirstat analysis\&. This is the computationally cheapest
  3354. \fB\-\-dirstat\fR
  3355. behavior, since it does not have to look at the file contents at all\&.
  3356. .RE
  3357. .PP
  3358. \fBcumulative\fR
  3359. .RS 4
  3360. Count changes in a child directory for the parent directory as well\&. Note that when using
  3361. \fBcumulative\fR, the sum of the percentages reported may exceed 100%\&. The default (non\-cumulative) behavior can be specified with the
  3362. \fBnoncumulative\fR
  3363. parameter\&.
  3364. .RE
  3365. .PP
  3366. \fI<limit>\fR
  3367. .RS 4
  3368. An integer parameter specifies a cut\-off percent (3% by default)\&. Directories contributing less than this percentage of the changes are not shown in the output\&.
  3369. .RE
  3370. .sp
  3371. Example: The following will count changed files, while ignoring directories with less than 10% of the total amount of changed files, and accumulating child directory counts in the parent directories:
  3372. \fB\-\-dirstat=files,10,cumulative\fR\&.
  3373. .RE
  3374. .PP
  3375. \fB\-\-cumulative\fR
  3376. .RS 4
  3377. Synonym for
  3378. \fB\-\-dirstat=cumulative\fR\&.
  3379. .RE
  3380. .PP
  3381. \fB\-\-dirstat\-by\-file\fR[\fB=\fR\fI<param>\fR\fB,\&.\&.\fR\&.]
  3382. .RS 4
  3383. Synonym for
  3384. \fB\-\-dirstat=files,\fR\fI<param>\fR\fB,\&.\&.\fR\&.\&.
  3385. .RE
  3386. .PP
  3387. \fB\-\-summary\fR
  3388. .RS 4
  3389. Output a condensed summary of extended header information such as creations, renames and mode changes\&.
  3390. .RE
  3391. .PP
  3392. \fB\-\-patch\-with\-stat\fR
  3393. .RS 4
  3394. Synonym for
  3395. \fB\-p\fR
  3396. \fB\-\-stat\fR\&.
  3397. .RE
  3398. .PP
  3399. \fB\-z\fR
  3400. .RS 4
  3401. Separate the commits with
  3402. \fINUL\fRs instead of newlines\&.
  3403. .sp
  3404. Also, when
  3405. \fB\-\-raw\fR
  3406. or
  3407. \fB\-\-numstat\fR
  3408. has been given, do not munge pathnames and use
  3409. \fINUL\fRs as output field terminators\&.
  3410. .sp
  3411. Without this option, pathnames with "unusual" characters are quoted as explained for the configuration variable
  3412. \fBcore\&.quotePath\fR
  3413. (see
  3414. \fBgit-config\fR(1))\&.
  3415. .RE
  3416. .PP
  3417. \fB\-\-name\-only\fR
  3418. .RS 4
  3419. Show only the name of each changed file in the post\-image tree\&. The file names are often encoded in UTF\-8\&. For more information see the discussion about encoding in the
  3420. \fBgit-log\fR(1)
  3421. manual page\&.
  3422. .RE
  3423. .PP
  3424. \fB\-\-name\-status\fR
  3425. .RS 4
  3426. Show only the name(s) and status of each changed file\&. See the description of the
  3427. \fB\-\-diff\-filter\fR
  3428. option on what the status letters mean\&. Just like
  3429. \fB\-\-name\-only\fR
  3430. the file names are often encoded in UTF\-8\&.
  3431. .RE
  3432. .PP
  3433. \fB\-\-submodule\fR[\fB=\fR\fI<format>\fR]
  3434. .RS 4
  3435. Specify how differences in submodules are shown\&. When specifying
  3436. \fB\-\-submodule=short\fR
  3437. the
  3438. \fBshort\fR
  3439. format is used\&. This format just shows the names of the commits at the beginning and end of the range\&. When
  3440. \fB\-\-submodule\fR
  3441. or
  3442. \fB\-\-submodule=log\fR
  3443. is specified, the
  3444. \fBlog\fR
  3445. format is used\&. This format lists the commits in the range like
  3446. \fBgit-submodule\fR(1)
  3447. \fBsummary\fR
  3448. does\&. When
  3449. \fB\-\-submodule=diff\fR
  3450. is specified, the
  3451. \fBdiff\fR
  3452. format is used\&. This format shows an inline diff of the changes in the submodule contents between the commit range\&. Defaults to
  3453. \fBdiff\&.submodule\fR
  3454. or the
  3455. \fBshort\fR
  3456. format if the config option is unset\&.
  3457. .RE
  3458. .PP
  3459. \fB\-\-color\fR[\fB=\fR\fI<when>\fR]
  3460. .RS 4
  3461. Show colored diff\&.
  3462. \fB\-\-color\fR
  3463. (i\&.e\&. without
  3464. \fB=\fR\fI<when>\fR) is the same as
  3465. \fB\-\-color=always\fR\&.
  3466. \fI<when>\fR
  3467. can be one of
  3468. \fBalways\fR,
  3469. \fBnever\fR, or
  3470. \fBauto\fR\&.
  3471. .RE
  3472. .PP
  3473. \fB\-\-no\-color\fR
  3474. .RS 4
  3475. Turn off colored diff\&. It is the same as
  3476. \fB\-\-color=never\fR\&.
  3477. .RE
  3478. .PP
  3479. \fB\-\-color\-moved\fR[\fB=\fR\fI<mode>\fR]
  3480. .RS 4
  3481. Moved lines of code are colored differently\&. The
  3482. \fI<mode>\fR
  3483. defaults to
  3484. \fBno\fR
  3485. if the option is not given and to
  3486. \fBzebra\fR
  3487. if the option with no mode is given\&. The mode must be one of:
  3488. .PP
  3489. \fBno\fR
  3490. .RS 4
  3491. Moved lines are not highlighted\&.
  3492. .RE
  3493. .PP
  3494. \fBdefault\fR
  3495. .RS 4
  3496. Is a synonym for
  3497. \fBzebra\fR\&. This may change to a more sensible mode in the future\&.
  3498. .RE
  3499. .PP
  3500. \fBplain\fR
  3501. .RS 4
  3502. Any line that is added in one location and was removed in another location will be colored with
  3503. \fBcolor\&.diff\&.newMoved\fR\&. Similarly
  3504. \fBcolor\&.diff\&.oldMoved\fR
  3505. will be used for removed lines that are added somewhere else in the diff\&. This mode picks up any moved line, but it is not very useful in a review to determine if a block of code was moved without permutation\&.
  3506. .RE
  3507. .PP
  3508. \fBblocks\fR
  3509. .RS 4
  3510. Blocks of moved text of at least 20 alphanumeric characters are detected greedily\&. The detected blocks are painted using either the
  3511. \fBcolor\&.diff\&.\fR(\fBold\fR|\fBnew\fR)\fBMoved\fR
  3512. color\&. Adjacent blocks cannot be told apart\&.
  3513. .RE
  3514. .PP
  3515. \fBzebra\fR
  3516. .RS 4
  3517. Blocks of moved text are detected as in
  3518. \fBblocks\fR
  3519. mode\&. The blocks are painted using either the
  3520. \fBcolor\&.diff\&.\fR(\fBold\fR|\fBnew\fR)\fBMoved\fR
  3521. color or
  3522. \fBcolor\&.diff\&.\fR(\fBold\fR|\fBnew\fR)\fBMovedAlternative\fR\&. The change between the two colors indicates that a new block was detected\&.
  3523. .RE
  3524. .PP
  3525. \fBdimmed\-zebra\fR
  3526. .RS 4
  3527. Similar to
  3528. \fBzebra\fR, but additional dimming of uninteresting parts of moved code is performed\&. The bordering lines of two adjacent blocks are considered interesting, the rest is uninteresting\&.
  3529. \fBdimmed_zebra\fR
  3530. is a deprecated synonym\&.
  3531. .RE
  3532. .RE
  3533. .PP
  3534. \fB\-\-no\-color\-moved\fR
  3535. .RS 4
  3536. Turn off move detection\&. This can be used to override configuration settings\&. It is the same as
  3537. \fB\-\-color\-moved=no\fR\&.
  3538. .RE
  3539. .PP
  3540. \fB\-\-color\-moved\-ws=\fR\fI<mode>\fR\fB,\&.\&.\fR\&.
  3541. .RS 4
  3542. This configures how whitespace is ignored when performing the move detection for
  3543. \fB\-\-color\-moved\fR\&. These modes can be given as a comma separated list:
  3544. .PP
  3545. \fBno\fR
  3546. .RS 4
  3547. Do not ignore whitespace when performing move detection\&.
  3548. .RE
  3549. .PP
  3550. \fBignore\-space\-at\-eol\fR
  3551. .RS 4
  3552. Ignore changes in whitespace at EOL\&.
  3553. .RE
  3554. .PP
  3555. \fBignore\-space\-change\fR
  3556. .RS 4
  3557. Ignore changes in amount of whitespace\&. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent\&.
  3558. .RE
  3559. .PP
  3560. \fBignore\-all\-space\fR
  3561. .RS 4
  3562. Ignore whitespace when comparing lines\&. This ignores differences even if one line has whitespace where the other line has none\&.
  3563. .RE
  3564. .PP
  3565. \fBallow\-indentation\-change\fR
  3566. .RS 4
  3567. Initially ignore any whitespace in the move detection, then group the moved code blocks only into a block if the change in whitespace is the same per line\&. This is incompatible with the other modes\&.
  3568. .RE
  3569. .RE
  3570. .PP
  3571. \fB\-\-no\-color\-moved\-ws\fR
  3572. .RS 4
  3573. Do not ignore whitespace when performing move detection\&. This can be used to override configuration settings\&. It is the same as
  3574. \fB\-\-color\-moved\-ws=no\fR\&.
  3575. .RE
  3576. .PP
  3577. \fB\-\-word\-diff\fR[\fB=\fR\fI<mode>\fR]
  3578. .RS 4
  3579. By default, words are delimited by whitespace; see
  3580. \fB\-\-word\-diff\-regex\fR
  3581. below\&. The
  3582. \fI<mode>\fR
  3583. defaults to
  3584. \fBplain\fR, and must be one of:
  3585. .PP
  3586. \fBcolor\fR
  3587. .RS 4
  3588. Highlight changed words using only colors\&. Implies
  3589. \fB\-\-color\fR\&.
  3590. .RE
  3591. .PP
  3592. \fBplain\fR
  3593. .RS 4
  3594. Show words as [\fB\-removed\-\fR] and {\fBadded\fR}\&. Makes no attempts to escape the delimiters if they appear in the input, so the output may be ambiguous\&.
  3595. .RE
  3596. .PP
  3597. \fBporcelain\fR
  3598. .RS 4
  3599. Use a special line\-based format intended for script consumption\&. Added/removed/unchanged runs are printed in the usual unified diff format, starting with a
  3600. \fB+\fR/\fB\-\fR/` ` character at the beginning of the line and extending to the end of the line\&. Newlines in the input are represented by a tilde
  3601. \fB~\fR
  3602. on a line of its own\&.
  3603. .RE
  3604. .PP
  3605. \fBnone\fR
  3606. .RS 4
  3607. Disable word diff again\&.
  3608. .RE
  3609. .sp
  3610. Note that despite the name of the first mode, color is used to highlight the changed parts in all modes if enabled\&.
  3611. .RE
  3612. .PP
  3613. \fB\-\-word\-diff\-regex=\fR\fI<regex>\fR
  3614. .RS 4
  3615. Use
  3616. \fI<regex>\fR
  3617. to decide what a word is, instead of considering runs of non\-whitespace to be a word\&. Also implies
  3618. \fB\-\-word\-diff\fR
  3619. unless it was already enabled\&.
  3620. .sp
  3621. Every non\-overlapping match of the
  3622. \fI<regex>\fR
  3623. is considered a word\&. Anything between these matches is considered whitespace and ignored(!) for the purposes of finding differences\&. You may want to append |[\fB^\fR[\fB:space:\fR]] to your regular expression to make sure that it matches all non\-whitespace characters\&. A match that contains a newline is silently truncated(!) at the newline\&.
  3624. .sp
  3625. For example,
  3626. \fB\-\-word\-diff\-regex=\&.\fR
  3627. will treat each character as a word and, correspondingly, show differences character by character\&.
  3628. .sp
  3629. The regex can also be set via a diff driver or configuration option, see
  3630. \fBgitattributes\fR(5)
  3631. or
  3632. \fBgit-config\fR(1)\&. Giving it explicitly overrides any diff driver or configuration setting\&. Diff drivers override configuration settings\&.
  3633. .RE
  3634. .PP
  3635. \fB\-\-color\-words\fR[\fB=\fR\fI<regex>\fR]
  3636. .RS 4
  3637. Equivalent to
  3638. \fB\-\-word\-diff=color\fR
  3639. plus (if a regex was specified)
  3640. \fB\-\-word\-diff\-regex=\fR\fI<regex>\fR\&.
  3641. .RE
  3642. .PP
  3643. \fB\-\-no\-renames\fR
  3644. .RS 4
  3645. Turn off rename detection, even when the configuration file gives the default to do so\&.
  3646. .RE
  3647. .PP
  3648. \fB\-\-\fR[\fBno\-\fR]\fBrename\-empty\fR
  3649. .RS 4
  3650. Whether to use empty blobs as rename source\&.
  3651. .RE
  3652. .PP
  3653. \fB\-\-check\fR
  3654. .RS 4
  3655. Warn if changes introduce conflict markers or whitespace errors\&. What are considered whitespace errors is controlled by
  3656. \fBcore\&.whitespace\fR
  3657. configuration\&. By default, trailing whitespaces (including lines that consist solely of whitespaces) and a space character that is immediately followed by a tab character inside the initial indent of the line are considered whitespace errors\&. Exits with non\-zero status if problems are found\&. Not compatible with
  3658. \fB\-\-exit\-code\fR\&.
  3659. .RE
  3660. .PP
  3661. \fB\-\-ws\-error\-highlight=\fR\fI<kind>\fR
  3662. .RS 4
  3663. Highlight whitespace errors in the
  3664. \fBcontext\fR,
  3665. \fBold\fR
  3666. or
  3667. \fBnew\fR
  3668. lines of the diff\&. Multiple values are separated by comma,
  3669. \fBnone\fR
  3670. resets previous values,
  3671. \fBdefault\fR
  3672. reset the list to
  3673. \fBnew\fR
  3674. and
  3675. \fBall\fR
  3676. is a shorthand for
  3677. \fBold,new,context\fR\&. When this option is not given, and the configuration variable
  3678. \fBdiff\&.wsErrorHighlight\fR
  3679. is not set, only whitespace errors in
  3680. \fBnew\fR
  3681. lines are highlighted\&. The whitespace errors are colored with
  3682. \fBcolor\&.diff\&.whitespace\fR\&.
  3683. .RE
  3684. .PP
  3685. \fB\-\-full\-index\fR
  3686. .RS 4
  3687. Instead of the first handful of characters, show the full pre\- and post\-image blob object names on the "index" line when generating patch format output\&.
  3688. .RE
  3689. .PP
  3690. \fB\-\-binary\fR
  3691. .RS 4
  3692. In addition to
  3693. \fB\-\-full\-index\fR, output a binary diff that can be applied with
  3694. \fBgit\-apply\fR\&. Implies
  3695. \fB\-\-patch\fR\&.
  3696. .RE
  3697. .PP
  3698. \fB\-\-abbrev\fR[\fB=\fR\fI<n>\fR]
  3699. .RS 4
  3700. Instead of showing the full 40\-byte hexadecimal object name in diff\-raw format output and diff\-tree header lines, show the shortest prefix that is at least
  3701. \fI<n>\fR
  3702. hexdigits long that uniquely refers the object\&. In diff\-patch output format,
  3703. \fB\-\-full\-index\fR
  3704. takes higher precedence, i\&.e\&. if
  3705. \fB\-\-full\-index\fR
  3706. is specified, full blob names will be shown regardless of
  3707. \fB\-\-abbrev\fR\&. Non default number of digits can be specified with
  3708. \fB\-\-abbrev=\fR\fI<n>\fR\&.
  3709. .RE
  3710. .PP
  3711. \fB\-B\fR[\fI<n>\fR][\fB/\fR\fI<m>\fR], \fB\-\-break\-rewrites\fR[\fB=\fR[\fI<n>\fR][\fB/\fR\fI<m>\fR]]
  3712. .RS 4
  3713. Break complete rewrite changes into pairs of delete and create\&. This serves two purposes:
  3714. .sp
  3715. It affects the way a change that amounts to a total rewrite of a file not as a series of deletion and insertion mixed together with a very few lines that happen to match textually as the context, but as a single deletion of everything old followed by a single insertion of everything new, and the number
  3716. \fI<m>\fR
  3717. controls this aspect of the
  3718. \fB\-B\fR
  3719. option (defaults to 60%)\&.
  3720. \fB\-B/70\fR% specifies that less than 30% of the original should remain in the result for Git to consider it a total rewrite (i\&.e\&. otherwise the resulting patch will be a series of deletion and insertion mixed together with context lines)\&.
  3721. .sp
  3722. When used with
  3723. \fB\-M\fR, a totally\-rewritten file is also considered as the source of a rename (usually
  3724. \fB\-M\fR
  3725. only considers a file that disappeared as the source of a rename), and the number
  3726. \fI<n>\fR
  3727. controls this aspect of the
  3728. \fB\-B\fR
  3729. option (defaults to 50%)\&.
  3730. \fB\-B20\fR% specifies that a change with addition and deletion compared to 20% or more of the file\(cqs size are eligible for being picked up as a possible source of a rename to another file\&.
  3731. .RE
  3732. .PP
  3733. \fB\-M\fR[\fI<n>\fR], \fB\-\-find\-renames\fR[\fB=\fR\fI<n>\fR]
  3734. .RS 4
  3735. If generating diffs, detect and report renames for each commit\&. For following files across renames while traversing history, see
  3736. \fB\-\-follow\fR\&. If
  3737. \fI<n>\fR
  3738. is specified, it is a threshold on the similarity index (i\&.e\&. amount of addition/deletions compared to the file\(cqs size)\&. For example,
  3739. \fB\-M90\fR% means Git should consider a delete/add pair to be a rename if more than 90% of the file hasn\(cqt changed\&. Without a % sign, the number is to be read as a fraction, with a decimal point before it\&. I\&.e\&.,
  3740. \fB\-M5\fR
  3741. becomes 0\&.5, and is thus the same as
  3742. \fB\-M50\fR%\&. Similarly,
  3743. \fB\-M05\fR
  3744. is the same as
  3745. \fB\-M5\fR%\&. To limit detection to exact renames, use
  3746. \fB\-M100\fR%\&. The default similarity index is 50%\&.
  3747. .RE
  3748. .PP
  3749. \fB\-C\fR[\fI<n>\fR], \fB\-\-find\-copies\fR[\fB=\fR\fI<n>\fR]
  3750. .RS 4
  3751. Detect copies as well as renames\&. See also
  3752. \fB\-\-find\-copies\-harder\fR\&. If
  3753. \fI<n>\fR
  3754. is specified, it has the same meaning as for
  3755. \fB\-M\fR\fI<n>\fR\&.
  3756. .RE
  3757. .PP
  3758. \fB\-\-find\-copies\-harder\fR
  3759. .RS 4
  3760. For performance reasons, by default,
  3761. \fB\-C\fR
  3762. option finds copies only if the original file of the copy was modified in the same changeset\&. This flag makes the command inspect unmodified files as candidates for the source of copy\&. This is a very expensive operation for large projects, so use it with caution\&. Giving more than one
  3763. \fB\-C\fR
  3764. option has the same effect\&.
  3765. .RE
  3766. .PP
  3767. \fB\-D\fR, \fB\-\-irreversible\-delete\fR
  3768. .RS 4
  3769. Omit the preimage for deletes, i\&.e\&. print only the header but not the diff between the preimage and
  3770. \fB/dev/null\fR\&. The resulting patch is not meant to be applied with
  3771. \fBpatch\fR
  3772. or
  3773. \fBgit\fR
  3774. \fBapply\fR; this is solely for people who want to just concentrate on reviewing the text after the change\&. In addition, the output obviously lacks enough information to apply such a patch in reverse, even manually, hence the name of the option\&.
  3775. .sp
  3776. When used together with
  3777. \fB\-B\fR, omit also the preimage in the deletion part of a delete/create pair\&.
  3778. .RE
  3779. .PP
  3780. \fB\-l\fR\fI<num>\fR
  3781. .RS 4
  3782. The
  3783. \fB\-M\fR
  3784. and
  3785. \fB\-C\fR
  3786. options involve some preliminary steps that can detect subsets of renames/copies cheaply, followed by an exhaustive fallback portion that compares all remaining unpaired destinations to all relevant sources\&. (For renames, only remaining unpaired sources are relevant; for copies, all original sources are relevant\&.) For N sources and destinations, this exhaustive check is O(N^2)\&. This option prevents the exhaustive portion of rename/copy detection from running if the number of source/destination files involved exceeds the specified number\&. Defaults to
  3787. \fBdiff\&.renameLimit\fR\&. Note that a value of 0 is treated as unlimited\&.
  3788. .RE
  3789. .PP
  3790. \fB\-\-diff\-filter=\fR[(\fBA\fR|\fBC\fR|\fBD\fR|\fBM\fR|\fBR\fR|\fBT\fR|\fBU\fR|\fBX\fR|\fBB\fR)\fB\&.\&.\&.\fR[*]]
  3791. .RS 4
  3792. Select only files that are Added (\fBA\fR), Copied (\fBC\fR), Deleted (\fBD\fR), Modified (\fBM\fR), Renamed (\fBR\fR), have their type (i\&.e\&. regular file, symlink, submodule, \&...\:) changed (\fBT\fR), are Unmerged (\fBU\fR), are Unknown (\fBX\fR), or have had their pairing Broken (\fBB\fR)\&. Any combination of the filter characters (including none) can be used\&. When * (All\-or\-none) is added to the combination, all paths are selected if there is any file that matches other criteria in the comparison; if there is no file that matches other criteria, nothing is selected\&.
  3793. .sp
  3794. Also, these upper\-case letters can be downcased to exclude\&. E\&.g\&.
  3795. \fB\-\-diff\-filter=ad\fR
  3796. excludes added and deleted paths\&.
  3797. .sp
  3798. Note that not all diffs can feature all types\&. For instance, copied and renamed entries cannot appear if detection for those types is disabled\&.
  3799. .RE
  3800. .PP
  3801. \fB\-S\fR\fI<string>\fR
  3802. .RS 4
  3803. Look for differences that change the number of occurrences of the specified
  3804. \fI<string>\fR
  3805. (i\&.e\&. addition/deletion) in a file\&. Intended for the scripter\(cqs use\&.
  3806. .sp
  3807. It is useful when you\(cqre looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively to feed the interesting block in the preimage back into
  3808. \fB\-S\fR, and keep going until you get the very first version of the block\&.
  3809. .sp
  3810. Binary files are searched as well\&.
  3811. .RE
  3812. .PP
  3813. \fB\-G\fR\fI<regex>\fR
  3814. .RS 4
  3815. Look for differences whose patch text contains added/removed lines that match
  3816. \fI<regex>\fR\&.
  3817. .sp
  3818. To illustrate the difference between
  3819. \fB\-S\fR\fI<regex>\fR
  3820. \fB\-\-pickaxe\-regex\fR
  3821. and
  3822. \fB\-G\fR\fI<regex>\fR, consider a commit with the following diff in the same file:
  3823. .sp
  3824. .if n \{\
  3825. .RS 4
  3826. .\}
  3827. .nf
  3828. + return frotz(nitfol, two\->ptr, 1, 0);
  3829. \&.\&.\&.
  3830. \- hit = frotz(nitfol, mf2\&.ptr, 1, 0);
  3831. .fi
  3832. .if n \{\
  3833. .RE
  3834. .\}
  3835. .sp
  3836. While
  3837. \fBgit\fR
  3838. \fBlog\fR
  3839. \fB\-G\fR"frotz\e(\fBnitfol\fR" will show this commit,
  3840. \fBgit\fR
  3841. \fBlog\fR
  3842. \fB\-S\fR"frotz\e(\fBnitfol\fR"
  3843. \fB\-\-pickaxe\-regex\fR
  3844. will not (because the number of occurrences of that string did not change)\&.
  3845. .sp
  3846. Unless
  3847. \fB\-\-text\fR
  3848. is supplied patches of binary files without a textconv filter will be ignored\&.
  3849. .sp
  3850. See the
  3851. \fIpickaxe\fR
  3852. entry in
  3853. \fBgitdiffcore\fR(7)
  3854. for more information\&.
  3855. .RE
  3856. .PP
  3857. \fB\-\-find\-object=\fR\fI<object\-id>\fR
  3858. .RS 4
  3859. Look for differences that change the number of occurrences of the specified object\&. Similar to
  3860. \fB\-S\fR, just the argument is different in that it doesn\(cqt search for a specific string but for a specific object id\&.
  3861. .sp
  3862. The object can be a blob or a submodule commit\&. It implies the
  3863. \fB\-t\fR
  3864. option in
  3865. \fBgit\-log\fR
  3866. to also find trees\&.
  3867. .RE
  3868. .PP
  3869. \fB\-\-pickaxe\-all\fR
  3870. .RS 4
  3871. When
  3872. \fB\-S\fR
  3873. or
  3874. \fB\-G\fR
  3875. finds a change, show all the changes in that changeset, not just the files that contain the change in
  3876. \fI<string>\fR\&.
  3877. .RE
  3878. .PP
  3879. \fB\-\-pickaxe\-regex\fR
  3880. .RS 4
  3881. Treat the
  3882. \fI<string>\fR
  3883. given to
  3884. \fB\-S\fR
  3885. as an extended POSIX regular expression to match\&.
  3886. .RE
  3887. .PP
  3888. \fB\-O\fR\fI<orderfile>\fR
  3889. .RS 4
  3890. Control the order in which files appear in the output\&. This overrides the
  3891. \fBdiff\&.orderFile\fR
  3892. configuration variable (see
  3893. \fBgit-config\fR(1))\&. To cancel
  3894. \fBdiff\&.orderFile\fR, use
  3895. \fB\-O/dev/null\fR\&.
  3896. .sp
  3897. The output order is determined by the order of glob patterns in
  3898. \fI<orderfile>\fR\&. All files with pathnames that match the first pattern are output first, all files with pathnames that match the second pattern (but not the first) are output next, and so on\&. All files with pathnames that do not match any pattern are output last, as if there was an implicit match\-all pattern at the end of the file\&. If multiple pathnames have the same rank (they match the same pattern but no earlier patterns), their output order relative to each other is the normal order\&.
  3899. .sp
  3900. \fI<orderfile>\fR
  3901. is parsed as follows:
  3902. .sp
  3903. .RS 4
  3904. .ie n \{\
  3905. \h'-04'\(bu\h'+03'\c
  3906. .\}
  3907. .el \{\
  3908. .sp -1
  3909. .IP \(bu 2.3
  3910. .\}
  3911. Blank lines are ignored, so they can be used as separators for readability\&.
  3912. .RE
  3913. .sp
  3914. .RS 4
  3915. .ie n \{\
  3916. \h'-04'\(bu\h'+03'\c
  3917. .\}
  3918. .el \{\
  3919. .sp -1
  3920. .IP \(bu 2.3
  3921. .\}
  3922. Lines starting with a hash ("#") are ignored, so they can be used for comments\&. Add a backslash ("\e") to the beginning of the pattern if it starts with a hash\&.
  3923. .RE
  3924. .sp
  3925. .RS 4
  3926. .ie n \{\
  3927. \h'-04'\(bu\h'+03'\c
  3928. .\}
  3929. .el \{\
  3930. .sp -1
  3931. .IP \(bu 2.3
  3932. .\}
  3933. Each other line contains a single pattern\&.
  3934. .RE
  3935. .sp
  3936. Patterns have the same syntax and semantics as patterns used for
  3937. \fBfnmatch\fR(3) without the
  3938. \fBFNM_PATHNAME\fR
  3939. flag, except a pathname also matches a pattern if removing any number of the final pathname components matches the pattern\&. For example, the pattern "\fBfoo\fR*bar" matches "\fBfooasdfbar\fR" and "\fBfoo/bar/baz/asdf\fR" but not "\fBfoobarx\fR"\&.
  3940. .RE
  3941. .PP
  3942. \fB\-\-skip\-to=\fR\fI<file>\fR, \fB\-\-rotate\-to=\fR\fI<file>\fR
  3943. .RS 4
  3944. Discard the files before the named
  3945. \fI<file>\fR
  3946. from the output (i\&.e\&.
  3947. \fIskip to\fR), or move them to the end of the output (i\&.e\&.
  3948. \fIrotate to\fR)\&. These options were invented primarily for the use of the
  3949. \fBgit\fR
  3950. \fBdifftool\fR
  3951. command, and may not be very useful otherwise\&.
  3952. .RE
  3953. .PP
  3954. \fB\-R\fR
  3955. .RS 4
  3956. Swap two inputs; that is, show differences from index or on\-disk file to tree contents\&.
  3957. .RE
  3958. .PP
  3959. \fB\-\-relative\fR[\fB=\fR\fI<path>\fR], \fB\-\-no\-relative\fR
  3960. .RS 4
  3961. When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\&. When you are not in a subdirectory (e\&.g\&. in a bare repository), you can name which subdirectory to make the output relative to by giving a
  3962. \fI<path>\fR
  3963. as an argument\&.
  3964. \fB\-\-no\-relative\fR
  3965. can be used to countermand both
  3966. \fBdiff\&.relative\fR
  3967. config option and previous
  3968. \fB\-\-relative\fR\&.
  3969. .RE
  3970. .PP
  3971. \fB\-a\fR, \fB\-\-text\fR
  3972. .RS 4
  3973. Treat all files as text\&.
  3974. .RE
  3975. .PP
  3976. \fB\-\-ignore\-cr\-at\-eol\fR
  3977. .RS 4
  3978. Ignore carriage\-return at the end of line when doing a comparison\&.
  3979. .RE
  3980. .PP
  3981. \fB\-\-ignore\-space\-at\-eol\fR
  3982. .RS 4
  3983. Ignore changes in whitespace at EOL\&.
  3984. .RE
  3985. .PP
  3986. \fB\-b\fR, \fB\-\-ignore\-space\-change\fR
  3987. .RS 4
  3988. Ignore changes in amount of whitespace\&. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent\&.
  3989. .RE
  3990. .PP
  3991. \fB\-w\fR, \fB\-\-ignore\-all\-space\fR
  3992. .RS 4
  3993. Ignore whitespace when comparing lines\&. This ignores differences even if one line has whitespace where the other line has none\&.
  3994. .RE
  3995. .PP
  3996. \fB\-\-ignore\-blank\-lines\fR
  3997. .RS 4
  3998. Ignore changes whose lines are all blank\&.
  3999. .RE
  4000. .PP
  4001. \fB\-I\fR\fI<regex>\fR, \fB\-\-ignore\-matching\-lines=\fR\fI<regex>\fR
  4002. .RS 4
  4003. Ignore changes whose all lines match
  4004. \fI<regex>\fR\&. This option may be specified more than once\&.
  4005. .RE
  4006. .PP
  4007. \fB\-\-inter\-hunk\-context=\fR\fI<number>\fR
  4008. .RS 4
  4009. Show the context between diff hunks, up to the specified
  4010. \fI<number>\fR
  4011. of lines, thereby fusing hunks that are close to each other\&. Defaults to
  4012. \fBdiff\&.interHunkContext\fR
  4013. or 0 if the config option is unset\&.
  4014. .RE
  4015. .PP
  4016. \fB\-W\fR, \fB\-\-function\-context\fR
  4017. .RS 4
  4018. Show whole function as context lines for each change\&. The function names are determined in the same way as
  4019. \fBgit\fR
  4020. \fBdiff\fR
  4021. works out patch hunk headers (see "Defining a custom hunk\-header" in
  4022. \fBgitattributes\fR(5))\&.
  4023. .RE
  4024. .PP
  4025. \fB\-\-ext\-diff\fR
  4026. .RS 4
  4027. Allow an external diff helper to be executed\&. If you set an external diff driver with
  4028. \fBgitattributes\fR(5), you need to use this option with
  4029. \fBgit-log\fR(1)
  4030. and friends\&.
  4031. .RE
  4032. .PP
  4033. \fB\-\-no\-ext\-diff\fR
  4034. .RS 4
  4035. Disallow external diff drivers\&.
  4036. .RE
  4037. .PP
  4038. \fB\-\-textconv\fR, \fB\-\-no\-textconv\fR
  4039. .RS 4
  4040. Allow (or disallow) external text conversion filters to be run when comparing binary files\&. See
  4041. \fBgitattributes\fR(5)
  4042. for details\&. Because textconv filters are typically a one\-way conversion, the resulting diff is suitable for human consumption, but cannot be applied\&. For this reason, textconv filters are enabled by default only for
  4043. \fBgit-diff\fR(1)
  4044. and
  4045. \fBgit-log\fR(1), but not for
  4046. \fBgit-format-patch\fR(1)
  4047. or diff plumbing commands\&.
  4048. .RE
  4049. .PP
  4050. \fB\-\-ignore\-submodules\fR[\fB=\fR(\fBnone\fR|\fBuntracked\fR|\fBdirty\fR|\fBall\fR)]
  4051. .RS 4
  4052. Ignore changes to submodules in the diff generation\&.
  4053. \fBall\fR
  4054. is the default\&. Using
  4055. \fBnone\fR
  4056. will consider the submodule modified when it either contains untracked or modified files or its
  4057. \fBHEAD\fR
  4058. differs from the commit recorded in the superproject and can be used to override any settings of the
  4059. \fBignore\fR
  4060. option in
  4061. \fBgit-config\fR(1)
  4062. or
  4063. \fBgitmodules\fR(5)\&. When
  4064. \fBuntracked\fR
  4065. is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content)\&. Using
  4066. \fBdirty\fR
  4067. ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior until 1\&.7\&.0)\&. Using
  4068. \fBall\fR
  4069. hides all changes to submodules\&.
  4070. .RE
  4071. .PP
  4072. \fB\-\-src\-prefix=\fR\fI<prefix>\fR
  4073. .RS 4
  4074. Show the given source
  4075. \fI<prefix>\fR
  4076. instead of "a/"\&.
  4077. .RE
  4078. .PP
  4079. \fB\-\-dst\-prefix=\fR\fI<prefix>\fR
  4080. .RS 4
  4081. Show the given destination
  4082. \fI<prefix>\fR
  4083. instead of "b/"\&.
  4084. .RE
  4085. .PP
  4086. \fB\-\-no\-prefix\fR
  4087. .RS 4
  4088. Do not show any source or destination prefix\&.
  4089. .RE
  4090. .PP
  4091. \fB\-\-default\-prefix\fR
  4092. .RS 4
  4093. Use the default source and destination prefixes ("a/" and "b/")\&. This overrides configuration variables such as
  4094. \fBdiff\&.noprefix\fR,
  4095. \fBdiff\&.srcPrefix\fR,
  4096. \fBdiff\&.dstPrefix\fR, and
  4097. \fBdiff\&.mnemonicPrefix\fR
  4098. (see
  4099. \fBgit-config\fR(1))\&.
  4100. .RE
  4101. .PP
  4102. \fB\-\-line\-prefix=\fR\fI<prefix>\fR
  4103. .RS 4
  4104. Prepend an additional
  4105. \fI<prefix>\fR
  4106. to every line of output\&.
  4107. .RE
  4108. .PP
  4109. \fB\-\-ita\-invisible\-in\-index\fR
  4110. .RS 4
  4111. By default entries added by
  4112. \fBgit\fR
  4113. \fBadd\fR
  4114. \fB\-N\fR
  4115. appear as an existing empty file in
  4116. \fBgit\fR
  4117. \fBdiff\fR
  4118. and a new file in
  4119. \fBgit\fR
  4120. \fBdiff\fR
  4121. \fB\-\-cached\fR\&. This option makes the entry appear as a new file in
  4122. \fBgit\fR
  4123. \fBdiff\fR
  4124. and non\-existent in
  4125. \fBgit\fR
  4126. \fBdiff\fR
  4127. \fB\-\-cached\fR\&. This option could be reverted with
  4128. \fB\-\-ita\-visible\-in\-index\fR\&. Both options are experimental and could be removed in future\&.
  4129. .RE
  4130. .sp
  4131. For more detailed explanation on these common options, see also \fBgitdiffcore\fR(7)\&.
  4132. .SH "GENERATING PATCH TEXT WITH \-P"
  4133. .sp
  4134. Running \fBgit-diff\fR(1), \fBgit-log\fR(1), \fBgit-show\fR(1), \fBgit-diff-index\fR(1), \fBgit-diff-tree\fR(1), or \fBgit-diff-files\fR(1) with the \fB\-p\fR option produces patch text\&. You can customize the creation of patch text via the \fBGIT_EXTERNAL_DIFF\fR and the \fBGIT_DIFF_OPTS\fR environment variables (see \fBgit\fR(1)), and the \fBdiff\fR attribute (see \fBgitattributes\fR(5))\&.
  4135. .sp
  4136. What the \fB\-p\fR option produces is slightly different from the traditional diff format:
  4137. .sp
  4138. .RS 4
  4139. .ie n \{\
  4140. \h'-04' 1.\h'+01'\c
  4141. .\}
  4142. .el \{\
  4143. .sp -1
  4144. .IP " 1." 4.2
  4145. .\}
  4146. It is preceded by a "git diff" header that looks like this:
  4147. .sp
  4148. .if n \{\
  4149. .RS 4
  4150. .\}
  4151. .nf
  4152. diff \-\-git a/file1 b/file2
  4153. .fi
  4154. .if n \{\
  4155. .RE
  4156. .\}
  4157. .sp
  4158. The
  4159. \fBa/\fR
  4160. and
  4161. \fBb/\fR
  4162. filenames are the same unless rename/copy is involved\&. Especially, even for a creation or a deletion,
  4163. \fB/dev/null\fR
  4164. is
  4165. \fInot\fR
  4166. used in place of the
  4167. \fBa/\fR
  4168. or
  4169. \fBb/\fR
  4170. filenames\&.
  4171. .sp
  4172. When a rename/copy is involved,
  4173. \fBfile1\fR
  4174. and
  4175. \fBfile2\fR
  4176. show the name of the source file of the rename/copy and the name of the file that the rename/copy produces, respectively\&.
  4177. .RE
  4178. .sp
  4179. .RS 4
  4180. .ie n \{\
  4181. \h'-04' 2.\h'+01'\c
  4182. .\}
  4183. .el \{\
  4184. .sp -1
  4185. .IP " 2." 4.2
  4186. .\}
  4187. It is followed by one or more extended header lines:
  4188. .sp
  4189. .if n \{\
  4190. .RS 4
  4191. .\}
  4192. .nf
  4193. \fBold\fR \fBmode\fR \fI<mode>\fR
  4194. \fBnew\fR \fBmode\fR \fI<mode>\fR
  4195. \fBdeleted\fR \fBfile\fR \fBmode\fR \fI<mode>\fR
  4196. \fBnew\fR \fBfile\fR \fBmode\fR \fI<mode>\fR
  4197. \fBcopy\fR \fBfrom\fR \fI<path>\fR
  4198. \fBcopy\fR \fBto\fR \fI<path>\fR
  4199. \fBrename\fR \fBfrom\fR \fI<path>\fR
  4200. \fBrename\fR \fBto\fR \fI<path>\fR
  4201. \fBsimilarity\fR \fBindex\fR \fI<number>\fR
  4202. \fBdissimilarity\fR \fBindex\fR \fI<number>\fR
  4203. \fBindex\fR \fI<hash>\fR`\&.\&.`\fI<hash>\fR \fI<mode>\fR
  4204. .fi
  4205. .if n \{\
  4206. .RE
  4207. .\}
  4208. File modes
  4209. \fI<mode>\fR
  4210. are printed as 6\-digit octal numbers including the file type and file permission bits\&.
  4211. .sp
  4212. Path names in extended headers do not include the
  4213. \fBa/\fR
  4214. and
  4215. \fBb/\fR
  4216. prefixes\&.
  4217. .sp
  4218. The similarity index is the percentage of unchanged lines, and the dissimilarity index is the percentage of changed lines\&. It is a rounded down integer, followed by a percent sign\&. The similarity index value of 100% is thus reserved for two equal files, while 100% dissimilarity means that no line from the old file made it into the new one\&.
  4219. .sp
  4220. The index line includes the blob object names before and after the change\&. The
  4221. \fI<mode>\fR
  4222. is included if the file mode does not change; otherwise, separate lines indicate the old and the new mode\&.
  4223. .RE
  4224. .sp
  4225. .RS 4
  4226. .ie n \{\
  4227. \h'-04' 3.\h'+01'\c
  4228. .\}
  4229. .el \{\
  4230. .sp -1
  4231. .IP " 3." 4.2
  4232. .\}
  4233. Pathnames with "unusual" characters are quoted as explained for the configuration variable
  4234. \fBcore\&.quotePath\fR
  4235. (see
  4236. \fBgit-config\fR(1))\&.
  4237. .RE
  4238. .sp
  4239. .RS 4
  4240. .ie n \{\
  4241. \h'-04' 4.\h'+01'\c
  4242. .\}
  4243. .el \{\
  4244. .sp -1
  4245. .IP " 4." 4.2
  4246. .\}
  4247. All the
  4248. \fBfile1\fR
  4249. files in the output refer to files before the commit, and all the
  4250. \fBfile2\fR
  4251. files refer to files after the commit\&. It is incorrect to apply each change to each file sequentially\&. For example, this patch will swap a and b:
  4252. .sp
  4253. .if n \{\
  4254. .RS 4
  4255. .\}
  4256. .nf
  4257. diff \-\-git a/a b/b
  4258. rename from a
  4259. rename to b
  4260. diff \-\-git a/b b/a
  4261. rename from b
  4262. rename to a
  4263. .fi
  4264. .if n \{\
  4265. .RE
  4266. .\}
  4267. .RE
  4268. .sp
  4269. .RS 4
  4270. .ie n \{\
  4271. \h'-04' 5.\h'+01'\c
  4272. .\}
  4273. .el \{\
  4274. .sp -1
  4275. .IP " 5." 4.2
  4276. .\}
  4277. Hunk headers mention the name of the function to which the hunk applies\&. See "Defining a custom hunk\-header" in
  4278. \fBgitattributes\fR(5)
  4279. for details of how to tailor this to specific languages\&.
  4280. .RE
  4281. .SH "COMBINED DIFF FORMAT"
  4282. .sp
  4283. Any diff\-generating command can take the \fB\-c\fR or \fB\-\-cc\fR option to produce a \fIcombined diff\fR when showing a merge\&. This is the default format when showing merges with \fBgit-diff\fR(1) or \fBgit-show\fR(1)\&. Note also that you can give suitable \fB\-\-diff\-merges\fR option to any of these commands to force generation of diffs in a specific format\&.
  4284. .sp
  4285. A "combined diff" format looks like this:
  4286. .sp
  4287. .if n \{\
  4288. .RS 4
  4289. .\}
  4290. .nf
  4291. diff \-\-combined describe\&.c
  4292. index fabadb8,cc95eb0\&.\&.4866510
  4293. \-\-\- a/describe\&.c
  4294. +++ b/describe\&.c
  4295. @@@ \-98,20 \-98,12 +98,20 @@@
  4296. return (a_date > b_date) ? \-1 : (a_date == b_date) ? 0 : 1;
  4297. }
  4298. \- static void describe(char *arg)
  4299. \-static void describe(struct commit *cmit, int last_one)
  4300. ++static void describe(char *arg, int last_one)
  4301. {
  4302. + unsigned char sha1[20];
  4303. + struct commit *cmit;
  4304. struct commit_list *list;
  4305. static int initialized = 0;
  4306. struct commit_name *n;
  4307. + if (get_sha1(arg, sha1) < 0)
  4308. + usage(describe_usage);
  4309. + cmit = lookup_commit_reference(sha1);
  4310. + if (!cmit)
  4311. + usage(describe_usage);
  4312. +
  4313. if (!initialized) {
  4314. initialized = 1;
  4315. for_each_ref(get_name);
  4316. .fi
  4317. .if n \{\
  4318. .RE
  4319. .\}
  4320. .sp
  4321. .RS 4
  4322. .ie n \{\
  4323. \h'-04' 1.\h'+01'\c
  4324. .\}
  4325. .el \{\
  4326. .sp -1
  4327. .IP " 1." 4.2
  4328. .\}
  4329. It is preceded by a "git diff" header, that looks like this (when the
  4330. \fB\-c\fR
  4331. option is used):
  4332. .sp
  4333. .if n \{\
  4334. .RS 4
  4335. .\}
  4336. .nf
  4337. diff \-\-combined file
  4338. .fi
  4339. .if n \{\
  4340. .RE
  4341. .\}
  4342. .sp
  4343. or like this (when the
  4344. \fB\-\-cc\fR
  4345. option is used):
  4346. .sp
  4347. .if n \{\
  4348. .RS 4
  4349. .\}
  4350. .nf
  4351. diff \-\-cc file
  4352. .fi
  4353. .if n \{\
  4354. .RE
  4355. .\}
  4356. .RE
  4357. .sp
  4358. .RS 4
  4359. .ie n \{\
  4360. \h'-04' 2.\h'+01'\c
  4361. .\}
  4362. .el \{\
  4363. .sp -1
  4364. .IP " 2." 4.2
  4365. .\}
  4366. It is followed by one or more extended header lines (this example shows a merge with two parents):
  4367. .sp
  4368. .if n \{\
  4369. .RS 4
  4370. .\}
  4371. .nf
  4372. \fBindex\fR \fI<hash>\fR\fB,\fR\fI<hash>\fR`\&.\&.\fB__\fR\fI<hash>\fR\fB__\fR
  4373. {empty}`mode \fI<mode>\fR\fB,\fR\fI<mode>\fR``\&.\&.``\fI<mode>\fR
  4374. \fBnew\fR \fBfile\fR \fBmode\fR \fI<mode>\fR
  4375. \fBdeleted\fR \fBfile\fR \fBmode\fR \fI<mode>\fR\fB,\fR\fI<mode>\fR
  4376. .fi
  4377. .if n \{\
  4378. .RE
  4379. .\}
  4380. The
  4381. \fBmode\fR
  4382. \fI<mode>\fR\fB,\fR\fI<mode>\fR\fB\&.\&.\fR\fI<mode>\fR
  4383. line appears only if at least one of the <mode> is different from the rest\&. Extended headers with information about detected content movement (renames and copying detection) are designed to work with the diff of two
  4384. \fI<tree\-ish>\fR
  4385. and are not used by combined diff format\&.
  4386. .RE
  4387. .sp
  4388. .RS 4
  4389. .ie n \{\
  4390. \h'-04' 3.\h'+01'\c
  4391. .\}
  4392. .el \{\
  4393. .sp -1
  4394. .IP " 3." 4.2
  4395. .\}
  4396. It is followed by a two\-line from\-file/to\-file header:
  4397. .sp
  4398. .if n \{\
  4399. .RS 4
  4400. .\}
  4401. .nf
  4402. \-\-\- a/file
  4403. +++ b/file
  4404. .fi
  4405. .if n \{\
  4406. .RE
  4407. .\}
  4408. .sp
  4409. Similar to the two\-line header for the traditional
  4410. \fIunified\fR
  4411. diff format,
  4412. \fB/dev/null\fR
  4413. is used to signal created or deleted files\&.
  4414. .sp
  4415. However, if the \-\-combined\-all\-paths option is provided, instead of a two\-line from\-file/to\-file, you get an N+1 line from\-file/to\-file header, where N is the number of parents in the merge commit:
  4416. .sp
  4417. .if n \{\
  4418. .RS 4
  4419. .\}
  4420. .nf
  4421. \-\-\- a/file
  4422. \-\-\- a/file
  4423. \-\-\- a/file
  4424. +++ b/file
  4425. .fi
  4426. .if n \{\
  4427. .RE
  4428. .\}
  4429. .sp
  4430. This extended format can be useful if rename or copy detection is active, to allow you to see the original name of the file in different parents\&.
  4431. .RE
  4432. .sp
  4433. .RS 4
  4434. .ie n \{\
  4435. \h'-04' 4.\h'+01'\c
  4436. .\}
  4437. .el \{\
  4438. .sp -1
  4439. .IP " 4." 4.2
  4440. .\}
  4441. Chunk header format is modified to prevent people from accidentally feeding it to
  4442. \fBpatch\fR
  4443. \fB\-p1\fR\&. Combined diff format was created for review of merge commit changes, and was not meant to be applied\&. The change is similar to the change in the extended
  4444. \fIindex\fR
  4445. header:
  4446. .sp
  4447. .if n \{\
  4448. .RS 4
  4449. .\}
  4450. .nf
  4451. @@@ <from\-file\-range> <from\-file\-range> <to\-file\-range> @@@
  4452. .fi
  4453. .if n \{\
  4454. .RE
  4455. .\}
  4456. .sp
  4457. There are (number of parents + 1)
  4458. \fB@\fR
  4459. characters in the chunk header for combined diff format\&.
  4460. .RE
  4461. .sp
  4462. Unlike the traditional \fIunified\fR diff format, which shows two files A and B with a single column that has \fB\-\fR (minus \(em appears in A but removed in B), \fB+\fR (plus \(em missing in A but added to B), or " " (space \(em unchanged) prefix, this format compares two or more files file1, file2,\&...\: with one file X, and shows how X differs from each of fileN\&. One column for each of fileN is prepended to the output line to note how X\(cqs line is different from it\&.
  4463. .sp
  4464. A \fB\-\fR character in the column N means that the line appears in fileN but it does not appear in the result\&. A \fB+\fR character in the column N means that the line appears in the result, and fileN does not have that line (in other words, the line was added, from the point of view of that parent)\&.
  4465. .sp
  4466. In the above example output, the function signature was changed from both files (hence two \fB\-\fR removals from both file1 and file2, plus \fB++\fR to mean one line that was added does not appear in either file1 or file2)\&. Also, eight other lines are the same from file1 but do not appear in file2 (hence prefixed with \fB+\fR)\&.
  4467. .sp
  4468. When shown by \fBgit\fR \fBdiff\-tree\fR \fB\-c\fR, it compares the parents of a merge commit with the merge result (i\&.e\&. file1\&.\&.fileN are the parents)\&. When shown by \fBgit\fR \fBdiff\-files\fR \fB\-c\fR, it compares the two unresolved merge parents with the working tree file (i\&.e\&. file1 is stage 2 aka "our version", file2 is stage 3 aka "their version")\&.
  4469. .SH "EXAMPLES"
  4470. .PP
  4471. \fBgit\fR \fBlog\fR \fB\-\-no\-merges\fR
  4472. .RS 4
  4473. Show the whole commit history, but skip any merges
  4474. .RE
  4475. .PP
  4476. \fBgit\fR \fBlog\fR \fBv2\&.6\&.12\fR\fB\&.\&.\fR \fBinclude/scsi\fR \fBdrivers/scsi\fR
  4477. .RS 4
  4478. Show all commits since version
  4479. \fIv2\&.6\&.12\fR
  4480. that changed any file in the
  4481. \fBinclude/scsi\fR
  4482. or
  4483. \fBdrivers/scsi\fR
  4484. subdirectories
  4485. .RE
  4486. .PP
  4487. \fBgit\fR \fBlog\fR \fB\-\-since=\fR"2 \fBweeks\fR \fBago\fR" \fB\-\-\fR \fBgitk\fR
  4488. .RS 4
  4489. Show the changes during the last two weeks to the file
  4490. \fIgitk\fR\&. The
  4491. \fB\-\-\fR
  4492. is necessary to avoid confusion with the
  4493. \fBbranch\fR
  4494. named
  4495. \fIgitk\fR
  4496. .RE
  4497. .PP
  4498. \fBgit\fR \fBlog\fR \fB\-\-name\-status\fR \fBrelease\fR\fB\&.\&.\fR\fBtest\fR
  4499. .RS 4
  4500. Show the commits that are in the "test" branch but not yet in the "release" branch, along with the list of paths each commit modifies\&.
  4501. .RE
  4502. .PP
  4503. \fBgit\fR \fBlog\fR \fB\-\-follow\fR \fBbuiltin/rev\-list\&.c\fR
  4504. .RS 4
  4505. Shows the commits that changed
  4506. \fBbuiltin/rev\-list\&.c\fR, including those commits that occurred before the file was given its present name\&.
  4507. .RE
  4508. .PP
  4509. \fBgit\fR \fBlog\fR \fB\-\-branches\fR \fB\-\-not\fR \fB\-\-remotes=origin\fR
  4510. .RS 4
  4511. Shows all commits that are in any of local branches but not in any of remote\-tracking branches for
  4512. \fIorigin\fR
  4513. (what you have that origin doesn\(cqt)\&.
  4514. .RE
  4515. .PP
  4516. \fBgit\fR \fBlog\fR \fBmaster\fR \fB\-\-not\fR \fB\-\-remotes=\fR*/master
  4517. .RS 4
  4518. Shows all commits that are in local master but not in any remote repository master branches\&.
  4519. .RE
  4520. .PP
  4521. \fBgit\fR \fBlog\fR \fB\-p\fR \fB\-m\fR \fB\-\-first\-parent\fR
  4522. .RS 4
  4523. Shows the history including change diffs, but only from the
  4524. \(lqmain branch\(rq
  4525. perspective, skipping commits that come from merged branches, and showing full diffs of changes introduced by the merges\&. This makes sense only when following a strict policy of merging all topic branches when staying on a single integration branch\&.
  4526. .RE
  4527. .PP
  4528. \fBgit\fR \fBlog\fR \fB\-L\fR \*(Aq/int \fBmain/\fR\*(Aq,/^}/:main\&.\fBc\fR
  4529. .RS 4
  4530. Shows how the function
  4531. \fBmain\fR() in the file
  4532. \fBmain\&.c\fR
  4533. evolved over time\&.
  4534. .RE
  4535. .PP
  4536. \fBgit\fR \fBlog\fR \fB\-3\fR
  4537. .RS 4
  4538. Limits the number of commits to show to 3\&.
  4539. .RE
  4540. .SH "DISCUSSION"
  4541. .sp
  4542. Git is to some extent character encoding agnostic\&.
  4543. .sp
  4544. .RS 4
  4545. .ie n \{\
  4546. \h'-04'\(bu\h'+03'\c
  4547. .\}
  4548. .el \{\
  4549. .sp -1
  4550. .IP \(bu 2.3
  4551. .\}
  4552. The contents of the blob objects are uninterpreted sequences of bytes\&. There is no encoding translation at the core level\&.
  4553. .RE
  4554. .sp
  4555. .RS 4
  4556. .ie n \{\
  4557. \h'-04'\(bu\h'+03'\c
  4558. .\}
  4559. .el \{\
  4560. .sp -1
  4561. .IP \(bu 2.3
  4562. .\}
  4563. Path names are encoded in UTF\-8 normalization form C\&. This applies to tree objects, the index file, ref names, as well as path names in command line arguments, environment variables and config files (\&.\fBgit/config\fR
  4564. (see
  4565. \fBgit-config\fR(1)),
  4566. \fBgitignore\fR(5),
  4567. \fBgitattributes\fR(5)
  4568. and
  4569. \fBgitmodules\fR(5))\&.
  4570. .sp
  4571. Note that Git at the core level treats path names simply as sequences of non\-NUL bytes, there are no path name encoding conversions (except on Mac and Windows)\&. Therefore, using non\-ASCII path names will mostly work even on platforms and file systems that use legacy extended ASCII encodings\&. However, repositories created on such systems will not work properly on UTF\-8\-based systems (e\&.g\&. Linux, Mac, Windows) and vice versa\&. Additionally, many Git\-based tools simply assume path names to be UTF\-8 and will fail to display other encodings correctly\&.
  4572. .RE
  4573. .sp
  4574. .RS 4
  4575. .ie n \{\
  4576. \h'-04'\(bu\h'+03'\c
  4577. .\}
  4578. .el \{\
  4579. .sp -1
  4580. .IP \(bu 2.3
  4581. .\}
  4582. Commit log messages are typically encoded in UTF\-8, but other extended ASCII encodings are also supported\&. This includes ISO\-8859\-x, CP125x and many others, but
  4583. \fInot\fR
  4584. UTF\-16/32, EBCDIC and CJK multi\-byte encodings (GBK, Shift\-JIS, Big5, EUC\-x, CP9xx etc\&.)\&.
  4585. .RE
  4586. .sp
  4587. Although we encourage that the commit log messages are encoded in UTF\-8, both the core and Git Porcelain are designed not to force UTF\-8 on projects\&. If all participants of a particular project find it more convenient to use legacy encodings, Git does not forbid it\&. However, there are a few things to keep in mind\&.
  4588. .sp
  4589. .RS 4
  4590. .ie n \{\
  4591. \h'-04' 1.\h'+01'\c
  4592. .\}
  4593. .el \{\
  4594. .sp -1
  4595. .IP " 1." 4.2
  4596. .\}
  4597. \fBgit\fR
  4598. \fBcommit\fR
  4599. and
  4600. \fBgit\fR
  4601. \fBcommit\-tree\fR
  4602. issue a warning if the commit log message given to it does not look like a valid UTF\-8 string, unless you explicitly say your project uses a legacy encoding\&. The way to say this is to have
  4603. \fBi18n\&.commitEncoding\fR
  4604. in \&.\fBgit/config\fR
  4605. file, like this:
  4606. .sp
  4607. .if n \{\
  4608. .RS 4
  4609. .\}
  4610. .nf
  4611. [i18n]
  4612. commitEncoding = ISO\-8859\-1
  4613. .fi
  4614. .if n \{\
  4615. .RE
  4616. .\}
  4617. .sp
  4618. Commit objects created with the above setting record the value of
  4619. \fBi18n\&.commitEncoding\fR
  4620. in their
  4621. \fBencoding\fR
  4622. header\&. This is to help other people who look at them later\&. Lack of this header implies that the commit log message is encoded in UTF\-8\&.
  4623. .RE
  4624. .sp
  4625. .RS 4
  4626. .ie n \{\
  4627. \h'-04' 2.\h'+01'\c
  4628. .\}
  4629. .el \{\
  4630. .sp -1
  4631. .IP " 2." 4.2
  4632. .\}
  4633. \fBgit\fR
  4634. \fBlog\fR,
  4635. \fBgit\fR
  4636. \fBshow\fR,
  4637. \fBgit\fR
  4638. \fBblame\fR
  4639. and friends look at the
  4640. \fBencoding\fR
  4641. header of a commit object, and try to re\-code the log message into UTF\-8 unless otherwise specified\&. You can specify the desired output encoding with
  4642. \fBi18n\&.logOutputEncoding\fR
  4643. in \&.\fBgit/config\fR
  4644. file, like this:
  4645. .sp
  4646. .if n \{\
  4647. .RS 4
  4648. .\}
  4649. .nf
  4650. [i18n]
  4651. logOutputEncoding = ISO\-8859\-1
  4652. .fi
  4653. .if n \{\
  4654. .RE
  4655. .\}
  4656. .sp
  4657. If you do not have this configuration variable, the value of
  4658. \fBi18n\&.commitEncoding\fR
  4659. is used instead\&.
  4660. .RE
  4661. .sp
  4662. Note that we deliberately chose not to re\-code the commit log message when a commit is made to force UTF\-8 at the commit object level, because re\-coding to UTF\-8 is not necessarily a reversible operation\&.
  4663. .SH "CONFIGURATION"
  4664. .sp
  4665. See \fBgit-config\fR(1) for core variables and \fBgit-diff\fR(1) for settings related to diff generation\&.
  4666. .PP
  4667. format\&.pretty
  4668. .RS 4
  4669. Default for the
  4670. \fB\-\-format\fR
  4671. option\&. (See
  4672. \fIPretty Formats\fR
  4673. above\&.) Defaults to
  4674. \fBmedium\fR\&.
  4675. .RE
  4676. .PP
  4677. i18n\&.logOutputEncoding
  4678. .RS 4
  4679. Encoding to use when displaying logs\&. (See
  4680. \fIDiscussion\fR
  4681. above\&.) Defaults to the value of
  4682. \fBi18n\&.commitEncoding\fR
  4683. if set, and UTF\-8 otherwise\&.
  4684. .RE
  4685. .sp
  4686. Everything above this line in this section isn\(cqt included from the \fBgit-config\fR(1) documentation\&. The content that follows is the same as what\(cqs found there:
  4687. .PP
  4688. log\&.abbrevCommit
  4689. .RS 4
  4690. If true, makes
  4691. \fBgit-log\fR(1),
  4692. \fBgit-show\fR(1), and
  4693. \fBgit-whatchanged\fR(1)
  4694. assume
  4695. \fB\-\-abbrev\-commit\fR\&. You may override this option with
  4696. \fB\-\-no\-abbrev\-commit\fR\&.
  4697. .RE
  4698. .PP
  4699. log\&.date
  4700. .RS 4
  4701. Set the default date\-time mode for the
  4702. \fIlog\fR
  4703. command\&. Setting a value for log\&.date is similar to using
  4704. \fIgit log\fR\*(Aqs
  4705. \fB\-\-date\fR
  4706. option\&. See
  4707. \fBgit-log\fR(1)
  4708. for details\&.
  4709. .sp
  4710. If the format is set to "auto:foo" and the pager is in use, format "foo" will be used for the date format\&. Otherwise, "default" will be used\&.
  4711. .RE
  4712. .PP
  4713. log\&.decorate
  4714. .RS 4
  4715. Print out the ref names of any commits that are shown by the log command\&. If
  4716. \fIshort\fR
  4717. is specified, the ref name prefixes
  4718. \fIrefs/heads/\fR,
  4719. \fIrefs/tags/\fR
  4720. and
  4721. \fIrefs/remotes/\fR
  4722. will not be printed\&. If
  4723. \fIfull\fR
  4724. is specified, the full ref name (including prefix) will be printed\&. If
  4725. \fIauto\fR
  4726. is specified, then if the output is going to a terminal, the ref names are shown as if
  4727. \fIshort\fR
  4728. were given, otherwise no ref names are shown\&. This is the same as the
  4729. \fB\-\-decorate\fR
  4730. option of the
  4731. \fBgit\fR
  4732. \fBlog\fR\&.
  4733. .RE
  4734. .PP
  4735. log\&.initialDecorationSet
  4736. .RS 4
  4737. By default,
  4738. \fBgit\fR
  4739. \fBlog\fR
  4740. only shows decorations for certain known ref namespaces\&. If
  4741. \fIall\fR
  4742. is specified, then show all refs as decorations\&.
  4743. .RE
  4744. .PP
  4745. log\&.excludeDecoration
  4746. .RS 4
  4747. Exclude the specified patterns from the log decorations\&. This is similar to the
  4748. \fB\-\-decorate\-refs\-exclude\fR
  4749. command\-line option, but the config option can be overridden by the
  4750. \fB\-\-decorate\-refs\fR
  4751. option\&.
  4752. .RE
  4753. .PP
  4754. log\&.diffMerges
  4755. .RS 4
  4756. Set diff format to be used when
  4757. \fB\-\-diff\-merges=on\fR
  4758. is specified, see
  4759. \fB\-\-diff\-merges\fR
  4760. in
  4761. \fBgit-log\fR(1)
  4762. for details\&. Defaults to
  4763. \fBseparate\fR\&.
  4764. .RE
  4765. .PP
  4766. log\&.follow
  4767. .RS 4
  4768. If
  4769. \fBtrue\fR,
  4770. \fBgit\fR
  4771. \fBlog\fR
  4772. will act as if the
  4773. \fB\-\-follow\fR
  4774. option was used when a single <path> is given\&. This has the same limitations as
  4775. \fB\-\-follow\fR, i\&.e\&. it cannot be used to follow multiple files and does not work well on non\-linear history\&.
  4776. .RE
  4777. .PP
  4778. log\&.graphColors
  4779. .RS 4
  4780. A list of colors, separated by commas, that can be used to draw history lines in
  4781. \fBgit\fR
  4782. \fBlog\fR
  4783. \fB\-\-graph\fR\&.
  4784. .RE
  4785. .PP
  4786. log\&.showRoot
  4787. .RS 4
  4788. If true, the initial commit will be shown as a big creation event\&. This is equivalent to a diff against an empty tree\&. Tools like
  4789. \fBgit-log\fR(1)
  4790. or
  4791. \fBgit-whatchanged\fR(1), which normally hide the root commit will now show it\&. True by default\&.
  4792. .RE
  4793. .PP
  4794. log\&.showSignature
  4795. .RS 4
  4796. If true, makes
  4797. \fBgit-log\fR(1),
  4798. \fBgit-show\fR(1), and
  4799. \fBgit-whatchanged\fR(1)
  4800. assume
  4801. \fB\-\-show\-signature\fR\&.
  4802. .RE
  4803. .PP
  4804. log\&.mailmap
  4805. .RS 4
  4806. If true, makes
  4807. \fBgit-log\fR(1),
  4808. \fBgit-show\fR(1), and
  4809. \fBgit-whatchanged\fR(1)
  4810. assume
  4811. \fB\-\-use\-mailmap\fR, otherwise assume
  4812. \fB\-\-no\-use\-mailmap\fR\&. True by default\&.
  4813. .RE
  4814. .PP
  4815. \fBnotes\&.mergeStrategy\fR
  4816. .RS 4
  4817. Which merge strategy to choose by default when resolving notes conflicts\&. Must be one of
  4818. \fBmanual\fR,
  4819. \fBours\fR,
  4820. \fBtheirs\fR,
  4821. \fBunion\fR, or
  4822. \fBcat_sort_uniq\fR\&. Defaults to
  4823. \fBmanual\fR\&. See the "NOTES MERGE STRATEGIES" section of
  4824. \fBgit-notes\fR(1)
  4825. for more information on each strategy\&.
  4826. .sp
  4827. This setting can be overridden by passing the
  4828. \fB\-\-strategy\fR
  4829. option to
  4830. \fBgit-notes\fR(1)\&.
  4831. .RE
  4832. .PP
  4833. \fBnotes\&.\fR\fI<name>\fR\fB\&.mergeStrategy\fR
  4834. .RS 4
  4835. Which merge strategy to choose when doing a notes merge into
  4836. \fBrefs/notes/\fR\fI<name>\fR\&. This overrides the more general
  4837. \fBnotes\&.mergeStrategy\fR\&. See the "NOTES MERGE STRATEGIES" section in
  4838. \fBgit-notes\fR(1)
  4839. for more information on the available strategies\&.
  4840. .RE
  4841. .PP
  4842. \fBnotes\&.displayRef\fR
  4843. .RS 4
  4844. Which ref (or refs, if a glob or specified more than once), in addition to the default set by
  4845. \fBcore\&.notesRef\fR
  4846. or
  4847. \fBGIT_NOTES_REF\fR, to read notes from when showing commit messages with the
  4848. \fBgit\fR
  4849. \fBlog\fR
  4850. family of commands\&.
  4851. .sp
  4852. This setting can be overridden with the
  4853. \fBGIT_NOTES_DISPLAY_REF\fR
  4854. environment variable, which must be a colon separated list of refs or globs\&.
  4855. .sp
  4856. A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored\&.
  4857. .sp
  4858. This setting can be disabled by the
  4859. \fB\-\-no\-notes\fR
  4860. option to the
  4861. \fBgit-log\fR(1)
  4862. family of commands, or by the
  4863. \fB\-\-notes=\fR\fI<ref>\fR
  4864. option accepted by those commands\&.
  4865. .sp
  4866. The effective value of
  4867. \fBcore\&.notesRef\fR
  4868. (possibly overridden by
  4869. \fBGIT_NOTES_REF\fR) is also implicitly added to the list of refs to be displayed\&.
  4870. .RE
  4871. .PP
  4872. \fBnotes\&.rewrite\&.\fR\fI<command>\fR
  4873. .RS 4
  4874. When rewriting commits with
  4875. \fI<command>\fR
  4876. (currently
  4877. \fBamend\fR
  4878. or
  4879. \fBrebase\fR), if this variable is
  4880. \fBfalse\fR, git will not copy notes from the original to the rewritten commit\&. Defaults to
  4881. \fBtrue\fR\&. See also
  4882. \fBnotes\&.rewriteRef\fR
  4883. below\&.
  4884. .sp
  4885. This setting can be overridden with the
  4886. \fBGIT_NOTES_REWRITE_REF\fR
  4887. environment variable, which must be a colon separated list of refs or globs\&.
  4888. .RE
  4889. .PP
  4890. \fBnotes\&.rewriteMode\fR
  4891. .RS 4
  4892. When copying notes during a rewrite (see the
  4893. \fBnotes\&.rewrite\&.\fR\fI<command>\fR
  4894. option), determines what to do if the target commit already has a note\&. Must be one of
  4895. \fBoverwrite\fR,
  4896. \fBconcatenate\fR,
  4897. \fBcat_sort_uniq\fR, or
  4898. \fBignore\fR\&. Defaults to
  4899. \fBconcatenate\fR\&.
  4900. .sp
  4901. This setting can be overridden with the
  4902. \fBGIT_NOTES_REWRITE_MODE\fR
  4903. environment variable\&.
  4904. .RE
  4905. .PP
  4906. \fBnotes\&.rewriteRef\fR
  4907. .RS 4
  4908. When copying notes during a rewrite, specifies the (fully qualified) ref whose notes should be copied\&. May be a glob, in which case notes in all matching refs will be copied\&. You may also specify this configuration several times\&.
  4909. .sp
  4910. Does not have a default value; you must configure this variable to enable note rewriting\&. Set it to
  4911. \fBrefs/notes/commits\fR
  4912. to enable rewriting for the default commit notes\&.
  4913. .sp
  4914. Can be overridden with the
  4915. \fBGIT_NOTES_REWRITE_REF\fR
  4916. environment variable\&. See
  4917. \fBnotes\&.rewrite\&.\fR\fI<command>\fR
  4918. above for a further description of its format\&.
  4919. .RE
  4920. .SH "GIT"
  4921. .sp
  4922. Part of the \fBgit\fR(1) suite