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-rev-list.1 (83267B)


  1. '\" t
  2. .\" Title: git-rev-list
  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\-REV\-LIST" "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-rev-list \- Lists commit objects in reverse chronological order
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit rev\-list\fR [<options>] <commit>\&...\: [\-\-] [<path>\&...\:]
  36. .fi
  37. .SH "DESCRIPTION"
  38. .sp
  39. 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\&.
  40. .sp
  41. 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\&.
  42. .sp
  43. Thus, the following command:
  44. .sp
  45. .if n \{\
  46. .RS 4
  47. .\}
  48. .nf
  49. $ git rev\-list foo bar ^baz
  50. .fi
  51. .if n \{\
  52. .RE
  53. .\}
  54. .sp
  55. means "list all the commits which are reachable from \fIfoo\fR or \fIbar\fR, but not from \fIbaz\fR"\&.
  56. .sp
  57. 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:
  58. .sp
  59. .if n \{\
  60. .RS 4
  61. .\}
  62. .nf
  63. $ git rev\-list origin\&.\&.HEAD
  64. $ git rev\-list HEAD ^origin
  65. .fi
  66. .if n \{\
  67. .RE
  68. .\}
  69. .sp
  70. 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:
  71. .sp
  72. .if n \{\
  73. .RS 4
  74. .\}
  75. .nf
  76. $ git rev\-list A B \-\-not $(git merge\-base \-\-all A B)
  77. $ git rev\-list A\&.\&.\&.B
  78. .fi
  79. .if n \{\
  80. .RE
  81. .\}
  82. .sp
  83. \fIrev\-list\fR is an essential Git command, since it provides the ability to build and traverse commit ancestry graphs\&. For this reason, it has a lot of different options that enable it to be used by commands as different as \fIgit bisect\fR and \fIgit repack\fR\&.
  84. .SH "OPTIONS"
  85. .SS "Commit Limiting"
  86. .sp
  87. Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
  88. .sp
  89. 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\&.
  90. .sp
  91. Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
  92. .PP
  93. \-<number>, \-n <number>, \-\-max\-count=<number>
  94. .RS 4
  95. Limit the number of commits to output\&.
  96. .RE
  97. .PP
  98. \-\-skip=<number>
  99. .RS 4
  100. Skip
  101. \fInumber\fR
  102. commits before starting to show the commit output\&.
  103. .RE
  104. .PP
  105. \-\-since=<date>, \-\-after=<date>
  106. .RS 4
  107. Show commits more recent than a specific date\&.
  108. .RE
  109. .PP
  110. \-\-since\-as\-filter=<date>
  111. .RS 4
  112. 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\&.
  113. .RE
  114. .PP
  115. \-\-until=<date>, \-\-before=<date>
  116. .RS 4
  117. Show commits older than a specific date\&.
  118. .RE
  119. .PP
  120. \-\-max\-age=<timestamp>, \-\-min\-age=<timestamp>
  121. .RS 4
  122. Limit the commits output to specified time range\&.
  123. .RE
  124. .PP
  125. \-\-author=<pattern>, \-\-committer=<pattern>
  126. .RS 4
  127. Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
  128. \fB\-\-author=\fR\fI<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
  129. \fB\-\-committer=\fR\fI<pattern>\fR)\&.
  130. .RE
  131. .PP
  132. \-\-grep\-reflog=<pattern>
  133. .RS 4
  134. Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
  135. \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
  136. \fB\-\-walk\-reflogs\fR
  137. is in use\&.
  138. .RE
  139. .PP
  140. \-\-grep=<pattern>
  141. .RS 4
  142. Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
  143. \fB\-\-grep=\fR\fI<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
  144. \fB\-\-all\-match\fR)\&.
  145. .RE
  146. .PP
  147. \-\-all\-match
  148. .RS 4
  149. Limit the commits output to ones that match all given
  150. \fB\-\-grep\fR, instead of ones that match at least one\&.
  151. .RE
  152. .PP
  153. \-\-invert\-grep
  154. .RS 4
  155. Limit the commits output to ones with a log message that do not match the pattern specified with
  156. \fB\-\-grep=\fR\fI<pattern>\fR\&.
  157. .RE
  158. .PP
  159. \-i, \-\-regexp\-ignore\-case
  160. .RS 4
  161. Match the regular expression limiting patterns without regard to letter case\&.
  162. .RE
  163. .PP
  164. \-\-basic\-regexp
  165. .RS 4
  166. Consider the limiting patterns to be basic regular expressions; this is the default\&.
  167. .RE
  168. .PP
  169. \-E, \-\-extended\-regexp
  170. .RS 4
  171. Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
  172. .RE
  173. .PP
  174. \-F, \-\-fixed\-strings
  175. .RS 4
  176. Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
  177. .RE
  178. .PP
  179. \-P, \-\-perl\-regexp
  180. .RS 4
  181. Consider the limiting patterns to be Perl\-compatible regular expressions\&.
  182. .sp
  183. 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\&.
  184. .RE
  185. .PP
  186. \-\-remove\-empty
  187. .RS 4
  188. Stop when a given path disappears from the tree\&.
  189. .RE
  190. .PP
  191. \-\-merges
  192. .RS 4
  193. Print only merge commits\&. This is exactly the same as
  194. \fB\-\-min\-parents=2\fR\&.
  195. .RE
  196. .PP
  197. \-\-no\-merges
  198. .RS 4
  199. Do not print commits with more than one parent\&. This is exactly the same as
  200. \fB\-\-max\-parents=1\fR\&.
  201. .RE
  202. .PP
  203. \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
  204. .RS 4
  205. Show only commits which have at least (or at most) that many parent commits\&. In particular,
  206. \fB\-\-max\-parents=1\fR
  207. is the same as
  208. \fB\-\-no\-merges\fR,
  209. \fB\-\-min\-parents=2\fR
  210. is the same as
  211. \fB\-\-merges\fR\&.
  212. \fB\-\-max\-parents=0\fR
  213. gives all root commits and
  214. \fB\-\-min\-parents=3\fR
  215. all octopus merges\&.
  216. .sp
  217. \fB\-\-no\-min\-parents\fR
  218. and
  219. \fB\-\-no\-max\-parents\fR
  220. reset these limits (to no limit) again\&. Equivalent forms are
  221. \fB\-\-min\-parents=0\fR
  222. (any commit has 0 or more parents) and
  223. \fB\-\-max\-parents=\-1\fR
  224. (negative numbers denote no upper limit)\&.
  225. .RE
  226. .PP
  227. \-\-first\-parent
  228. .RS 4
  229. 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\&.
  230. .RE
  231. .PP
  232. \-\-exclude\-first\-parent\-only
  233. .RS 4
  234. When finding commits to exclude (with a
  235. \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\&.
  236. .RE
  237. .PP
  238. \-\-not
  239. .RS 4
  240. Reverses the meaning of the
  241. \fI^\fR
  242. prefix (or lack thereof) for all following revision specifiers, up to the next
  243. \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\&.
  244. .RE
  245. .PP
  246. \-\-all
  247. .RS 4
  248. Pretend as if all the refs in
  249. \fBrefs/\fR, along with
  250. \fBHEAD\fR, are listed on the command line as
  251. \fI<commit>\fR\&.
  252. .RE
  253. .PP
  254. \-\-branches[=<pattern>]
  255. .RS 4
  256. Pretend as if all the refs in
  257. \fBrefs/heads\fR
  258. are listed on the command line as
  259. \fI<commit>\fR\&. If
  260. \fI<pattern>\fR
  261. is given, limit branches to ones matching given shell glob\&. If pattern lacks
  262. \fI?\fR,
  263. \fI*\fR, or
  264. \fI[\fR,
  265. \fI/*\fR
  266. at the end is implied\&.
  267. .RE
  268. .PP
  269. \-\-tags[=<pattern>]
  270. .RS 4
  271. Pretend as if all the refs in
  272. \fBrefs/tags\fR
  273. are listed on the command line as
  274. \fI<commit>\fR\&. If
  275. \fI<pattern>\fR
  276. is given, limit tags to ones matching given shell glob\&. If pattern lacks
  277. \fI?\fR,
  278. \fI*\fR, or
  279. \fI[\fR,
  280. \fI/*\fR
  281. at the end is implied\&.
  282. .RE
  283. .PP
  284. \-\-remotes[=<pattern>]
  285. .RS 4
  286. Pretend as if all the refs in
  287. \fBrefs/remotes\fR
  288. are listed on the command line as
  289. \fI<commit>\fR\&. If
  290. \fI<pattern>\fR
  291. is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
  292. \fI?\fR,
  293. \fI*\fR, or
  294. \fI[\fR,
  295. \fI/*\fR
  296. at the end is implied\&.
  297. .RE
  298. .PP
  299. \-\-glob=<glob\-pattern>
  300. .RS 4
  301. Pretend as if all the refs matching shell glob
  302. \fI<glob\-pattern>\fR
  303. are listed on the command line as
  304. \fI<commit>\fR\&. Leading
  305. \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
  306. \fI?\fR,
  307. \fI*\fR, or
  308. \fI[\fR,
  309. \fI/*\fR
  310. at the end is implied\&.
  311. .RE
  312. .PP
  313. \-\-exclude=<glob\-pattern>
  314. .RS 4
  315. Do not include refs matching
  316. \fI<glob\-pattern>\fR
  317. that the next
  318. \fB\-\-all\fR,
  319. \fB\-\-branches\fR,
  320. \fB\-\-tags\fR,
  321. \fB\-\-remotes\fR, or
  322. \fB\-\-glob\fR
  323. would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
  324. \fB\-\-all\fR,
  325. \fB\-\-branches\fR,
  326. \fB\-\-tags\fR,
  327. \fB\-\-remotes\fR, or
  328. \fB\-\-glob\fR
  329. option (other options or arguments do not clear accumulated patterns)\&.
  330. .sp
  331. The patterns given should not begin with
  332. \fBrefs/heads\fR,
  333. \fBrefs/tags\fR, or
  334. \fBrefs/remotes\fR
  335. when applied to
  336. \fB\-\-branches\fR,
  337. \fB\-\-tags\fR, or
  338. \fB\-\-remotes\fR, respectively, and they must begin with
  339. \fBrefs/\fR
  340. when applied to
  341. \fB\-\-glob\fR
  342. or
  343. \fB\-\-all\fR\&. If a trailing
  344. \fI/*\fR
  345. is intended, it must be given explicitly\&.
  346. .RE
  347. .PP
  348. \-\-exclude\-hidden=[fetch|receive|uploadpack]
  349. .RS 4
  350. Do not include refs that would be hidden by
  351. \fBgit\-fetch\fR,
  352. \fBgit\-receive\-pack\fR
  353. or
  354. \fBgit\-upload\-pack\fR
  355. by consulting the appropriate
  356. \fBfetch\&.hideRefs\fR,
  357. \fBreceive\&.hideRefs\fR
  358. or
  359. \fBuploadpack\&.hideRefs\fR
  360. configuration along with
  361. \fBtransfer\&.hideRefs\fR
  362. (see
  363. \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
  364. \fB\-\-all\fR
  365. or
  366. \fB\-\-glob\fR
  367. and is cleared after processing them\&.
  368. .RE
  369. .PP
  370. \-\-reflog
  371. .RS 4
  372. Pretend as if all objects mentioned by reflogs are listed on the command line as
  373. \fI<commit>\fR\&.
  374. .RE
  375. .PP
  376. \-\-alternate\-refs
  377. .RS 4
  378. 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
  379. \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
  380. \fBcore\&.alternateRefsCommand\fR, etc\&. See
  381. \fBgit-config\fR(1)\&.
  382. .RE
  383. .PP
  384. \-\-single\-worktree
  385. .RS 4
  386. By default, all working trees will be examined by the following options when there are more than one (see
  387. \fBgit-worktree\fR(1)):
  388. \fB\-\-all\fR,
  389. \fB\-\-reflog\fR
  390. and
  391. \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
  392. .RE
  393. .PP
  394. \-\-ignore\-missing
  395. .RS 4
  396. Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
  397. .RE
  398. .PP
  399. \-\-stdin
  400. .RS 4
  401. In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
  402. \fB\-\-all\fR
  403. and
  404. \fB\-\-glob=\fR\&. When a
  405. \fB\-\-\fR
  406. separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
  407. \fB\-\-not\fR
  408. 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\&.
  409. .RE
  410. .PP
  411. \-\-quiet
  412. .RS 4
  413. Don\(cqt print anything to standard output\&. This form is primarily meant to allow the caller to test the exit status to see if a range of objects is fully connected (or not)\&. It is faster than redirecting stdout to
  414. \fB/dev/null\fR
  415. as the output does not have to be formatted\&.
  416. .RE
  417. .PP
  418. \-\-disk\-usage, \-\-disk\-usage=human
  419. .RS 4
  420. Suppress normal output; instead, print the sum of the bytes used for on\-disk storage by the selected commits or objects\&. This is equivalent to piping the output into
  421. \fBgit\fR
  422. \fBcat\-file\fR
  423. \fB\-\-batch\-check=\fR\*(Aq%(\fBobjectsize:disk\fR)\*(Aq, except that it runs much faster (especially with
  424. \fB\-\-use\-bitmap\-index\fR)\&. See the
  425. \fBCAVEATS\fR
  426. section in
  427. \fBgit-cat-file\fR(1)
  428. for the limitations of what "on\-disk storage" means\&. With the optional value
  429. \fBhuman\fR, on\-disk storage size is shown in human\-readable string(e\&.g\&. 12\&.24 Kib, 3\&.50 Mib)\&.
  430. .RE
  431. .PP
  432. \-\-cherry\-mark
  433. .RS 4
  434. Like
  435. \fB\-\-cherry\-pick\fR
  436. (see below) but mark equivalent commits with
  437. \fB=\fR
  438. rather than omitting them, and inequivalent ones with
  439. \fB+\fR\&.
  440. .RE
  441. .PP
  442. \-\-cherry\-pick
  443. .RS 4
  444. Omit any commit that introduces the same change as another commit on the
  445. \(lqother side\(rq
  446. when the set of commits are limited with symmetric difference\&.
  447. .sp
  448. For example, if you have two branches,
  449. \fBA\fR
  450. and
  451. \fBB\fR, a usual way to list all commits on only one side of them is with
  452. \fB\-\-left\-right\fR
  453. (see the example below in the description of the
  454. \fB\-\-left\-right\fR
  455. option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
  456. \(lq3rd on b\(rq
  457. may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
  458. .RE
  459. .PP
  460. \-\-left\-only, \-\-right\-only
  461. .RS 4
  462. List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked < resp\&. > by
  463. \fB\-\-left\-right\fR\&.
  464. .sp
  465. For example,
  466. \fB\-\-cherry\-pick\fR
  467. \fB\-\-right\-only\fR
  468. \fBA\fR\fB\&.\&.\&.\fR\fBB\fR
  469. omits those commits from
  470. \fBB\fR
  471. which are in
  472. \fBA\fR
  473. or are patch\-equivalent to a commit in
  474. \fBA\fR\&. In other words, this lists the
  475. \fB+\fR
  476. commits from
  477. \fBgit\fR
  478. \fBcherry\fR
  479. \fBA\fR
  480. \fBB\fR\&. More precisely,
  481. \fB\-\-cherry\-pick\fR
  482. \fB\-\-right\-only\fR
  483. \fB\-\-no\-merges\fR
  484. gives the exact list\&.
  485. .RE
  486. .PP
  487. \-\-cherry
  488. .RS 4
  489. A synonym for
  490. \fB\-\-right\-only\fR
  491. \fB\-\-cherry\-mark\fR
  492. \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
  493. \fBgit\fR
  494. \fBlog\fR
  495. \fB\-\-cherry\fR
  496. \fBupstream\fR\fB\&.\&.\&.\fR\fBmybranch\fR, similar to
  497. \fBgit\fR
  498. \fBcherry\fR
  499. \fBupstream\fR
  500. \fBmybranch\fR\&.
  501. .RE
  502. .PP
  503. \-g, \-\-walk\-reflogs
  504. .RS 4
  505. 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,
  506. \fI^commit\fR,
  507. \fIcommit1\&.\&.commit2\fR, and
  508. \fIcommit1\&.\&.\&.commit2\fR
  509. notations cannot be used)\&.
  510. .sp
  511. With
  512. \fB\-\-pretty\fR
  513. format other than
  514. \fBoneline\fR
  515. and
  516. \fBreference\fR
  517. (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
  518. \fBref@\fR{\fI<Nth>\fR} (where
  519. \fI<Nth>\fR
  520. is the reverse\-chronological index in the reflog) or as
  521. \fBref@\fR{\fI<timestamp>\fR} (with the
  522. \fI<timestamp>\fR
  523. for that entry), depending on a few rules:
  524. .sp
  525. .RS 4
  526. .ie n \{\
  527. \h'-04' 1.\h'+01'\c
  528. .\}
  529. .el \{\
  530. .sp -1
  531. .IP " 1." 4.2
  532. .\}
  533. If the starting point is specified as
  534. \fBref@\fR{\fI<Nth>\fR}, show the index format\&.
  535. .RE
  536. .sp
  537. .RS 4
  538. .ie n \{\
  539. \h'-04' 2.\h'+01'\c
  540. .\}
  541. .el \{\
  542. .sp -1
  543. .IP " 2." 4.2
  544. .\}
  545. If the starting point was specified as
  546. \fBref@\fR{now}, show the timestamp format\&.
  547. .RE
  548. .sp
  549. .RS 4
  550. .ie n \{\
  551. \h'-04' 3.\h'+01'\c
  552. .\}
  553. .el \{\
  554. .sp -1
  555. .IP " 3." 4.2
  556. .\}
  557. If neither was used, but
  558. \fB\-\-date\fR
  559. was given on the command line, show the timestamp in the format requested by
  560. \fB\-\-date\fR\&.
  561. .RE
  562. .sp
  563. .RS 4
  564. .ie n \{\
  565. \h'-04' 4.\h'+01'\c
  566. .\}
  567. .el \{\
  568. .sp -1
  569. .IP " 4." 4.2
  570. .\}
  571. Otherwise, show the index format\&.
  572. .RE
  573. .sp
  574. Under
  575. \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
  576. \fB\-\-reverse\fR\&. See also
  577. \fBgit-reflog\fR(1)\&.
  578. .sp
  579. Under
  580. \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
  581. .RE
  582. .PP
  583. \-\-merge
  584. .RS 4
  585. Show commits touching conflicted paths in the range
  586. \fBHEAD\fR\fB\&.\&.\&.\fR\fI<other>\fR, where
  587. \fI<other>\fR
  588. is the first existing pseudoref in
  589. \fBMERGE_HEAD\fR,
  590. \fBCHERRY_PICK_HEAD\fR,
  591. \fBREVERT_HEAD\fR
  592. or
  593. \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\&.
  594. .RE
  595. .PP
  596. \-\-boundary
  597. .RS 4
  598. Output excluded boundary commits\&. Boundary commits are prefixed with
  599. \fB\-\fR\&.
  600. .RE
  601. .PP
  602. \-\-use\-bitmap\-index
  603. .RS 4
  604. Try to speed up the traversal using the pack bitmap index (if one is available)\&. Note that when traversing with
  605. \fB\-\-objects\fR, trees and blobs will not have their associated path printed\&.
  606. .RE
  607. .PP
  608. \-\-progress=<header>
  609. .RS 4
  610. Show progress reports on stderr as objects are considered\&. The
  611. \fI<header>\fR
  612. text will be printed with each progress update\&.
  613. .RE
  614. .SS "History Simplification"
  615. .sp
  616. 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\&.
  617. .sp
  618. The following options select the commits to be shown:
  619. .PP
  620. <paths>
  621. .RS 4
  622. Commits modifying the given <paths> are selected\&.
  623. .RE
  624. .PP
  625. \-\-simplify\-by\-decoration
  626. .RS 4
  627. Commits that are referred by some branch or tag are selected\&.
  628. .RE
  629. .sp
  630. Note that extra commits can be shown to give a meaningful history\&.
  631. .sp
  632. The following options affect the way the simplification is performed:
  633. .PP
  634. Default mode
  635. .RS 4
  636. 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)
  637. .RE
  638. .PP
  639. \-\-show\-pulls
  640. .RS 4
  641. 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\&.
  642. .RE
  643. .PP
  644. \-\-full\-history
  645. .RS 4
  646. Same as the default mode, but does not prune some history\&.
  647. .RE
  648. .PP
  649. \-\-dense
  650. .RS 4
  651. Only the selected commits are shown, plus some to have a meaningful history\&.
  652. .RE
  653. .PP
  654. \-\-sparse
  655. .RS 4
  656. All commits in the simplified history are shown\&.
  657. .RE
  658. .PP
  659. \-\-simplify\-merges
  660. .RS 4
  661. Additional option to
  662. \fB\-\-full\-history\fR
  663. to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
  664. .RE
  665. .PP
  666. \-\-ancestry\-path[=<commit>]
  667. .RS 4
  668. When given a range of commits to display (e\&.g\&.
  669. \fIcommit1\&.\&.commit2\fR
  670. or
  671. \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
  672. \fIcommit1\fR
  673. (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\&.
  674. .RE
  675. .sp
  676. A more detailed explanation follows\&.
  677. .sp
  678. 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\&.)
  679. .sp
  680. 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:
  681. .sp
  682. .if n \{\
  683. .RS 4
  684. .\}
  685. .nf
  686. \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
  687. / / / / / /
  688. I B C D E Y
  689. \e / / / / /
  690. `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
  691. .fi
  692. .if n \{\
  693. .RE
  694. .\}
  695. .sp
  696. The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
  697. .sp
  698. .RS 4
  699. .ie n \{\
  700. \h'-04'\(bu\h'+03'\c
  701. .\}
  702. .el \{\
  703. .sp -1
  704. .IP \(bu 2.3
  705. .\}
  706. \fBI\fR
  707. is the initial commit, in which
  708. \fBfoo\fR
  709. exists with contents
  710. \(lqasdf\(rq, and a file
  711. \fBquux\fR
  712. exists with contents
  713. \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
  714. \fBI\fR
  715. is !TREESAME\&.
  716. .RE
  717. .sp
  718. .RS 4
  719. .ie n \{\
  720. \h'-04'\(bu\h'+03'\c
  721. .\}
  722. .el \{\
  723. .sp -1
  724. .IP \(bu 2.3
  725. .\}
  726. In
  727. \fBA\fR,
  728. \fBfoo\fR
  729. contains just
  730. \(lqfoo\(rq\&.
  731. .RE
  732. .sp
  733. .RS 4
  734. .ie n \{\
  735. \h'-04'\(bu\h'+03'\c
  736. .\}
  737. .el \{\
  738. .sp -1
  739. .IP \(bu 2.3
  740. .\}
  741. \fBB\fR
  742. contains the same change as
  743. \fBA\fR\&. Its merge
  744. \fBM\fR
  745. is trivial and hence TREESAME to all parents\&.
  746. .RE
  747. .sp
  748. .RS 4
  749. .ie n \{\
  750. \h'-04'\(bu\h'+03'\c
  751. .\}
  752. .el \{\
  753. .sp -1
  754. .IP \(bu 2.3
  755. .\}
  756. \fBC\fR
  757. does not change
  758. \fBfoo\fR, but its merge
  759. \fBN\fR
  760. changes it to
  761. \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
  762. .RE
  763. .sp
  764. .RS 4
  765. .ie n \{\
  766. \h'-04'\(bu\h'+03'\c
  767. .\}
  768. .el \{\
  769. .sp -1
  770. .IP \(bu 2.3
  771. .\}
  772. \fBD\fR
  773. sets
  774. \fBfoo\fR
  775. to
  776. \(lqbaz\(rq\&. Its merge
  777. \fBO\fR
  778. combines the strings from
  779. \fBN\fR
  780. and
  781. \fBD\fR
  782. to
  783. \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
  784. .RE
  785. .sp
  786. .RS 4
  787. .ie n \{\
  788. \h'-04'\(bu\h'+03'\c
  789. .\}
  790. .el \{\
  791. .sp -1
  792. .IP \(bu 2.3
  793. .\}
  794. \fBE\fR
  795. changes
  796. \fBquux\fR
  797. to
  798. \(lqxyzzy\(rq, and its merge
  799. \fBP\fR
  800. combines the strings to
  801. \(lqquux xyzzy\(rq\&.
  802. \fBP\fR
  803. is TREESAME to
  804. \fBO\fR, but not to
  805. \fBE\fR\&.
  806. .RE
  807. .sp
  808. .RS 4
  809. .ie n \{\
  810. \h'-04'\(bu\h'+03'\c
  811. .\}
  812. .el \{\
  813. .sp -1
  814. .IP \(bu 2.3
  815. .\}
  816. \fBX\fR
  817. is an independent root commit that added a new file
  818. \fBside\fR, and
  819. \fBY\fR
  820. modified it\&.
  821. \fBY\fR
  822. is TREESAME to
  823. \fBX\fR\&. Its merge
  824. \fBQ\fR
  825. added
  826. \fBside\fR
  827. to
  828. \fBP\fR, and
  829. \fBQ\fR
  830. is TREESAME to
  831. \fBP\fR, but not to
  832. \fBY\fR\&.
  833. .RE
  834. .sp
  835. \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\&.
  836. .PP
  837. Default mode
  838. .RS 4
  839. Commits are included if they are not TREESAME to any parent (though this can be changed, see
  840. \fB\-\-sparse\fR
  841. 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\&.
  842. .sp
  843. This results in:
  844. .sp
  845. .if n \{\
  846. .RS 4
  847. .\}
  848. .nf
  849. \&.\-A\-\-\-N\-\-\-O
  850. / / /
  851. I\-\-\-\-\-\-\-\-\-D
  852. .fi
  853. .if n \{\
  854. .RE
  855. .\}
  856. .sp
  857. Note how the rule to only follow the TREESAME parent, if one is available, removed
  858. \fBB\fR
  859. from consideration entirely\&.
  860. \fBC\fR
  861. was considered via
  862. \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
  863. \fBI\fR
  864. is !TREESAME\&.
  865. .sp
  866. Parent/child relations are only visible with
  867. \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
  868. .RE
  869. .PP
  870. \-\-full\-history without parent rewriting
  871. .RS 4
  872. 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
  873. .sp
  874. .if n \{\
  875. .RS 4
  876. .\}
  877. .nf
  878. I A B N D O P Q
  879. .fi
  880. .if n \{\
  881. .RE
  882. .\}
  883. .sp
  884. \fBM\fR
  885. was excluded because it is TREESAME to both parents\&.
  886. \fBE\fR,
  887. \fBC\fR
  888. and
  889. \fBB\fR
  890. were all walked, but only
  891. \fBB\fR
  892. was !TREESAME, so the others do not appear\&.
  893. .sp
  894. 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\&.
  895. .RE
  896. .PP
  897. \-\-full\-history with parent rewriting
  898. .RS 4
  899. Ordinary commits are only included if they are !TREESAME (though this can be changed, see
  900. \fB\-\-sparse\fR
  901. below)\&.
  902. .sp
  903. Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
  904. .sp
  905. .if n \{\
  906. .RS 4
  907. .\}
  908. .nf
  909. \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
  910. / / / / /
  911. I B / D /
  912. \e / / / /
  913. `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
  914. .fi
  915. .if n \{\
  916. .RE
  917. .\}
  918. .sp
  919. Compare to
  920. \fB\-\-full\-history\fR
  921. without rewriting above\&. Note that
  922. \fBE\fR
  923. was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
  924. \fBE\fR\*(Aqs parent
  925. \fBI\fR\&. The same happened for
  926. \fBC\fR
  927. and
  928. \fBN\fR, and
  929. \fBX\fR,
  930. \fBY\fR
  931. and
  932. \fBQ\fR\&.
  933. .RE
  934. .sp
  935. In addition to the above settings, you can change whether TREESAME affects inclusion:
  936. .PP
  937. \-\-dense
  938. .RS 4
  939. Commits that are walked are included if they are not TREESAME to any parent\&.
  940. .RE
  941. .PP
  942. \-\-sparse
  943. .RS 4
  944. All commits that are walked are included\&.
  945. .sp
  946. Note that without
  947. \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\&.
  948. .RE
  949. .PP
  950. \-\-simplify\-merges
  951. .RS 4
  952. First, build a history graph in the same way that
  953. \fB\-\-full\-history\fR
  954. with parent rewriting does (see above)\&.
  955. .sp
  956. Then simplify each commit
  957. \fBC\fR
  958. to its replacement
  959. \fBC\fR\*(Aq in the final history according to the following rules:
  960. .sp
  961. .RS 4
  962. .ie n \{\
  963. \h'-04'\(bu\h'+03'\c
  964. .\}
  965. .el \{\
  966. .sp -1
  967. .IP \(bu 2.3
  968. .\}
  969. Set
  970. \fBC\fR\*(Aq to
  971. \fBC\fR\&.
  972. .RE
  973. .sp
  974. .RS 4
  975. .ie n \{\
  976. \h'-04'\(bu\h'+03'\c
  977. .\}
  978. .el \{\
  979. .sp -1
  980. .IP \(bu 2.3
  981. .\}
  982. Replace each parent
  983. \fBP\fR
  984. of
  985. \fBC\fR\*(Aq with its simplification
  986. \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\&.
  987. .RE
  988. .sp
  989. .RS 4
  990. .ie n \{\
  991. \h'-04'\(bu\h'+03'\c
  992. .\}
  993. .el \{\
  994. .sp -1
  995. .IP \(bu 2.3
  996. .\}
  997. If after this parent rewriting,
  998. \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\&.
  999. .RE
  1000. .sp
  1001. The effect of this is best shown by way of comparing to
  1002. \fB\-\-full\-history\fR
  1003. with parent rewriting\&. The example turns into:
  1004. .sp
  1005. .if n \{\
  1006. .RS 4
  1007. .\}
  1008. .nf
  1009. \&.\-A\-\-\-M\-\-\-N\-\-\-O
  1010. / / /
  1011. I B D
  1012. \e / /
  1013. `\-\-\-\-\-\-\-\-\-\*(Aq
  1014. .fi
  1015. .if n \{\
  1016. .RE
  1017. .\}
  1018. .sp
  1019. Note the major differences in
  1020. \fBN\fR,
  1021. \fBP\fR, and
  1022. \fBQ\fR
  1023. over
  1024. \fB\-\-full\-history\fR:
  1025. .sp
  1026. .RS 4
  1027. .ie n \{\
  1028. \h'-04'\(bu\h'+03'\c
  1029. .\}
  1030. .el \{\
  1031. .sp -1
  1032. .IP \(bu 2.3
  1033. .\}
  1034. \fBN\fR\*(Aqs parent list had
  1035. \fBI\fR
  1036. removed, because it is an ancestor of the other parent
  1037. \fBM\fR\&. Still,
  1038. \fBN\fR
  1039. remained because it is !TREESAME\&.
  1040. .RE
  1041. .sp
  1042. .RS 4
  1043. .ie n \{\
  1044. \h'-04'\(bu\h'+03'\c
  1045. .\}
  1046. .el \{\
  1047. .sp -1
  1048. .IP \(bu 2.3
  1049. .\}
  1050. \fBP\fR\*(Aqs parent list similarly had
  1051. \fBI\fR
  1052. removed\&.
  1053. \fBP\fR
  1054. was then removed completely, because it had one parent and is TREESAME\&.
  1055. .RE
  1056. .sp
  1057. .RS 4
  1058. .ie n \{\
  1059. \h'-04'\(bu\h'+03'\c
  1060. .\}
  1061. .el \{\
  1062. .sp -1
  1063. .IP \(bu 2.3
  1064. .\}
  1065. \fBQ\fR\*(Aqs parent list had
  1066. \fBY\fR
  1067. simplified to
  1068. \fBX\fR\&.
  1069. \fBX\fR
  1070. was then removed, because it was a TREESAME root\&.
  1071. \fBQ\fR
  1072. was then removed completely, because it had one parent and is TREESAME\&.
  1073. .RE
  1074. .RE
  1075. .sp
  1076. There is another simplification mode available:
  1077. .PP
  1078. \-\-ancestry\-path[=<commit>]
  1079. .RS 4
  1080. Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
  1081. .sp
  1082. As an example use case, consider the following commit history:
  1083. .sp
  1084. .if n \{\
  1085. .RS 4
  1086. .\}
  1087. .nf
  1088. D\-\-\-E\-\-\-\-\-\-\-F
  1089. / \e \e
  1090. B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
  1091. / \e
  1092. A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
  1093. .fi
  1094. .if n \{\
  1095. .RE
  1096. .\}
  1097. .sp
  1098. A regular
  1099. \fID\&.\&.M\fR
  1100. computes the set of commits that are ancestors of
  1101. \fBM\fR, but excludes the ones that are ancestors of
  1102. \fBD\fR\&. This is useful to see what happened to the history leading to
  1103. \fBM\fR
  1104. since
  1105. \fBD\fR, in the sense that
  1106. \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
  1107. \fBA\fR
  1108. and
  1109. \fBB\fR
  1110. (and
  1111. \fBD\fR
  1112. itself, of course)\&.
  1113. .sp
  1114. When we want to find out what commits in
  1115. \fBM\fR
  1116. are contaminated with the bug introduced by
  1117. \fBD\fR
  1118. and need fixing, however, we might want to view only the subset of
  1119. \fID\&.\&.M\fR
  1120. that are actually descendants of
  1121. \fBD\fR, i\&.e\&. excluding
  1122. \fBC\fR
  1123. and
  1124. \fBK\fR\&. This is exactly what the
  1125. \fB\-\-ancestry\-path\fR
  1126. option does\&. Applied to the
  1127. \fID\&.\&.M\fR
  1128. range, it results in:
  1129. .sp
  1130. .if n \{\
  1131. .RS 4
  1132. .\}
  1133. .nf
  1134. E\-\-\-\-\-\-\-F
  1135. \e \e
  1136. G\-\-\-H\-\-\-I\-\-\-J
  1137. \e
  1138. L\-\-M
  1139. .fi
  1140. .if n \{\
  1141. .RE
  1142. .\}
  1143. .sp
  1144. We can also use
  1145. \fB\-\-ancestry\-path=D\fR
  1146. instead of
  1147. \fB\-\-ancestry\-path\fR
  1148. which means the same thing when applied to the
  1149. \fID\&.\&.M\fR
  1150. range but is just more explicit\&.
  1151. .sp
  1152. 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
  1153. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1154. which contain that topic in their ancestry path\&. So, using
  1155. \fB\-\-ancestry\-path=H\fR
  1156. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1157. for example would result in:
  1158. .sp
  1159. .if n \{\
  1160. .RS 4
  1161. .\}
  1162. .nf
  1163. E
  1164. \e
  1165. G\-\-\-H\-\-\-I\-\-\-J
  1166. \e
  1167. L\-\-M
  1168. .fi
  1169. .if n \{\
  1170. .RE
  1171. .\}
  1172. .sp
  1173. Whereas
  1174. \fB\-\-ancestry\-path=K\fR
  1175. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1176. would result in
  1177. .sp
  1178. .if n \{\
  1179. .RS 4
  1180. .\}
  1181. .nf
  1182. K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
  1183. .fi
  1184. .if n \{\
  1185. .RE
  1186. .\}
  1187. .RE
  1188. .sp
  1189. Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
  1190. .sp
  1191. 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:
  1192. .sp
  1193. .if n \{\
  1194. .RS 4
  1195. .\}
  1196. .nf
  1197. \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
  1198. / / \e \e \e/ / /
  1199. I B \e R\-\*(Aq`\-Z\*(Aq /
  1200. \e / \e/ /
  1201. \e / /\e /
  1202. `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
  1203. .fi
  1204. .if n \{\
  1205. .RE
  1206. .\}
  1207. .sp
  1208. 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\&.
  1209. .sp
  1210. 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:
  1211. .sp
  1212. .if n \{\
  1213. .RS 4
  1214. .\}
  1215. .nf
  1216. I\-\-\-X
  1217. .fi
  1218. .if n \{\
  1219. .RE
  1220. .\}
  1221. .sp
  1222. 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:
  1223. .sp
  1224. .if n \{\
  1225. .RS 4
  1226. .\}
  1227. .nf
  1228. \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
  1229. / / \e \e \e/ / /
  1230. I B \e R\-\*(Aq`\-\-\*(Aq /
  1231. \e / \e/ /
  1232. \e / /\e /
  1233. `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
  1234. .fi
  1235. .if n \{\
  1236. .RE
  1237. .\}
  1238. .sp
  1239. 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\&.
  1240. .sp
  1241. 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:
  1242. .sp
  1243. .if n \{\
  1244. .RS 4
  1245. .\}
  1246. .nf
  1247. \&.\-A\-\-\-M\-\-\&.
  1248. / / \e
  1249. I B R
  1250. \e / /
  1251. \e / /
  1252. `\-\-\-X\-\-\*(Aq
  1253. .fi
  1254. .if n \{\
  1255. .RE
  1256. .\}
  1257. .sp
  1258. 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\&.
  1259. .sp
  1260. 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\&.
  1261. .sp
  1262. 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\&.
  1263. .PP
  1264. \-\-show\-pulls
  1265. .RS 4
  1266. 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\&.
  1267. .sp
  1268. When a merge commit is included by
  1269. \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
  1270. \fB\-\-show\-pulls\fR
  1271. on this example (and no other options) the resulting graph is:
  1272. .sp
  1273. .if n \{\
  1274. .RS 4
  1275. .\}
  1276. .nf
  1277. I\-\-\-X\-\-\-R\-\-\-N
  1278. .fi
  1279. .if n \{\
  1280. .RE
  1281. .\}
  1282. .sp
  1283. Here, the merge commits
  1284. \fBR\fR
  1285. and
  1286. \fBN\fR
  1287. are included because they pulled the commits
  1288. \fBX\fR
  1289. and
  1290. \fBR\fR
  1291. into the base branch, respectively\&. These merges are the reason the commits
  1292. \fBA\fR
  1293. and
  1294. \fBB\fR
  1295. do not appear in the default history\&.
  1296. .sp
  1297. When
  1298. \fB\-\-show\-pulls\fR
  1299. is paired with
  1300. \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
  1301. .sp
  1302. .if n \{\
  1303. .RS 4
  1304. .\}
  1305. .nf
  1306. \&.\-A\-\-\-M\-\-\&. N
  1307. / / \e /
  1308. I B R
  1309. \e / /
  1310. \e / /
  1311. `\-\-\-X\-\-\*(Aq
  1312. .fi
  1313. .if n \{\
  1314. .RE
  1315. .\}
  1316. .sp
  1317. Notice that since
  1318. \fBM\fR
  1319. is reachable from
  1320. \fBR\fR, the edge from
  1321. \fBN\fR
  1322. to
  1323. \fBM\fR
  1324. was simplified away\&. However,
  1325. \fBN\fR
  1326. still appears in the history as an important commit because it "pulled" the change
  1327. \fBR\fR
  1328. into the main branch\&.
  1329. .RE
  1330. .sp
  1331. 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)\&.
  1332. .SS "Bisection Helpers"
  1333. .PP
  1334. \-\-bisect
  1335. .RS 4
  1336. Limit output to the one commit object which is roughly halfway between included and excluded commits\&. Note that the bad bisection ref
  1337. \fBrefs/bisect/bad\fR
  1338. is added to the included commits (if it exists) and the good bisection refs
  1339. \fBrefs/bisect/good\-\fR* are added to the excluded commits (if they exist)\&. Thus, supposing there are no refs in
  1340. \fBrefs/bisect/\fR, if
  1341. .sp
  1342. .if n \{\
  1343. .RS 4
  1344. .\}
  1345. .nf
  1346. $ git rev\-list \-\-bisect foo ^bar ^baz
  1347. .fi
  1348. .if n \{\
  1349. .RE
  1350. .\}
  1351. .sp
  1352. outputs
  1353. \fImidpoint\fR, the output of the two commands
  1354. .sp
  1355. .if n \{\
  1356. .RS 4
  1357. .\}
  1358. .nf
  1359. $ git rev\-list foo ^midpoint
  1360. $ git rev\-list midpoint ^bar ^baz
  1361. .fi
  1362. .if n \{\
  1363. .RE
  1364. .\}
  1365. .sp
  1366. would be of roughly the same length\&. Finding the change which introduces a regression is thus reduced to a binary search: repeatedly generate and test new \*(Aqmidpoint\(cqs until the commit chain is of length one\&.
  1367. .RE
  1368. .PP
  1369. \-\-bisect\-vars
  1370. .RS 4
  1371. This calculates the same as
  1372. \fB\-\-bisect\fR, except that refs in
  1373. \fBrefs/bisect/\fR
  1374. are not used, and except that this outputs text ready to be eval\(cqed by the shell\&. These lines will assign the name of the midpoint revision to the variable
  1375. \fBbisect_rev\fR, and the expected number of commits to be tested after
  1376. \fBbisect_rev\fR
  1377. is tested to
  1378. \fBbisect_nr\fR, the expected number of commits to be tested if
  1379. \fBbisect_rev\fR
  1380. turns out to be good to
  1381. \fBbisect_good\fR, the expected number of commits to be tested if
  1382. \fBbisect_rev\fR
  1383. turns out to be bad to
  1384. \fBbisect_bad\fR, and the number of commits we are bisecting right now to
  1385. \fBbisect_all\fR\&.
  1386. .RE
  1387. .PP
  1388. \-\-bisect\-all
  1389. .RS 4
  1390. This outputs all the commit objects between the included and excluded commits, ordered by their distance to the included and excluded commits\&. Refs in
  1391. \fBrefs/bisect/\fR
  1392. are not used\&. The farthest from them is displayed first\&. (This is the only one displayed by
  1393. \fB\-\-bisect\fR\&.)
  1394. .sp
  1395. This is useful because it makes it easy to choose a good commit to test when you want to avoid to test some of them for some reason (they may not compile for example)\&.
  1396. .sp
  1397. This option can be used along with
  1398. \fB\-\-bisect\-vars\fR, in this case, after all the sorted commit objects, there will be the same text as if
  1399. \fB\-\-bisect\-vars\fR
  1400. had been used alone\&.
  1401. .RE
  1402. .SS "Commit Ordering"
  1403. .sp
  1404. By default, the commits are shown in reverse chronological order\&.
  1405. .PP
  1406. \-\-date\-order
  1407. .RS 4
  1408. Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
  1409. .RE
  1410. .PP
  1411. \-\-author\-date\-order
  1412. .RS 4
  1413. Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
  1414. .RE
  1415. .PP
  1416. \-\-topo\-order
  1417. .RS 4
  1418. Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
  1419. .sp
  1420. For example, in a commit history like this:
  1421. .sp
  1422. .if n \{\
  1423. .RS 4
  1424. .\}
  1425. .nf
  1426. \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
  1427. \e \e
  1428. 3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
  1429. .fi
  1430. .if n \{\
  1431. .RE
  1432. .\}
  1433. .sp
  1434. where the numbers denote the order of commit timestamps,
  1435. \fBgit\fR
  1436. \fBrev\-list\fR
  1437. and friends with
  1438. \fB\-\-date\-order\fR
  1439. show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
  1440. .sp
  1441. With
  1442. \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\&.
  1443. .RE
  1444. .PP
  1445. \-\-reverse
  1446. .RS 4
  1447. Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
  1448. \fB\-\-walk\-reflogs\fR\&.
  1449. .RE
  1450. .SS "Object Traversal"
  1451. .sp
  1452. These options are mostly targeted for packing of Git repositories\&.
  1453. .PP
  1454. \-\-objects
  1455. .RS 4
  1456. Print the object IDs of any object referenced by the listed commits\&.
  1457. \fB\-\-objects\fR
  1458. \fBfoo\fR
  1459. \fB^bar\fR
  1460. thus means
  1461. \(lqsend me all object IDs which I need to download if I have the commit object \fIbar\fR but not \fIfoo\fR\(rq\&. See also
  1462. \fB\-\-object\-names\fR
  1463. below\&.
  1464. .RE
  1465. .PP
  1466. \-\-in\-commit\-order
  1467. .RS 4
  1468. Print tree and blob ids in order of the commits\&. The tree and blob ids are printed after they are first referenced by a commit\&.
  1469. .RE
  1470. .PP
  1471. \-\-objects\-edge
  1472. .RS 4
  1473. Similar to
  1474. \fB\-\-objects\fR, but also print the IDs of excluded commits prefixed with a
  1475. \(lq\-\(rq
  1476. character\&. This is used by
  1477. \fBgit-pack-objects\fR(1)
  1478. to build a
  1479. \(lqthin\(rq
  1480. pack, which records objects in deltified form based on objects contained in these excluded commits to reduce network traffic\&.
  1481. .RE
  1482. .PP
  1483. \-\-objects\-edge\-aggressive
  1484. .RS 4
  1485. Similar to
  1486. \fB\-\-objects\-edge\fR, but it tries harder to find excluded commits at the cost of increased time\&. This is used instead of
  1487. \fB\-\-objects\-edge\fR
  1488. to build
  1489. \(lqthin\(rq
  1490. packs for shallow repositories\&.
  1491. .RE
  1492. .PP
  1493. \-\-indexed\-objects
  1494. .RS 4
  1495. Pretend as if all trees and blobs used by the index are listed on the command line\&. Note that you probably want to use
  1496. \fB\-\-objects\fR, too\&.
  1497. .RE
  1498. .PP
  1499. \-\-unpacked
  1500. .RS 4
  1501. Only useful with
  1502. \fB\-\-objects\fR; print the object IDs that are not in packs\&.
  1503. .RE
  1504. .PP
  1505. \-\-object\-names
  1506. .RS 4
  1507. Only useful with
  1508. \fB\-\-objects\fR; print the names of the object IDs that are found\&. This is the default behavior\&. Note that the "name" of each object is ambiguous, and mostly intended as a hint for packing objects\&. In particular: no distinction is made between the names of tags, trees, and blobs; path names may be modified to remove newlines; and if an object would appear multiple times with different names, only one name is shown\&.
  1509. .RE
  1510. .PP
  1511. \-\-no\-object\-names
  1512. .RS 4
  1513. Only useful with
  1514. \fB\-\-objects\fR; does not print the names of the object IDs that are found\&. This inverts
  1515. \fB\-\-object\-names\fR\&. This flag allows the output to be more easily parsed by commands such as
  1516. \fBgit-cat-file\fR(1)\&.
  1517. .RE
  1518. .PP
  1519. \-\-filter=<filter\-spec>
  1520. .RS 4
  1521. Only useful with one of the
  1522. \fB\-\-objects\fR*; omits objects (usually blobs) from the list of printed objects\&. The
  1523. \fI<filter\-spec>\fR
  1524. may be one of the following:
  1525. .sp
  1526. The form
  1527. \fI\-\-filter=blob:none\fR
  1528. omits all blobs\&.
  1529. .sp
  1530. The form
  1531. \fI\-\-filter=blob:limit=<n>[kmg]\fR
  1532. omits blobs of size at least n bytes or units\&. n may be zero\&. The suffixes k, m, and g can be used to name units in KiB, MiB, or GiB\&. For example,
  1533. \fIblob:limit=1k\fR
  1534. is the same as
  1535. \fIblob:limit=1024\fR\&.
  1536. .sp
  1537. The form
  1538. \fI\-\-filter=object:type=(tag|commit|tree|blob)\fR
  1539. omits all objects which are not of the requested type\&.
  1540. .sp
  1541. The form
  1542. \fI\-\-filter=sparse:oid=<blob\-ish>\fR
  1543. uses a sparse\-checkout specification contained in the blob (or blob\-expression)
  1544. \fI<blob\-ish>\fR
  1545. to omit blobs that would not be required for a sparse checkout on the requested refs\&.
  1546. .sp
  1547. The form
  1548. \fI\-\-filter=tree:<depth>\fR
  1549. omits all blobs and trees whose depth from the root tree is >= <depth> (minimum depth if an object is located at multiple depths in the commits traversed)\&. <depth>=0 will not include any trees or blobs unless included explicitly in the command\-line (or standard input when \-\-stdin is used)\&. <depth>=1 will include only the tree and blobs which are referenced directly by a commit reachable from <commit> or an explicitly\-given object\&. <depth>=2 is like <depth>=1 while also including trees and blobs one more level removed from an explicitly\-given commit or tree\&.
  1550. .sp
  1551. Note that the form
  1552. \fI\-\-filter=sparse:path=<path>\fR
  1553. that wants to read from an arbitrary path on the filesystem has been dropped for security reasons\&.
  1554. .sp
  1555. Multiple
  1556. \fI\-\-filter=\fR
  1557. flags can be specified to combine filters\&. Only objects which are accepted by every filter are included\&.
  1558. .sp
  1559. The form
  1560. \fI\-\-filter=combine:<filter1>+<filter2>+\&...\:<filterN>\fR
  1561. can also be used to combined several filters, but this is harder than just repeating the
  1562. \fI\-\-filter\fR
  1563. flag and is usually not necessary\&. Filters are joined by
  1564. \fI+\fR
  1565. and individual filters are %\-encoded (i\&.e\&. URL\-encoded)\&. Besides the
  1566. \fI+\fR
  1567. and
  1568. \fI%\fR
  1569. characters, the following characters are reserved and also must be encoded:
  1570. \fB~\fR!@#$^&*()[]{}\e;",<>?\*(Aq` as well as all characters with ASCII code <=
  1571. \fB0x20\fR, which includes space and newline\&.
  1572. .sp
  1573. Other arbitrary characters can also be encoded\&. For instance,
  1574. \fIcombine:tree:3+blob:none\fR
  1575. and
  1576. \fIcombine:tree%3A3+blob%3Anone\fR
  1577. are equivalent\&.
  1578. .RE
  1579. .PP
  1580. \-\-no\-filter
  1581. .RS 4
  1582. Turn off any previous
  1583. \fB\-\-filter=\fR
  1584. argument\&.
  1585. .RE
  1586. .PP
  1587. \-\-filter\-provided\-objects
  1588. .RS 4
  1589. Filter the list of explicitly provided objects, which would otherwise always be printed even if they did not match any of the filters\&. Only useful with
  1590. \fB\-\-filter=\fR\&.
  1591. .RE
  1592. .PP
  1593. \-\-filter\-print\-omitted
  1594. .RS 4
  1595. Only useful with
  1596. \fB\-\-filter=\fR; prints a list of the objects omitted by the filter\&. Object IDs are prefixed with a
  1597. \(lq~\(rq
  1598. character\&.
  1599. .RE
  1600. .PP
  1601. \-\-missing=<missing\-action>
  1602. .RS 4
  1603. A debug option to help with future "partial clone" development\&. This option specifies how missing objects are handled\&.
  1604. .sp
  1605. The form
  1606. \fI\-\-missing=error\fR
  1607. requests that rev\-list stop with an error if a missing object is encountered\&. This is the default action\&.
  1608. .sp
  1609. The form
  1610. \fI\-\-missing=allow\-any\fR
  1611. will allow object traversal to continue if a missing object is encountered\&. Missing objects will silently be omitted from the results\&.
  1612. .sp
  1613. The form
  1614. \fI\-\-missing=allow\-promisor\fR
  1615. is like
  1616. \fIallow\-any\fR, but will only allow object traversal to continue for EXPECTED promisor missing objects\&. Unexpected missing objects will raise an error\&.
  1617. .sp
  1618. The form
  1619. \fI\-\-missing=print\fR
  1620. is like
  1621. \fIallow\-any\fR, but will also print a list of the missing objects\&. Object IDs are prefixed with a
  1622. \(lq?\(rq
  1623. character\&.
  1624. .sp
  1625. The form
  1626. \fI\-\-missing=print\-info\fR
  1627. is like
  1628. \fIprint\fR, but will also print additional information about the missing object inferred from its containing object\&. The information is all printed on the same line with the missing object ID in the form: ?\fI<oid>\fR
  1629. [\fI<token>\fR\fB=\fR\fI<value>\fR]\&.\&.\&.\&. The
  1630. \fI<token>\fR\fB=\fR\fI<value>\fR
  1631. pairs containing additional information are separated from each other by a SP\&. The value is encoded in a token specific fashion, but SP or LF contained in value are always expected to be represented in such a way that the resulting encoded value does not have either of these two problematic bytes\&. Each
  1632. \fI<token>\fR\fB=\fR\fI<value>\fR
  1633. may be one of the following:
  1634. .sp
  1635. .RS 4
  1636. .ie n \{\
  1637. \h'-04'\(bu\h'+03'\c
  1638. .\}
  1639. .el \{\
  1640. .sp -1
  1641. .IP \(bu 2.3
  1642. .\}
  1643. The
  1644. \fBpath=\fR\fI<path>\fR
  1645. shows the path of the missing object inferred from a containing object\&. A path containing SP or special characters is enclosed in double\-quotes in the C style as needed\&.
  1646. .RE
  1647. .sp
  1648. .RS 4
  1649. .ie n \{\
  1650. \h'-04'\(bu\h'+03'\c
  1651. .\}
  1652. .el \{\
  1653. .sp -1
  1654. .IP \(bu 2.3
  1655. .\}
  1656. The
  1657. \fBtype=\fR\fI<type>\fR
  1658. shows the type of the missing object inferred from a containing object\&.
  1659. .RE
  1660. .sp
  1661. If some tips passed to the traversal are missing, they will be considered as missing too, and the traversal will ignore them\&. In case we cannot get their Object ID though, an error will be raised\&.
  1662. .RE
  1663. .PP
  1664. \-\-exclude\-promisor\-objects
  1665. .RS 4
  1666. (For internal use only\&.) Prefilter object traversal at promisor boundary\&. This is used with partial clone\&. This is stronger than
  1667. \fB\-\-missing=allow\-promisor\fR
  1668. because it limits the traversal, rather than just silencing errors about missing objects\&.
  1669. .RE
  1670. .PP
  1671. \-\-no\-walk[=(sorted|unsorted)]
  1672. .RS 4
  1673. Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
  1674. \fBunsorted\fR
  1675. is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
  1676. \fBsorted\fR
  1677. or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
  1678. \fB\-\-graph\fR\&.
  1679. .RE
  1680. .PP
  1681. \-\-do\-walk
  1682. .RS 4
  1683. Overrides a previous
  1684. \fB\-\-no\-walk\fR\&.
  1685. .RE
  1686. .SS "Commit Formatting"
  1687. .sp
  1688. Using these options, \fBgit-rev-list\fR(1) will act similar to the more specialized family of commit log tools: \fBgit-log\fR(1), \fBgit-show\fR(1), and \fBgit-whatchanged\fR(1)
  1689. .PP
  1690. \-\-pretty[=<format>], \-\-format=<format>
  1691. .RS 4
  1692. Pretty\-print the contents of the commit logs in a given format, where
  1693. \fI<format>\fR
  1694. can be one of
  1695. \fIoneline\fR,
  1696. \fIshort\fR,
  1697. \fImedium\fR,
  1698. \fIfull\fR,
  1699. \fIfuller\fR,
  1700. \fIreference\fR,
  1701. \fIemail\fR,
  1702. \fIraw\fR,
  1703. \fIformat:<string>\fR
  1704. and
  1705. \fItformat:<string>\fR\&. When
  1706. \fI<format>\fR
  1707. is none of the above, and has
  1708. \fI%placeholder\fR
  1709. in it, it acts as if
  1710. \fI\-\-pretty=tformat:<format>\fR
  1711. were given\&.
  1712. .sp
  1713. See the "PRETTY FORMATS" section for some additional details for each format\&. When
  1714. \fI=<format>\fR
  1715. part is omitted, it defaults to
  1716. \fImedium\fR\&.
  1717. .sp
  1718. Note: you can specify the default pretty format in the repository configuration (see
  1719. \fBgit-config\fR(1))\&.
  1720. .RE
  1721. .PP
  1722. \-\-abbrev\-commit
  1723. .RS 4
  1724. 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\&.
  1725. .sp
  1726. This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
  1727. .RE
  1728. .PP
  1729. \-\-no\-abbrev\-commit
  1730. .RS 4
  1731. Show the full 40\-byte hexadecimal commit object name\&. This negates
  1732. \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
  1733. \fBlog\&.abbrevCommit\fR
  1734. variable\&.
  1735. .RE
  1736. .PP
  1737. \-\-oneline
  1738. .RS 4
  1739. This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
  1740. .RE
  1741. .PP
  1742. \-\-encoding=<encoding>
  1743. .RS 4
  1744. 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
  1745. \fBX\fR
  1746. and we are outputting in
  1747. \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\&.
  1748. .RE
  1749. .PP
  1750. \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
  1751. .RS 4
  1752. Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
  1753. \fI<n>\fR) in the log message before showing it in the output\&.
  1754. \fB\-\-expand\-tabs\fR
  1755. is a short\-hand for
  1756. \fB\-\-expand\-tabs=8\fR, and
  1757. \fB\-\-no\-expand\-tabs\fR
  1758. is a short\-hand for
  1759. \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
  1760. .sp
  1761. By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
  1762. \fImedium\fR, which is the default,
  1763. \fIfull\fR, and
  1764. \fIfuller\fR)\&.
  1765. .RE
  1766. .PP
  1767. \-\-show\-signature
  1768. .RS 4
  1769. Check the validity of a signed commit object by passing the signature to
  1770. \fBgpg\fR
  1771. \fB\-\-verify\fR
  1772. and show the output\&.
  1773. .RE
  1774. .PP
  1775. \-\-relative\-date
  1776. .RS 4
  1777. Synonym for
  1778. \fB\-\-date=relative\fR\&.
  1779. .RE
  1780. .PP
  1781. \-\-date=<format>
  1782. .RS 4
  1783. Only takes effect for dates shown in human\-readable format, such as when using
  1784. \fB\-\-pretty\fR\&.
  1785. \fBlog\&.date\fR
  1786. config variable sets a default value for the log command\(cqs
  1787. \fB\-\-date\fR
  1788. option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
  1789. \fB\-local\fR
  1790. is appended to the format (e\&.g\&.,
  1791. \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
  1792. .sp
  1793. \fB\-\-date=relative\fR
  1794. shows dates relative to the current time, e\&.g\&.
  1795. \(lq2 hours ago\(rq\&. The
  1796. \fB\-local\fR
  1797. option has no effect for
  1798. \fB\-\-date=relative\fR\&.
  1799. .sp
  1800. \fB\-\-date=local\fR
  1801. is an alias for
  1802. \fB\-\-date=default\-local\fR\&.
  1803. .sp
  1804. \fB\-\-date=iso\fR
  1805. (or
  1806. \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
  1807. .sp
  1808. .RS 4
  1809. .ie n \{\
  1810. \h'-04'\(bu\h'+03'\c
  1811. .\}
  1812. .el \{\
  1813. .sp -1
  1814. .IP \(bu 2.3
  1815. .\}
  1816. a space instead of the
  1817. \fBT\fR
  1818. date/time delimiter
  1819. .RE
  1820. .sp
  1821. .RS 4
  1822. .ie n \{\
  1823. \h'-04'\(bu\h'+03'\c
  1824. .\}
  1825. .el \{\
  1826. .sp -1
  1827. .IP \(bu 2.3
  1828. .\}
  1829. a space between time and time zone
  1830. .RE
  1831. .sp
  1832. .RS 4
  1833. .ie n \{\
  1834. \h'-04'\(bu\h'+03'\c
  1835. .\}
  1836. .el \{\
  1837. .sp -1
  1838. .IP \(bu 2.3
  1839. .\}
  1840. no colon between hours and minutes of the time zone
  1841. .RE
  1842. .sp
  1843. \fB\-\-date=iso\-strict\fR
  1844. (or
  1845. \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
  1846. .sp
  1847. \fB\-\-date=rfc\fR
  1848. (or
  1849. \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
  1850. .sp
  1851. \fB\-\-date=short\fR
  1852. shows only the date, but not the time, in
  1853. \fBYYYY\-MM\-DD\fR
  1854. format\&.
  1855. .sp
  1856. \fB\-\-date=raw\fR
  1857. 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
  1858. \fB+\fR
  1859. or
  1860. \fB\-\fR
  1861. with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
  1862. \fBstrftime\fR("%s %z"))\&. Note that the
  1863. \fB\-local\fR
  1864. option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
  1865. .sp
  1866. \fB\-\-date=human\fR
  1867. 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\&.
  1868. .sp
  1869. \fB\-\-date=unix\fR
  1870. shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
  1871. \fB\-\-raw\fR, this is always in UTC and therefore
  1872. \fB\-local\fR
  1873. has no effect\&.
  1874. .sp
  1875. \fB\-\-date=format:\&.\&.\fR\&. feeds the format \&.\&.\&. to your system
  1876. \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
  1877. \fB\-\-date=format:\fR%c to show the date in your system locale\(cqs preferred format\&. See the
  1878. \fBstrftime\fR
  1879. manual for a complete list of format placeholders\&. When using
  1880. \fB\-local\fR, the correct syntax is
  1881. \fB\-\-date=format\-local:\&.\&.\fR\&.\&.
  1882. .sp
  1883. \fB\-\-date=default\fR
  1884. 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\&.
  1885. \fBThu\fR
  1886. \fBJan\fR
  1887. \fB1\fR
  1888. \fB00:00:00\fR
  1889. \fB1970\fR
  1890. \fB+0000\fR\&.
  1891. .RE
  1892. .PP
  1893. \-\-header
  1894. .RS 4
  1895. Print the contents of the commit in raw\-format; each record is separated with a NUL character\&.
  1896. .RE
  1897. .PP
  1898. \-\-no\-commit\-header
  1899. .RS 4
  1900. Suppress the header line containing "commit" and the object ID printed before the specified format\&. This has no effect on the built\-in formats; only custom formats are affected\&.
  1901. .RE
  1902. .PP
  1903. \-\-commit\-header
  1904. .RS 4
  1905. Overrides a previous
  1906. \fB\-\-no\-commit\-header\fR\&.
  1907. .RE
  1908. .PP
  1909. \-\-parents
  1910. .RS 4
  1911. Print also the parents of the commit (in the form "commit parent\&...\:")\&. Also enables parent rewriting, see
  1912. \fIHistory Simplification\fR
  1913. above\&.
  1914. .RE
  1915. .PP
  1916. \-\-children
  1917. .RS 4
  1918. Print also the children of the commit (in the form "commit child\&...\:")\&. Also enables parent rewriting, see
  1919. \fIHistory Simplification\fR
  1920. above\&.
  1921. .RE
  1922. .PP
  1923. \-\-timestamp
  1924. .RS 4
  1925. Print the raw commit timestamp\&.
  1926. .RE
  1927. .PP
  1928. \-\-left\-right
  1929. .RS 4
  1930. 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
  1931. \fB\-\-boundary\fR, those commits are prefixed with
  1932. \fB\-\fR\&.
  1933. .sp
  1934. For example, if you have this topology:
  1935. .sp
  1936. .if n \{\
  1937. .RS 4
  1938. .\}
  1939. .nf
  1940. y\-\-\-b\-\-\-b branch B
  1941. / \e /
  1942. / \&.
  1943. / / \e
  1944. o\-\-\-x\-\-\-a\-\-\-a branch A
  1945. .fi
  1946. .if n \{\
  1947. .RE
  1948. .\}
  1949. .sp
  1950. you would get an output like this:
  1951. .sp
  1952. .if n \{\
  1953. .RS 4
  1954. .\}
  1955. .nf
  1956. $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
  1957. >bbbbbbb\&.\&.\&. 3rd on b
  1958. >bbbbbbb\&.\&.\&. 2nd on b
  1959. <aaaaaaa\&.\&.\&. 3rd on a
  1960. <aaaaaaa\&.\&.\&. 2nd on a
  1961. \-yyyyyyy\&.\&.\&. 1st on b
  1962. \-xxxxxxx\&.\&.\&. 1st on a
  1963. .fi
  1964. .if n \{\
  1965. .RE
  1966. .\}
  1967. .RE
  1968. .PP
  1969. \-\-graph
  1970. .RS 4
  1971. 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
  1972. \fB\-\-no\-walk\fR\&.
  1973. .sp
  1974. This enables parent rewriting, see
  1975. \fIHistory Simplification\fR
  1976. above\&.
  1977. .sp
  1978. This implies the
  1979. \fB\-\-topo\-order\fR
  1980. option by default, but the
  1981. \fB\-\-date\-order\fR
  1982. option may also be specified\&.
  1983. .RE
  1984. .PP
  1985. \-\-show\-linear\-break[=<barrier>]
  1986. .RS 4
  1987. 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
  1988. \fI<barrier>\fR
  1989. is specified, it is the string that will be shown instead of the default one\&.
  1990. .RE
  1991. .PP
  1992. \-\-count
  1993. .RS 4
  1994. Print a number stating how many commits would have been listed, and suppress all other output\&. When used together with
  1995. \fB\-\-left\-right\fR, instead print the counts for left and right commits, separated by a tab\&. When used together with
  1996. \fB\-\-cherry\-mark\fR, omit patch equivalent commits from these counts and print the count for equivalent commits separated by a tab\&.
  1997. .RE
  1998. .SH "PRETTY FORMATS"
  1999. .sp
  2000. 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\&.
  2001. .sp
  2002. 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:
  2003. .sp
  2004. .RS 4
  2005. .ie n \{\
  2006. \h'-04'\(bu\h'+03'\c
  2007. .\}
  2008. .el \{\
  2009. .sp -1
  2010. .IP \(bu 2.3
  2011. .\}
  2012. \fIoneline\fR
  2013. .sp
  2014. .if n \{\
  2015. .RS 4
  2016. .\}
  2017. .nf
  2018. <hash> <title\-line>
  2019. .fi
  2020. .if n \{\
  2021. .RE
  2022. .\}
  2023. .sp
  2024. This is designed to be as compact as possible\&.
  2025. .RE
  2026. .sp
  2027. .RS 4
  2028. .ie n \{\
  2029. \h'-04'\(bu\h'+03'\c
  2030. .\}
  2031. .el \{\
  2032. .sp -1
  2033. .IP \(bu 2.3
  2034. .\}
  2035. \fIshort\fR
  2036. .sp
  2037. .if n \{\
  2038. .RS 4
  2039. .\}
  2040. .nf
  2041. commit <hash>
  2042. Author: <author>
  2043. .fi
  2044. .if n \{\
  2045. .RE
  2046. .\}
  2047. .sp
  2048. .if n \{\
  2049. .RS 4
  2050. .\}
  2051. .nf
  2052. <title\-line>
  2053. .fi
  2054. .if n \{\
  2055. .RE
  2056. .\}
  2057. .RE
  2058. .sp
  2059. .RS 4
  2060. .ie n \{\
  2061. \h'-04'\(bu\h'+03'\c
  2062. .\}
  2063. .el \{\
  2064. .sp -1
  2065. .IP \(bu 2.3
  2066. .\}
  2067. \fImedium\fR
  2068. .sp
  2069. .if n \{\
  2070. .RS 4
  2071. .\}
  2072. .nf
  2073. commit <hash>
  2074. Author: <author>
  2075. Date: <author\-date>
  2076. .fi
  2077. .if n \{\
  2078. .RE
  2079. .\}
  2080. .sp
  2081. .if n \{\
  2082. .RS 4
  2083. .\}
  2084. .nf
  2085. <title\-line>
  2086. .fi
  2087. .if n \{\
  2088. .RE
  2089. .\}
  2090. .sp
  2091. .if n \{\
  2092. .RS 4
  2093. .\}
  2094. .nf
  2095. <full\-commit\-message>
  2096. .fi
  2097. .if n \{\
  2098. .RE
  2099. .\}
  2100. .RE
  2101. .sp
  2102. .RS 4
  2103. .ie n \{\
  2104. \h'-04'\(bu\h'+03'\c
  2105. .\}
  2106. .el \{\
  2107. .sp -1
  2108. .IP \(bu 2.3
  2109. .\}
  2110. \fIfull\fR
  2111. .sp
  2112. .if n \{\
  2113. .RS 4
  2114. .\}
  2115. .nf
  2116. commit <hash>
  2117. Author: <author>
  2118. Commit: <committer>
  2119. .fi
  2120. .if n \{\
  2121. .RE
  2122. .\}
  2123. .sp
  2124. .if n \{\
  2125. .RS 4
  2126. .\}
  2127. .nf
  2128. <title\-line>
  2129. .fi
  2130. .if n \{\
  2131. .RE
  2132. .\}
  2133. .sp
  2134. .if n \{\
  2135. .RS 4
  2136. .\}
  2137. .nf
  2138. <full\-commit\-message>
  2139. .fi
  2140. .if n \{\
  2141. .RE
  2142. .\}
  2143. .RE
  2144. .sp
  2145. .RS 4
  2146. .ie n \{\
  2147. \h'-04'\(bu\h'+03'\c
  2148. .\}
  2149. .el \{\
  2150. .sp -1
  2151. .IP \(bu 2.3
  2152. .\}
  2153. \fIfuller\fR
  2154. .sp
  2155. .if n \{\
  2156. .RS 4
  2157. .\}
  2158. .nf
  2159. commit <hash>
  2160. Author: <author>
  2161. AuthorDate: <author\-date>
  2162. Commit: <committer>
  2163. CommitDate: <committer\-date>
  2164. .fi
  2165. .if n \{\
  2166. .RE
  2167. .\}
  2168. .sp
  2169. .if n \{\
  2170. .RS 4
  2171. .\}
  2172. .nf
  2173. <title\-line>
  2174. .fi
  2175. .if n \{\
  2176. .RE
  2177. .\}
  2178. .sp
  2179. .if n \{\
  2180. .RS 4
  2181. .\}
  2182. .nf
  2183. <full\-commit\-message>
  2184. .fi
  2185. .if n \{\
  2186. .RE
  2187. .\}
  2188. .RE
  2189. .sp
  2190. .RS 4
  2191. .ie n \{\
  2192. \h'-04'\(bu\h'+03'\c
  2193. .\}
  2194. .el \{\
  2195. .sp -1
  2196. .IP \(bu 2.3
  2197. .\}
  2198. \fIreference\fR
  2199. .sp
  2200. .if n \{\
  2201. .RS 4
  2202. .\}
  2203. .nf
  2204. <abbrev\-hash> (<title\-line>, <short\-author\-date>)
  2205. .fi
  2206. .if n \{\
  2207. .RE
  2208. .\}
  2209. .sp
  2210. This format is used to refer to another commit in a commit message and is the same as
  2211. \fB\-\-pretty=\fR\*(Aqformat:%C(\fBauto\fR)%h (%s, %ad)\*(Aq\&. By default, the date is formatted with
  2212. \fB\-\-date=short\fR
  2213. unless another
  2214. \fB\-\-date\fR
  2215. option is explicitly specified\&. As with any
  2216. \fBformat:\fR
  2217. with format placeholders, its output is not affected by other options like
  2218. \fB\-\-decorate\fR
  2219. and
  2220. \fB\-\-walk\-reflogs\fR\&.
  2221. .RE
  2222. .sp
  2223. .RS 4
  2224. .ie n \{\
  2225. \h'-04'\(bu\h'+03'\c
  2226. .\}
  2227. .el \{\
  2228. .sp -1
  2229. .IP \(bu 2.3
  2230. .\}
  2231. \fIemail\fR
  2232. .sp
  2233. .if n \{\
  2234. .RS 4
  2235. .\}
  2236. .nf
  2237. From <hash> <date>
  2238. From: <author>
  2239. Date: <author\-date>
  2240. Subject: [PATCH] <title\-line>
  2241. .fi
  2242. .if n \{\
  2243. .RE
  2244. .\}
  2245. .sp
  2246. .if n \{\
  2247. .RS 4
  2248. .\}
  2249. .nf
  2250. <full\-commit\-message>
  2251. .fi
  2252. .if n \{\
  2253. .RE
  2254. .\}
  2255. .RE
  2256. .sp
  2257. .RS 4
  2258. .ie n \{\
  2259. \h'-04'\(bu\h'+03'\c
  2260. .\}
  2261. .el \{\
  2262. .sp -1
  2263. .IP \(bu 2.3
  2264. .\}
  2265. \fImboxrd\fR
  2266. .sp
  2267. Like
  2268. \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\&.
  2269. .RE
  2270. .sp
  2271. .RS 4
  2272. .ie n \{\
  2273. \h'-04'\(bu\h'+03'\c
  2274. .\}
  2275. .el \{\
  2276. .sp -1
  2277. .IP \(bu 2.3
  2278. .\}
  2279. \fIraw\fR
  2280. .sp
  2281. The
  2282. \fIraw\fR
  2283. 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
  2284. \fIparents\fR
  2285. 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
  2286. \fBgit\fR
  2287. \fBlog\fR
  2288. \fB\-\-raw\fR\&. To get full object names in a raw diff format, use
  2289. \fB\-\-no\-abbrev\fR\&.
  2290. .RE
  2291. .sp
  2292. .RS 4
  2293. .ie n \{\
  2294. \h'-04'\(bu\h'+03'\c
  2295. .\}
  2296. .el \{\
  2297. .sp -1
  2298. .IP \(bu 2.3
  2299. .\}
  2300. \fIformat:<format\-string>\fR
  2301. .sp
  2302. The
  2303. \fIformat:<format\-string>\fR
  2304. 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
  2305. \fI%n\fR
  2306. instead of
  2307. \fI\en\fR\&.
  2308. .sp
  2309. E\&.g,
  2310. \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
  2311. would show something like this:
  2312. .sp
  2313. .if n \{\
  2314. .RS 4
  2315. .\}
  2316. .nf
  2317. The author of fe6e0ee was Junio C Hamano, 23 hours ago
  2318. The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
  2319. .fi
  2320. .if n \{\
  2321. .RE
  2322. .\}
  2323. .sp
  2324. The placeholders are:
  2325. .sp
  2326. .RS 4
  2327. .ie n \{\
  2328. \h'-04'\(bu\h'+03'\c
  2329. .\}
  2330. .el \{\
  2331. .sp -1
  2332. .IP \(bu 2.3
  2333. .\}
  2334. Placeholders that expand to a single literal character:
  2335. .PP
  2336. \fI%n\fR
  2337. .RS 4
  2338. newline
  2339. .RE
  2340. .PP
  2341. \fI%%\fR
  2342. .RS 4
  2343. a raw
  2344. \fI%\fR
  2345. .RE
  2346. .PP
  2347. \fI%x00\fR
  2348. .RS 4
  2349. \fI%x\fR
  2350. 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)\&.
  2351. .RE
  2352. .RE
  2353. .sp
  2354. .RS 4
  2355. .ie n \{\
  2356. \h'-04'\(bu\h'+03'\c
  2357. .\}
  2358. .el \{\
  2359. .sp -1
  2360. .IP \(bu 2.3
  2361. .\}
  2362. Placeholders that affect formatting of later placeholders:
  2363. .PP
  2364. \fI%Cred\fR
  2365. .RS 4
  2366. switch color to red
  2367. .RE
  2368. .PP
  2369. \fI%Cgreen\fR
  2370. .RS 4
  2371. switch color to green
  2372. .RE
  2373. .PP
  2374. \fI%Cblue\fR
  2375. .RS 4
  2376. switch color to blue
  2377. .RE
  2378. .PP
  2379. \fI%Creset\fR
  2380. .RS 4
  2381. reset color
  2382. .RE
  2383. .PP
  2384. \fI%C(\&...\:)\fR
  2385. .RS 4
  2386. color specification, as described under Values in the "CONFIGURATION FILE" section of
  2387. \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by
  2388. \fBcolor\&.diff\fR,
  2389. \fBcolor\&.ui\fR, or
  2390. \fB\-\-color\fR, and respecting the
  2391. \fBauto\fR
  2392. 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
  2393. \fB\-\-color=always\fR
  2394. to enable color for the whole output, including this format and anything else git might color)\&.
  2395. \fBauto\fR
  2396. alone (i\&.e\&. %C(\fBauto\fR)) will turn on auto coloring on the next placeholders until the color is switched again\&.
  2397. .RE
  2398. .PP
  2399. \fI%m\fR
  2400. .RS 4
  2401. left (<), right (>) or boundary (\fB\-\fR) mark
  2402. .RE
  2403. .PP
  2404. \fI%w([<w>[,<i1>[,<i2>]]])\fR
  2405. .RS 4
  2406. switch line wrapping, like the \-w option of
  2407. \fBgit-shortlog\fR(1)\&.
  2408. .RE
  2409. .PP
  2410. \fI%<( <N> [,trunc|ltrunc|mtrunc])\fR
  2411. .RS 4
  2412. make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis
  2413. \fI\&.\&.\fR) at the left (ltrunc)
  2414. \fB\&.\&.\fR\fBft\fR, the middle (mtrunc)
  2415. \fBmi\fR\fB\&.\&.\fR\fBle\fR, or the end (trunc)
  2416. \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\&.
  2417. .RE
  2418. .PP
  2419. \fI%<|( <M> )\fR
  2420. .RS 4
  2421. 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\&.
  2422. .RE
  2423. .PP
  2424. \fI%>( <N> )\fR, \fI%>|( <M> )\fR
  2425. .RS 4
  2426. similar to
  2427. \fI%<( <N> )\fR,
  2428. \fI%<|( <M> )\fR
  2429. respectively, but padding spaces on the left
  2430. .RE
  2431. .PP
  2432. \fI%>>( <N> )\fR, \fI%>>|( <M> )\fR
  2433. .RS 4
  2434. similar to
  2435. \fI%>( <N> )\fR,
  2436. \fI%>|( <M> )\fR
  2437. respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces
  2438. .RE
  2439. .PP
  2440. \fI%><( <N> )\fR, \fI%><|( <M> )\fR
  2441. .RS 4
  2442. similar to
  2443. \fI%<( <N> )\fR,
  2444. \fI%<|( <M> )\fR
  2445. respectively, but padding both sides (i\&.e\&. the text is centered)
  2446. .RE
  2447. .RE
  2448. .sp
  2449. .RS 4
  2450. .ie n \{\
  2451. \h'-04'\(bu\h'+03'\c
  2452. .\}
  2453. .el \{\
  2454. .sp -1
  2455. .IP \(bu 2.3
  2456. .\}
  2457. Placeholders that expand to information extracted from the commit:
  2458. .PP
  2459. \fI%H\fR
  2460. .RS 4
  2461. commit hash
  2462. .RE
  2463. .PP
  2464. \fI%h\fR
  2465. .RS 4
  2466. abbreviated commit hash
  2467. .RE
  2468. .PP
  2469. \fI%T\fR
  2470. .RS 4
  2471. tree hash
  2472. .RE
  2473. .PP
  2474. \fI%t\fR
  2475. .RS 4
  2476. abbreviated tree hash
  2477. .RE
  2478. .PP
  2479. \fI%P\fR
  2480. .RS 4
  2481. parent hashes
  2482. .RE
  2483. .PP
  2484. \fI%p\fR
  2485. .RS 4
  2486. abbreviated parent hashes
  2487. .RE
  2488. .PP
  2489. \fI%an\fR
  2490. .RS 4
  2491. author name
  2492. .RE
  2493. .PP
  2494. \fI%aN\fR
  2495. .RS 4
  2496. author name (respecting \&.mailmap, see
  2497. \fBgit-shortlog\fR(1)
  2498. or
  2499. \fBgit-blame\fR(1))
  2500. .RE
  2501. .PP
  2502. \fI%ae\fR
  2503. .RS 4
  2504. author email
  2505. .RE
  2506. .PP
  2507. \fI%aE\fR
  2508. .RS 4
  2509. author email (respecting \&.mailmap, see
  2510. \fBgit-shortlog\fR(1)
  2511. or
  2512. \fBgit-blame\fR(1))
  2513. .RE
  2514. .PP
  2515. \fI%al\fR
  2516. .RS 4
  2517. author email local\-part (the part before the
  2518. \fI@\fR
  2519. sign)
  2520. .RE
  2521. .PP
  2522. \fI%aL\fR
  2523. .RS 4
  2524. author local\-part (see
  2525. \fI%al\fR) respecting \&.mailmap, see
  2526. \fBgit-shortlog\fR(1)
  2527. or
  2528. \fBgit-blame\fR(1))
  2529. .RE
  2530. .PP
  2531. \fI%ad\fR
  2532. .RS 4
  2533. author date (format respects \-\-date= option)
  2534. .RE
  2535. .PP
  2536. \fI%aD\fR
  2537. .RS 4
  2538. author date, RFC2822 style
  2539. .RE
  2540. .PP
  2541. \fI%ar\fR
  2542. .RS 4
  2543. author date, relative
  2544. .RE
  2545. .PP
  2546. \fI%at\fR
  2547. .RS 4
  2548. author date, UNIX timestamp
  2549. .RE
  2550. .PP
  2551. \fI%ai\fR
  2552. .RS 4
  2553. author date, ISO 8601\-like format
  2554. .RE
  2555. .PP
  2556. \fI%aI\fR
  2557. .RS 4
  2558. author date, strict ISO 8601 format
  2559. .RE
  2560. .PP
  2561. \fI%as\fR
  2562. .RS 4
  2563. author date, short format (\fBYYYY\-MM\-DD\fR)
  2564. .RE
  2565. .PP
  2566. \fI%ah\fR
  2567. .RS 4
  2568. author date, human style (like the
  2569. \fB\-\-date=human\fR
  2570. option of
  2571. \fBgit-rev-list\fR(1))
  2572. .RE
  2573. .PP
  2574. \fI%cn\fR
  2575. .RS 4
  2576. committer name
  2577. .RE
  2578. .PP
  2579. \fI%cN\fR
  2580. .RS 4
  2581. committer name (respecting \&.mailmap, see
  2582. \fBgit-shortlog\fR(1)
  2583. or
  2584. \fBgit-blame\fR(1))
  2585. .RE
  2586. .PP
  2587. \fI%ce\fR
  2588. .RS 4
  2589. committer email
  2590. .RE
  2591. .PP
  2592. \fI%cE\fR
  2593. .RS 4
  2594. committer email (respecting \&.mailmap, see
  2595. \fBgit-shortlog\fR(1)
  2596. or
  2597. \fBgit-blame\fR(1))
  2598. .RE
  2599. .PP
  2600. \fI%cl\fR
  2601. .RS 4
  2602. committer email local\-part (the part before the
  2603. \fI@\fR
  2604. sign)
  2605. .RE
  2606. .PP
  2607. \fI%cL\fR
  2608. .RS 4
  2609. committer local\-part (see
  2610. \fI%cl\fR) respecting \&.mailmap, see
  2611. \fBgit-shortlog\fR(1)
  2612. or
  2613. \fBgit-blame\fR(1))
  2614. .RE
  2615. .PP
  2616. \fI%cd\fR
  2617. .RS 4
  2618. committer date (format respects \-\-date= option)
  2619. .RE
  2620. .PP
  2621. \fI%cD\fR
  2622. .RS 4
  2623. committer date, RFC2822 style
  2624. .RE
  2625. .PP
  2626. \fI%cr\fR
  2627. .RS 4
  2628. committer date, relative
  2629. .RE
  2630. .PP
  2631. \fI%ct\fR
  2632. .RS 4
  2633. committer date, UNIX timestamp
  2634. .RE
  2635. .PP
  2636. \fI%ci\fR
  2637. .RS 4
  2638. committer date, ISO 8601\-like format
  2639. .RE
  2640. .PP
  2641. \fI%cI\fR
  2642. .RS 4
  2643. committer date, strict ISO 8601 format
  2644. .RE
  2645. .PP
  2646. \fI%cs\fR
  2647. .RS 4
  2648. committer date, short format (\fBYYYY\-MM\-DD\fR)
  2649. .RE
  2650. .PP
  2651. \fI%ch\fR
  2652. .RS 4
  2653. committer date, human style (like the
  2654. \fB\-\-date=human\fR
  2655. option of
  2656. \fBgit-rev-list\fR(1))
  2657. .RE
  2658. .PP
  2659. \fI%d\fR
  2660. .RS 4
  2661. ref names, like the \-\-decorate option of
  2662. \fBgit-log\fR(1)
  2663. .RE
  2664. .PP
  2665. \fI%D\fR
  2666. .RS 4
  2667. ref names without the " (", ")" wrapping\&.
  2668. .RE
  2669. .PP
  2670. \fI%(decorate[:<options>])\fR
  2671. .RS 4
  2672. ref names with custom decorations\&. The
  2673. \fBdecorate\fR
  2674. 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\&.
  2675. .sp
  2676. .RS 4
  2677. .ie n \{\
  2678. \h'-04'\(bu\h'+03'\c
  2679. .\}
  2680. .el \{\
  2681. .sp -1
  2682. .IP \(bu 2.3
  2683. .\}
  2684. \fIprefix=<value>\fR: Shown before the list of ref names\&. Defaults to "\ \&("\&.
  2685. .RE
  2686. .sp
  2687. .RS 4
  2688. .ie n \{\
  2689. \h'-04'\(bu\h'+03'\c
  2690. .\}
  2691. .el \{\
  2692. .sp -1
  2693. .IP \(bu 2.3
  2694. .\}
  2695. \fIsuffix=<value>\fR: Shown after the list of ref names\&. Defaults to ")"\&.
  2696. .RE
  2697. .sp
  2698. .RS 4
  2699. .ie n \{\
  2700. \h'-04'\(bu\h'+03'\c
  2701. .\}
  2702. .el \{\
  2703. .sp -1
  2704. .IP \(bu 2.3
  2705. .\}
  2706. \fIseparator=<value>\fR: Shown between ref names\&. Defaults to "\fB,\fR\ \&"\&.
  2707. .RE
  2708. .sp
  2709. .RS 4
  2710. .ie n \{\
  2711. \h'-04'\(bu\h'+03'\c
  2712. .\}
  2713. .el \{\
  2714. .sp -1
  2715. .IP \(bu 2.3
  2716. .\}
  2717. \fIpointer=<value>\fR: Shown between HEAD and the branch it points to, if any\&. Defaults to "\ \&\fB\-\fR>\ \&"\&.
  2718. .RE
  2719. .sp
  2720. .RS 4
  2721. .ie n \{\
  2722. \h'-04'\(bu\h'+03'\c
  2723. .\}
  2724. .el \{\
  2725. .sp -1
  2726. .IP \(bu 2.3
  2727. .\}
  2728. \fItag=<value>\fR: Shown before tag names\&. Defaults to "\fBtag:\fR\ \&"\&.
  2729. .RE
  2730. .RE
  2731. .RE
  2732. .sp
  2733. For example, to produce decorations with no wrapping or tag annotations, and spaces as separators:
  2734. .sp
  2735. + %(\fBdecorate:prefix=,suffix=,tag=,separator=\fR
  2736. )
  2737. .PP
  2738. \fI%(describe[:<options>])\fR
  2739. .RS 4
  2740. human\-readable name, like
  2741. \fBgit-describe\fR(1); empty string for undescribable commits\&. The
  2742. \fBdescribe\fR
  2743. 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\&.
  2744. .sp
  2745. .RS 4
  2746. .ie n \{\
  2747. \h'-04'\(bu\h'+03'\c
  2748. .\}
  2749. .el \{\
  2750. .sp -1
  2751. .IP \(bu 2.3
  2752. .\}
  2753. \fItags[=<bool\-value>]\fR: Instead of only considering annotated tags, consider lightweight tags as well\&.
  2754. .RE
  2755. .sp
  2756. .RS 4
  2757. .ie n \{\
  2758. \h'-04'\(bu\h'+03'\c
  2759. .\}
  2760. .el \{\
  2761. .sp -1
  2762. .IP \(bu 2.3
  2763. .\}
  2764. \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\&.
  2765. .RE
  2766. .sp
  2767. .RS 4
  2768. .ie n \{\
  2769. \h'-04'\(bu\h'+03'\c
  2770. .\}
  2771. .el \{\
  2772. .sp -1
  2773. .IP \(bu 2.3
  2774. .\}
  2775. \fImatch=<pattern>\fR: Only consider tags matching the given
  2776. \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
  2777. .RE
  2778. .sp
  2779. .RS 4
  2780. .ie n \{\
  2781. \h'-04'\(bu\h'+03'\c
  2782. .\}
  2783. .el \{\
  2784. .sp -1
  2785. .IP \(bu 2.3
  2786. .\}
  2787. \fIexclude=<pattern>\fR: Do not consider tags matching the given
  2788. \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
  2789. .RE
  2790. .RE
  2791. .PP
  2792. \fI%S\fR
  2793. .RS 4
  2794. ref name given on the command line by which the commit was reached (like
  2795. \fBgit\fR
  2796. \fBlog\fR
  2797. \fB\-\-source\fR), only works with
  2798. \fBgit\fR
  2799. \fBlog\fR
  2800. .RE
  2801. .PP
  2802. \fI%e\fR
  2803. .RS 4
  2804. encoding
  2805. .RE
  2806. .PP
  2807. \fI%s\fR
  2808. .RS 4
  2809. subject
  2810. .RE
  2811. .PP
  2812. \fI%f\fR
  2813. .RS 4
  2814. sanitized subject line, suitable for a filename
  2815. .RE
  2816. .PP
  2817. \fI%b\fR
  2818. .RS 4
  2819. body
  2820. .RE
  2821. .PP
  2822. \fI%B\fR
  2823. .RS 4
  2824. raw body (unwrapped subject and body)
  2825. .RE
  2826. .PP
  2827. \fI%GG\fR
  2828. .RS 4
  2829. raw verification message from GPG for a signed commit
  2830. .RE
  2831. .PP
  2832. \fI%G?\fR
  2833. .RS 4
  2834. 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
  2835. .RE
  2836. .PP
  2837. \fI%GS\fR
  2838. .RS 4
  2839. show the name of the signer for a signed commit
  2840. .RE
  2841. .PP
  2842. \fI%GK\fR
  2843. .RS 4
  2844. show the key used to sign a signed commit
  2845. .RE
  2846. .PP
  2847. \fI%GF\fR
  2848. .RS 4
  2849. show the fingerprint of the key used to sign a signed commit
  2850. .RE
  2851. .PP
  2852. \fI%GP\fR
  2853. .RS 4
  2854. show the fingerprint of the primary key whose subkey was used to sign a signed commit
  2855. .RE
  2856. .PP
  2857. \fI%GT\fR
  2858. .RS 4
  2859. show the trust level for the key used to sign a signed commit
  2860. .RE
  2861. .PP
  2862. \fI%gD\fR
  2863. .RS 4
  2864. reflog selector, e\&.g\&.,
  2865. \fBrefs/stash@\fR{1} or
  2866. \fBrefs/stash@\fR{2
  2867. \fBminutes\fR
  2868. \fBago\fR}; the format follows the rules described for the
  2869. \fB\-g\fR
  2870. option\&. The portion before the
  2871. \fB@\fR
  2872. is the refname as given on the command line (so
  2873. \fBgit\fR
  2874. \fBlog\fR
  2875. \fB\-g\fR
  2876. \fBrefs/heads/master\fR
  2877. would yield
  2878. \fBrefs/heads/master@\fR{0})\&.
  2879. .RE
  2880. .PP
  2881. \fI%gd\fR
  2882. .RS 4
  2883. shortened reflog selector; same as %gD, but the refname portion is shortened for human readability (so
  2884. \fBrefs/heads/master\fR
  2885. becomes just
  2886. \fBmaster\fR)\&.
  2887. .RE
  2888. .PP
  2889. \fI%gn\fR
  2890. .RS 4
  2891. reflog identity name
  2892. .RE
  2893. .PP
  2894. \fI%gN\fR
  2895. .RS 4
  2896. reflog identity name (respecting \&.mailmap, see
  2897. \fBgit-shortlog\fR(1)
  2898. or
  2899. \fBgit-blame\fR(1))
  2900. .RE
  2901. .PP
  2902. \fI%ge\fR
  2903. .RS 4
  2904. reflog identity email
  2905. .RE
  2906. .PP
  2907. \fI%gE\fR
  2908. .RS 4
  2909. reflog identity email (respecting \&.mailmap, see
  2910. \fBgit-shortlog\fR(1)
  2911. or
  2912. \fBgit-blame\fR(1))
  2913. .RE
  2914. .PP
  2915. \fI%gs\fR
  2916. .RS 4
  2917. reflog subject
  2918. .RE
  2919. .PP
  2920. \fI%(trailers[:<options>])\fR
  2921. .RS 4
  2922. display the trailers of the body as interpreted by
  2923. \fBgit-interpret-trailers\fR(1)\&. The
  2924. \fBtrailers\fR
  2925. 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\&.
  2926. .sp
  2927. .RS 4
  2928. .ie n \{\
  2929. \h'-04'\(bu\h'+03'\c
  2930. .\}
  2931. .el \{\
  2932. .sp -1
  2933. .IP \(bu 2.3
  2934. .\}
  2935. \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
  2936. \fBonly\fR
  2937. option so that non\-trailer lines in the trailer block are hidden\&. If that is not desired it can be disabled with
  2938. \fBonly=false\fR\&. E\&.g\&., %(\fBtrailers:key=Reviewed\-by\fR) shows trailer lines with key
  2939. \fBReviewed\-by\fR\&.
  2940. .RE
  2941. .sp
  2942. .RS 4
  2943. .ie n \{\
  2944. \h'-04'\(bu\h'+03'\c
  2945. .\}
  2946. .el \{\
  2947. .sp -1
  2948. .IP \(bu 2.3
  2949. .\}
  2950. \fIonly[=<bool>]\fR: select whether non\-trailer lines from the trailer block should be included\&.
  2951. .RE
  2952. .sp
  2953. .RS 4
  2954. .ie n \{\
  2955. \h'-04'\(bu\h'+03'\c
  2956. .\}
  2957. .el \{\
  2958. .sp -1
  2959. .IP \(bu 2.3
  2960. .\}
  2961. \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\&.
  2962. .RE
  2963. .sp
  2964. .RS 4
  2965. .ie n \{\
  2966. \h'-04'\(bu\h'+03'\c
  2967. .\}
  2968. .el \{\
  2969. .sp -1
  2970. .IP \(bu 2.3
  2971. .\}
  2972. \fIunfold[=<bool>]\fR: make it behave as if interpret\-trailer\(cqs
  2973. \fB\-\-unfold\fR
  2974. option was given\&. E\&.g\&., %(\fBtrailers:only,unfold=true\fR) unfolds and shows all trailer lines\&.
  2975. .RE
  2976. .sp
  2977. .RS 4
  2978. .ie n \{\
  2979. \h'-04'\(bu\h'+03'\c
  2980. .\}
  2981. .el \{\
  2982. .sp -1
  2983. .IP \(bu 2.3
  2984. .\}
  2985. \fIkeyonly[=<bool>]\fR: only show the key part of the trailer\&.
  2986. .RE
  2987. .sp
  2988. .RS 4
  2989. .ie n \{\
  2990. \h'-04'\(bu\h'+03'\c
  2991. .\}
  2992. .el \{\
  2993. .sp -1
  2994. .IP \(bu 2.3
  2995. .\}
  2996. \fIvalueonly[=<bool>]\fR: only show the value part of the trailer\&.
  2997. .RE
  2998. .sp
  2999. .RS 4
  3000. .ie n \{\
  3001. \h'-04'\(bu\h'+03'\c
  3002. .\}
  3003. .el \{\
  3004. .sp -1
  3005. .IP \(bu 2.3
  3006. .\}
  3007. \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
  3008. \fIseparator=<sep>\fR
  3009. above\&.
  3010. .RE
  3011. .RE
  3012. .RE
  3013. .if n \{\
  3014. .sp
  3015. .\}
  3016. .RS 4
  3017. .it 1 an-trap
  3018. .nr an-no-space-flag 1
  3019. .nr an-break-flag 1
  3020. .br
  3021. .ps +1
  3022. \fBNote\fR
  3023. .ps -1
  3024. .br
  3025. .sp
  3026. 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\&.
  3027. .sp .5v
  3028. .RE
  3029. .sp
  3030. 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\&.
  3031. .sp
  3032. 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\&.
  3033. .sp
  3034. 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\&.
  3035. .sp
  3036. 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\&.
  3037. .sp
  3038. .RS 4
  3039. .ie n \{\
  3040. \h'-04'\(bu\h'+03'\c
  3041. .\}
  3042. .el \{\
  3043. .sp -1
  3044. .IP \(bu 2.3
  3045. .\}
  3046. \fItformat:\fR
  3047. .sp
  3048. The
  3049. \fItformat:\fR
  3050. format works exactly like
  3051. \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:
  3052. .sp
  3053. .if n \{\
  3054. .RS 4
  3055. .\}
  3056. .nf
  3057. $ git log \-2 \-\-pretty=format:%h 4da45bef \e
  3058. | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
  3059. 4da45be
  3060. 7134973 \-\- NO NEWLINE
  3061. $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
  3062. | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
  3063. 4da45be
  3064. 7134973
  3065. .fi
  3066. .if n \{\
  3067. .RE
  3068. .\}
  3069. .sp
  3070. In addition, any unrecognized string that has a % in it is interpreted as if it has
  3071. \fBtformat:\fR
  3072. in front of it\&. For example, these two are equivalent:
  3073. .sp
  3074. .if n \{\
  3075. .RS 4
  3076. .\}
  3077. .nf
  3078. $ git log \-2 \-\-pretty=tformat:%h 4da45bef
  3079. $ git log \-2 \-\-pretty=%h 4da45bef
  3080. .fi
  3081. .if n \{\
  3082. .RE
  3083. .\}
  3084. .RE
  3085. .SH "EXAMPLES"
  3086. .sp
  3087. .RS 4
  3088. .ie n \{\
  3089. \h'-04'\(bu\h'+03'\c
  3090. .\}
  3091. .el \{\
  3092. .sp -1
  3093. .IP \(bu 2.3
  3094. .\}
  3095. Print the list of commits reachable from the current branch\&.
  3096. .sp
  3097. .if n \{\
  3098. .RS 4
  3099. .\}
  3100. .nf
  3101. git rev\-list HEAD
  3102. .fi
  3103. .if n \{\
  3104. .RE
  3105. .\}
  3106. .RE
  3107. .sp
  3108. .RS 4
  3109. .ie n \{\
  3110. \h'-04'\(bu\h'+03'\c
  3111. .\}
  3112. .el \{\
  3113. .sp -1
  3114. .IP \(bu 2.3
  3115. .\}
  3116. Print the list of commits on this branch, but not present in the upstream branch\&.
  3117. .sp
  3118. .if n \{\
  3119. .RS 4
  3120. .\}
  3121. .nf
  3122. git rev\-list @{upstream}\&.\&.HEAD
  3123. .fi
  3124. .if n \{\
  3125. .RE
  3126. .\}
  3127. .RE
  3128. .sp
  3129. .RS 4
  3130. .ie n \{\
  3131. \h'-04'\(bu\h'+03'\c
  3132. .\}
  3133. .el \{\
  3134. .sp -1
  3135. .IP \(bu 2.3
  3136. .\}
  3137. Format commits with their author and commit message (see also the porcelain
  3138. \fBgit-log\fR(1))\&.
  3139. .sp
  3140. .if n \{\
  3141. .RS 4
  3142. .\}
  3143. .nf
  3144. git rev\-list \-\-format=medium HEAD
  3145. .fi
  3146. .if n \{\
  3147. .RE
  3148. .\}
  3149. .RE
  3150. .sp
  3151. .RS 4
  3152. .ie n \{\
  3153. \h'-04'\(bu\h'+03'\c
  3154. .\}
  3155. .el \{\
  3156. .sp -1
  3157. .IP \(bu 2.3
  3158. .\}
  3159. Format commits along with their diffs (see also the porcelain
  3160. \fBgit-log\fR(1), which can do this in a single process)\&.
  3161. .sp
  3162. .if n \{\
  3163. .RS 4
  3164. .\}
  3165. .nf
  3166. git rev\-list HEAD |
  3167. git diff\-tree \-\-stdin \-\-format=medium \-p
  3168. .fi
  3169. .if n \{\
  3170. .RE
  3171. .\}
  3172. .RE
  3173. .sp
  3174. .RS 4
  3175. .ie n \{\
  3176. \h'-04'\(bu\h'+03'\c
  3177. .\}
  3178. .el \{\
  3179. .sp -1
  3180. .IP \(bu 2.3
  3181. .\}
  3182. Print the list of commits on the current branch that touched any file in the
  3183. \fBDocumentation\fR
  3184. directory\&.
  3185. .sp
  3186. .if n \{\
  3187. .RS 4
  3188. .\}
  3189. .nf
  3190. git rev\-list HEAD \-\- Documentation/
  3191. .fi
  3192. .if n \{\
  3193. .RE
  3194. .\}
  3195. .RE
  3196. .sp
  3197. .RS 4
  3198. .ie n \{\
  3199. \h'-04'\(bu\h'+03'\c
  3200. .\}
  3201. .el \{\
  3202. .sp -1
  3203. .IP \(bu 2.3
  3204. .\}
  3205. Print the list of commits authored by you in the past year, on any branch, tag, or other ref\&.
  3206. .sp
  3207. .if n \{\
  3208. .RS 4
  3209. .\}
  3210. .nf
  3211. git rev\-list \-\-author=you@example\&.com \-\-since=1\&.year\&.ago \-\-all
  3212. .fi
  3213. .if n \{\
  3214. .RE
  3215. .\}
  3216. .RE
  3217. .sp
  3218. .RS 4
  3219. .ie n \{\
  3220. \h'-04'\(bu\h'+03'\c
  3221. .\}
  3222. .el \{\
  3223. .sp -1
  3224. .IP \(bu 2.3
  3225. .\}
  3226. Print the list of objects reachable from the current branch (i\&.e\&., all commits and the blobs and trees they contain)\&.
  3227. .sp
  3228. .if n \{\
  3229. .RS 4
  3230. .\}
  3231. .nf
  3232. git rev\-list \-\-objects HEAD
  3233. .fi
  3234. .if n \{\
  3235. .RE
  3236. .\}
  3237. .RE
  3238. .sp
  3239. .RS 4
  3240. .ie n \{\
  3241. \h'-04'\(bu\h'+03'\c
  3242. .\}
  3243. .el \{\
  3244. .sp -1
  3245. .IP \(bu 2.3
  3246. .\}
  3247. Compare the disk size of all reachable objects, versus those reachable from reflogs, versus the total packed size\&. This can tell you whether running
  3248. \fBgit\fR
  3249. \fBrepack\fR
  3250. \fB\-ad\fR
  3251. might reduce the repository size (by dropping unreachable objects), and whether expiring reflogs might help\&.
  3252. .sp
  3253. .if n \{\
  3254. .RS 4
  3255. .\}
  3256. .nf
  3257. # reachable objects
  3258. git rev\-list \-\-disk\-usage \-\-objects \-\-all
  3259. # plus reflogs
  3260. git rev\-list \-\-disk\-usage \-\-objects \-\-all \-\-reflog
  3261. # total disk size used
  3262. du \-c \&.git/objects/pack/*\&.pack \&.git/objects/??/*
  3263. # alternative to du: add up "size" and "size\-pack" fields
  3264. git count\-objects \-v
  3265. .fi
  3266. .if n \{\
  3267. .RE
  3268. .\}
  3269. .RE
  3270. .sp
  3271. .RS 4
  3272. .ie n \{\
  3273. \h'-04'\(bu\h'+03'\c
  3274. .\}
  3275. .el \{\
  3276. .sp -1
  3277. .IP \(bu 2.3
  3278. .\}
  3279. Report the disk size of each branch, not including objects used by the current branch\&. This can find outliers that are contributing to a bloated repository size (e\&.g\&., because somebody accidentally committed large build artifacts)\&.
  3280. .sp
  3281. .if n \{\
  3282. .RS 4
  3283. .\}
  3284. .nf
  3285. git for\-each\-ref \-\-format=\*(Aq%(refname)\*(Aq |
  3286. while read branch
  3287. do
  3288. size=$(git rev\-list \-\-disk\-usage \-\-objects HEAD\&.\&.$branch)
  3289. echo "$size $branch"
  3290. done |
  3291. sort \-n
  3292. .fi
  3293. .if n \{\
  3294. .RE
  3295. .\}
  3296. .RE
  3297. .sp
  3298. .RS 4
  3299. .ie n \{\
  3300. \h'-04'\(bu\h'+03'\c
  3301. .\}
  3302. .el \{\
  3303. .sp -1
  3304. .IP \(bu 2.3
  3305. .\}
  3306. Compare the on\-disk size of branches in one group of refs, excluding another\&. If you co\-mingle objects from multiple remotes in a single repository, this can show which remotes are contributing to the repository size (taking the size of
  3307. \fBorigin\fR
  3308. as a baseline)\&.
  3309. .sp
  3310. .if n \{\
  3311. .RS 4
  3312. .\}
  3313. .nf
  3314. git rev\-list \-\-disk\-usage \-\-objects \-\-remotes=$suspect \-\-not \-\-remotes=origin
  3315. .fi
  3316. .if n \{\
  3317. .RE
  3318. .\}
  3319. .RE
  3320. .SH "GIT"
  3321. .sp
  3322. Part of the \fBgit\fR(1) suite