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-shortlog.1 (39498B)


  1. '\" t
  2. .\" Title: git-shortlog
  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\-SHORTLOG" "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-shortlog \- Summarize \*(Aqgit log\*(Aq output
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit shortlog\fR [<options>] [<revision\-range>] [[\-\-] <path>\&...\:]
  36. git log \-\-pretty=short | \fIgit shortlog\fR [<options>]
  37. .fi
  38. .SH "DESCRIPTION"
  39. .sp
  40. Summarizes \fIgit log\fR output in a format suitable for inclusion in release announcements\&. Each commit will be grouped by author and title\&.
  41. .sp
  42. Additionally, "[PATCH]" will be stripped from the commit description\&.
  43. .sp
  44. If no revisions are passed on the command line and either standard input is not a terminal or there is no current branch, \fIgit shortlog\fR will output a summary of the log read from standard input, without reference to the current repository\&.
  45. .SH "OPTIONS"
  46. .PP
  47. \-n, \-\-numbered
  48. .RS 4
  49. Sort output according to the number of commits per author instead of author alphabetic order\&.
  50. .RE
  51. .PP
  52. \-s, \-\-summary
  53. .RS 4
  54. Suppress commit description and provide a commit count summary only\&.
  55. .RE
  56. .PP
  57. \-e, \-\-email
  58. .RS 4
  59. Show the email address of each author\&.
  60. .RE
  61. .PP
  62. \-\-format[=<format>]
  63. .RS 4
  64. Instead of the commit subject, use some other information to describe each commit\&.
  65. \fI<format>\fR
  66. can be any string accepted by the
  67. \fB\-\-format\fR
  68. option of
  69. \fIgit log\fR, such as
  70. \fI* [%h] %s\fR\&. (See the "PRETTY FORMATS" section of
  71. \fBgit-log\fR(1)\&.)
  72. .sp
  73. .if n \{\
  74. .RS 4
  75. .\}
  76. .nf
  77. Each pretty\-printed commit will be rewrapped before it is shown\&.
  78. .fi
  79. .if n \{\
  80. .RE
  81. .\}
  82. .RE
  83. .PP
  84. \-\-date=<format>
  85. .RS 4
  86. Show dates formatted according to the given date string\&. (See the
  87. \fB\-\-date\fR
  88. option in the "Commit Formatting" section of
  89. \fBgit-log\fR(1))\&. Useful with
  90. \fB\-\-group=format:\fR\fI<format>\fR\&.
  91. .RE
  92. .PP
  93. \-\-group=<type>
  94. .RS 4
  95. Group commits based on
  96. \fI<type>\fR\&. If no
  97. \fB\-\-group\fR
  98. option is specified, the default is
  99. \fBauthor\fR\&.
  100. \fI<type>\fR
  101. is one of:
  102. .sp
  103. .RS 4
  104. .ie n \{\
  105. \h'-04'\(bu\h'+03'\c
  106. .\}
  107. .el \{\
  108. .sp -1
  109. .IP \(bu 2.3
  110. .\}
  111. \fBauthor\fR, commits are grouped by author
  112. .RE
  113. .sp
  114. .RS 4
  115. .ie n \{\
  116. \h'-04'\(bu\h'+03'\c
  117. .\}
  118. .el \{\
  119. .sp -1
  120. .IP \(bu 2.3
  121. .\}
  122. \fBcommitter\fR, commits are grouped by committer (the same as
  123. \fB\-c\fR)
  124. .RE
  125. .sp
  126. .RS 4
  127. .ie n \{\
  128. \h'-04'\(bu\h'+03'\c
  129. .\}
  130. .el \{\
  131. .sp -1
  132. .IP \(bu 2.3
  133. .\}
  134. \fBtrailer:\fR\fI<field>\fR, the
  135. \fI<field>\fR
  136. is interpreted as a case\-insensitive commit message trailer (see
  137. \fBgit-interpret-trailers\fR(1))\&. For example, if your project uses
  138. \fBReviewed\-by\fR
  139. trailers, you might want to see who has been reviewing with
  140. \fBgit\fR
  141. \fBshortlog\fR
  142. \fB\-ns\fR
  143. \fB\-\-group=trailer:reviewed\-by\fR\&.
  144. .RE
  145. .sp
  146. .RS 4
  147. .ie n \{\
  148. \h'-04'\(bu\h'+03'\c
  149. .\}
  150. .el \{\
  151. .sp -1
  152. .IP \(bu 2.3
  153. .\}
  154. \fBformat:\fR\fI<format>\fR, any string accepted by the
  155. \fB\-\-format\fR
  156. option of
  157. \fIgit log\fR\&. (See the "PRETTY FORMATS" section of
  158. \fBgit-log\fR(1)\&.)
  159. .sp
  160. Note that commits that do not include the trailer will not be counted\&. Likewise, commits with multiple trailers (e\&.g\&., multiple signoffs) may be counted more than once (but only once per unique trailer value in that commit)\&.
  161. .sp
  162. Shortlog will attempt to parse each trailer value as a
  163. \fBname\fR
  164. \fI<email>\fR
  165. identity\&. If successful, the mailmap is applied and the email is omitted unless the
  166. \fB\-\-email\fR
  167. option is specified\&. If the value cannot be parsed as an identity, it will be taken literally and completely\&.
  168. .RE
  169. .sp
  170. If
  171. \fB\-\-group\fR
  172. is specified multiple times, commits are counted under each value (but again, only once per unique value in that commit)\&. For example,
  173. \fBgit\fR
  174. \fBshortlog\fR
  175. \fB\-\-group=author\fR
  176. \fB\-\-group=trailer:co\-authored\-by\fR
  177. counts both authors and co\-authors\&.
  178. .RE
  179. .PP
  180. \-c, \-\-committer
  181. .RS 4
  182. This is an alias for
  183. \fB\-\-group=committer\fR\&.
  184. .RE
  185. .PP
  186. \-w[<width>[,<indent1>[,<indent2>]]]
  187. .RS 4
  188. Linewrap the output by wrapping each line at
  189. \fBwidth\fR\&. The first line of each entry is indented by
  190. \fBindent1\fR
  191. spaces, and the second and subsequent lines are indented by
  192. \fBindent2\fR
  193. spaces\&.
  194. \fBwidth\fR,
  195. \fBindent1\fR, and
  196. \fBindent2\fR
  197. default to 76, 6 and 9 respectively\&.
  198. .sp
  199. If width is
  200. \fB0\fR
  201. (zero) then indent the lines of the output without wrapping them\&.
  202. .RE
  203. .PP
  204. <revision\-range>
  205. .RS 4
  206. Show only commits in the specified revision range\&. When no <revision\-range> is specified, it defaults to
  207. \fBHEAD\fR
  208. (i\&.e\&. the whole history leading to the current commit)\&.
  209. \fBorigin\fR\fB\&.\&.\fR\fBHEAD\fR
  210. specifies all the commits reachable from the current commit (i\&.e\&.
  211. \fBHEAD\fR), but not from
  212. \fBorigin\fR\&. For a complete list of ways to spell <revision\-range>, see the "Specifying Ranges" section of
  213. \fBgitrevisions\fR(7)\&.
  214. .RE
  215. .PP
  216. [\-\-] <path>\&...\:
  217. .RS 4
  218. Consider only commits that are enough to explain how the files that match the specified paths came to be\&.
  219. .sp
  220. Paths may need to be prefixed with
  221. \fB\-\-\fR
  222. to separate them from options or the revision range, when confusion arises\&.
  223. .RE
  224. .SS "Commit Limiting"
  225. .sp
  226. Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
  227. .sp
  228. 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\&.
  229. .sp
  230. Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
  231. .PP
  232. \-<number>, \-n <number>, \-\-max\-count=<number>
  233. .RS 4
  234. Limit the number of commits to output\&.
  235. .RE
  236. .PP
  237. \-\-skip=<number>
  238. .RS 4
  239. Skip
  240. \fInumber\fR
  241. commits before starting to show the commit output\&.
  242. .RE
  243. .PP
  244. \-\-since=<date>, \-\-after=<date>
  245. .RS 4
  246. Show commits more recent than a specific date\&.
  247. .RE
  248. .PP
  249. \-\-since\-as\-filter=<date>
  250. .RS 4
  251. 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\&.
  252. .RE
  253. .PP
  254. \-\-until=<date>, \-\-before=<date>
  255. .RS 4
  256. Show commits older than a specific date\&.
  257. .RE
  258. .PP
  259. \-\-author=<pattern>, \-\-committer=<pattern>
  260. .RS 4
  261. Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
  262. \fB\-\-author=\fR\fI<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
  263. \fB\-\-committer=\fR\fI<pattern>\fR)\&.
  264. .RE
  265. .PP
  266. \-\-grep\-reflog=<pattern>
  267. .RS 4
  268. Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
  269. \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
  270. \fB\-\-walk\-reflogs\fR
  271. is in use\&.
  272. .RE
  273. .PP
  274. \-\-grep=<pattern>
  275. .RS 4
  276. Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
  277. \fB\-\-grep=\fR\fI<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
  278. \fB\-\-all\-match\fR)\&.
  279. .sp
  280. When
  281. \fB\-\-notes\fR
  282. is in effect, the message from the notes is matched as if it were part of the log message\&.
  283. .RE
  284. .PP
  285. \-\-all\-match
  286. .RS 4
  287. Limit the commits output to ones that match all given
  288. \fB\-\-grep\fR, instead of ones that match at least one\&.
  289. .RE
  290. .PP
  291. \-\-invert\-grep
  292. .RS 4
  293. Limit the commits output to ones with a log message that do not match the pattern specified with
  294. \fB\-\-grep=\fR\fI<pattern>\fR\&.
  295. .RE
  296. .PP
  297. \-i, \-\-regexp\-ignore\-case
  298. .RS 4
  299. Match the regular expression limiting patterns without regard to letter case\&.
  300. .RE
  301. .PP
  302. \-\-basic\-regexp
  303. .RS 4
  304. Consider the limiting patterns to be basic regular expressions; this is the default\&.
  305. .RE
  306. .PP
  307. \-E, \-\-extended\-regexp
  308. .RS 4
  309. Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
  310. .RE
  311. .PP
  312. \-F, \-\-fixed\-strings
  313. .RS 4
  314. Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
  315. .RE
  316. .PP
  317. \-P, \-\-perl\-regexp
  318. .RS 4
  319. Consider the limiting patterns to be Perl\-compatible regular expressions\&.
  320. .sp
  321. 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\&.
  322. .RE
  323. .PP
  324. \-\-remove\-empty
  325. .RS 4
  326. Stop when a given path disappears from the tree\&.
  327. .RE
  328. .PP
  329. \-\-merges
  330. .RS 4
  331. Print only merge commits\&. This is exactly the same as
  332. \fB\-\-min\-parents=2\fR\&.
  333. .RE
  334. .PP
  335. \-\-no\-merges
  336. .RS 4
  337. Do not print commits with more than one parent\&. This is exactly the same as
  338. \fB\-\-max\-parents=1\fR\&.
  339. .RE
  340. .PP
  341. \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
  342. .RS 4
  343. Show only commits which have at least (or at most) that many parent commits\&. In particular,
  344. \fB\-\-max\-parents=1\fR
  345. is the same as
  346. \fB\-\-no\-merges\fR,
  347. \fB\-\-min\-parents=2\fR
  348. is the same as
  349. \fB\-\-merges\fR\&.
  350. \fB\-\-max\-parents=0\fR
  351. gives all root commits and
  352. \fB\-\-min\-parents=3\fR
  353. all octopus merges\&.
  354. .sp
  355. \fB\-\-no\-min\-parents\fR
  356. and
  357. \fB\-\-no\-max\-parents\fR
  358. reset these limits (to no limit) again\&. Equivalent forms are
  359. \fB\-\-min\-parents=0\fR
  360. (any commit has 0 or more parents) and
  361. \fB\-\-max\-parents=\-1\fR
  362. (negative numbers denote no upper limit)\&.
  363. .RE
  364. .PP
  365. \-\-first\-parent
  366. .RS 4
  367. 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\&.
  368. .RE
  369. .PP
  370. \-\-exclude\-first\-parent\-only
  371. .RS 4
  372. When finding commits to exclude (with a
  373. \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\&.
  374. .RE
  375. .PP
  376. \-\-not
  377. .RS 4
  378. Reverses the meaning of the
  379. \fI^\fR
  380. prefix (or lack thereof) for all following revision specifiers, up to the next
  381. \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\&.
  382. .RE
  383. .PP
  384. \-\-all
  385. .RS 4
  386. Pretend as if all the refs in
  387. \fBrefs/\fR, along with
  388. \fBHEAD\fR, are listed on the command line as
  389. \fI<commit>\fR\&.
  390. .RE
  391. .PP
  392. \-\-branches[=<pattern>]
  393. .RS 4
  394. Pretend as if all the refs in
  395. \fBrefs/heads\fR
  396. are listed on the command line as
  397. \fI<commit>\fR\&. If
  398. \fI<pattern>\fR
  399. is given, limit branches to ones matching given shell glob\&. If pattern lacks
  400. \fI?\fR,
  401. \fI*\fR, or
  402. \fI[\fR,
  403. \fI/*\fR
  404. at the end is implied\&.
  405. .RE
  406. .PP
  407. \-\-tags[=<pattern>]
  408. .RS 4
  409. Pretend as if all the refs in
  410. \fBrefs/tags\fR
  411. are listed on the command line as
  412. \fI<commit>\fR\&. If
  413. \fI<pattern>\fR
  414. is given, limit tags to ones matching given shell glob\&. If pattern lacks
  415. \fI?\fR,
  416. \fI*\fR, or
  417. \fI[\fR,
  418. \fI/*\fR
  419. at the end is implied\&.
  420. .RE
  421. .PP
  422. \-\-remotes[=<pattern>]
  423. .RS 4
  424. Pretend as if all the refs in
  425. \fBrefs/remotes\fR
  426. are listed on the command line as
  427. \fI<commit>\fR\&. If
  428. \fI<pattern>\fR
  429. is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
  430. \fI?\fR,
  431. \fI*\fR, or
  432. \fI[\fR,
  433. \fI/*\fR
  434. at the end is implied\&.
  435. .RE
  436. .PP
  437. \-\-glob=<glob\-pattern>
  438. .RS 4
  439. Pretend as if all the refs matching shell glob
  440. \fI<glob\-pattern>\fR
  441. are listed on the command line as
  442. \fI<commit>\fR\&. Leading
  443. \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
  444. \fI?\fR,
  445. \fI*\fR, or
  446. \fI[\fR,
  447. \fI/*\fR
  448. at the end is implied\&.
  449. .RE
  450. .PP
  451. \-\-exclude=<glob\-pattern>
  452. .RS 4
  453. Do not include refs matching
  454. \fI<glob\-pattern>\fR
  455. that the next
  456. \fB\-\-all\fR,
  457. \fB\-\-branches\fR,
  458. \fB\-\-tags\fR,
  459. \fB\-\-remotes\fR, or
  460. \fB\-\-glob\fR
  461. would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
  462. \fB\-\-all\fR,
  463. \fB\-\-branches\fR,
  464. \fB\-\-tags\fR,
  465. \fB\-\-remotes\fR, or
  466. \fB\-\-glob\fR
  467. option (other options or arguments do not clear accumulated patterns)\&.
  468. .sp
  469. The patterns given should not begin with
  470. \fBrefs/heads\fR,
  471. \fBrefs/tags\fR, or
  472. \fBrefs/remotes\fR
  473. when applied to
  474. \fB\-\-branches\fR,
  475. \fB\-\-tags\fR, or
  476. \fB\-\-remotes\fR, respectively, and they must begin with
  477. \fBrefs/\fR
  478. when applied to
  479. \fB\-\-glob\fR
  480. or
  481. \fB\-\-all\fR\&. If a trailing
  482. \fI/*\fR
  483. is intended, it must be given explicitly\&.
  484. .RE
  485. .PP
  486. \-\-exclude\-hidden=[fetch|receive|uploadpack]
  487. .RS 4
  488. Do not include refs that would be hidden by
  489. \fBgit\-fetch\fR,
  490. \fBgit\-receive\-pack\fR
  491. or
  492. \fBgit\-upload\-pack\fR
  493. by consulting the appropriate
  494. \fBfetch\&.hideRefs\fR,
  495. \fBreceive\&.hideRefs\fR
  496. or
  497. \fBuploadpack\&.hideRefs\fR
  498. configuration along with
  499. \fBtransfer\&.hideRefs\fR
  500. (see
  501. \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
  502. \fB\-\-all\fR
  503. or
  504. \fB\-\-glob\fR
  505. and is cleared after processing them\&.
  506. .RE
  507. .PP
  508. \-\-reflog
  509. .RS 4
  510. Pretend as if all objects mentioned by reflogs are listed on the command line as
  511. \fI<commit>\fR\&.
  512. .RE
  513. .PP
  514. \-\-alternate\-refs
  515. .RS 4
  516. 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
  517. \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
  518. \fBcore\&.alternateRefsCommand\fR, etc\&. See
  519. \fBgit-config\fR(1)\&.
  520. .RE
  521. .PP
  522. \-\-single\-worktree
  523. .RS 4
  524. By default, all working trees will be examined by the following options when there are more than one (see
  525. \fBgit-worktree\fR(1)):
  526. \fB\-\-all\fR,
  527. \fB\-\-reflog\fR
  528. and
  529. \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
  530. .RE
  531. .PP
  532. \-\-ignore\-missing
  533. .RS 4
  534. Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
  535. .RE
  536. .PP
  537. \-\-bisect
  538. .RS 4
  539. Pretend as if the bad bisection ref
  540. \fBrefs/bisect/bad\fR
  541. was listed and as if it was followed by
  542. \fB\-\-not\fR
  543. and the good bisection refs
  544. \fBrefs/bisect/good\-\fR* on the command line\&.
  545. .RE
  546. .PP
  547. \-\-stdin
  548. .RS 4
  549. In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
  550. \fB\-\-all\fR
  551. and
  552. \fB\-\-glob=\fR\&. When a
  553. \fB\-\-\fR
  554. separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
  555. \fB\-\-not\fR
  556. 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\&.
  557. .RE
  558. .PP
  559. \-\-cherry\-mark
  560. .RS 4
  561. Like
  562. \fB\-\-cherry\-pick\fR
  563. (see below) but mark equivalent commits with
  564. \fB=\fR
  565. rather than omitting them, and inequivalent ones with
  566. \fB+\fR\&.
  567. .RE
  568. .PP
  569. \-\-cherry\-pick
  570. .RS 4
  571. Omit any commit that introduces the same change as another commit on the
  572. \(lqother side\(rq
  573. when the set of commits are limited with symmetric difference\&.
  574. .sp
  575. For example, if you have two branches,
  576. \fBA\fR
  577. and
  578. \fBB\fR, a usual way to list all commits on only one side of them is with
  579. \fB\-\-left\-right\fR
  580. (see the example below in the description of the
  581. \fB\-\-left\-right\fR
  582. option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
  583. \(lq3rd on b\(rq
  584. may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
  585. .RE
  586. .PP
  587. \-\-left\-only, \-\-right\-only
  588. .RS 4
  589. List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked < resp\&. > by
  590. \fB\-\-left\-right\fR\&.
  591. .sp
  592. For example,
  593. \fB\-\-cherry\-pick\fR
  594. \fB\-\-right\-only\fR
  595. \fBA\fR\fB\&.\&.\&.\fR\fBB\fR
  596. omits those commits from
  597. \fBB\fR
  598. which are in
  599. \fBA\fR
  600. or are patch\-equivalent to a commit in
  601. \fBA\fR\&. In other words, this lists the
  602. \fB+\fR
  603. commits from
  604. \fBgit\fR
  605. \fBcherry\fR
  606. \fBA\fR
  607. \fBB\fR\&. More precisely,
  608. \fB\-\-cherry\-pick\fR
  609. \fB\-\-right\-only\fR
  610. \fB\-\-no\-merges\fR
  611. gives the exact list\&.
  612. .RE
  613. .PP
  614. \-\-cherry
  615. .RS 4
  616. A synonym for
  617. \fB\-\-right\-only\fR
  618. \fB\-\-cherry\-mark\fR
  619. \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
  620. \fBgit\fR
  621. \fBlog\fR
  622. \fB\-\-cherry\fR
  623. \fBupstream\fR\fB\&.\&.\&.\fR\fBmybranch\fR, similar to
  624. \fBgit\fR
  625. \fBcherry\fR
  626. \fBupstream\fR
  627. \fBmybranch\fR\&.
  628. .RE
  629. .PP
  630. \-g, \-\-walk\-reflogs
  631. .RS 4
  632. 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,
  633. \fI^commit\fR,
  634. \fIcommit1\&.\&.commit2\fR, and
  635. \fIcommit1\&.\&.\&.commit2\fR
  636. notations cannot be used)\&.
  637. .sp
  638. With
  639. \fB\-\-pretty\fR
  640. format other than
  641. \fBoneline\fR
  642. and
  643. \fBreference\fR
  644. (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
  645. \fBref@\fR{\fI<Nth>\fR} (where
  646. \fI<Nth>\fR
  647. is the reverse\-chronological index in the reflog) or as
  648. \fBref@\fR{\fI<timestamp>\fR} (with the
  649. \fI<timestamp>\fR
  650. for that entry), depending on a few rules:
  651. .sp
  652. .RS 4
  653. .ie n \{\
  654. \h'-04' 1.\h'+01'\c
  655. .\}
  656. .el \{\
  657. .sp -1
  658. .IP " 1." 4.2
  659. .\}
  660. If the starting point is specified as
  661. \fBref@\fR{\fI<Nth>\fR}, show the index format\&.
  662. .RE
  663. .sp
  664. .RS 4
  665. .ie n \{\
  666. \h'-04' 2.\h'+01'\c
  667. .\}
  668. .el \{\
  669. .sp -1
  670. .IP " 2." 4.2
  671. .\}
  672. If the starting point was specified as
  673. \fBref@\fR{now}, show the timestamp format\&.
  674. .RE
  675. .sp
  676. .RS 4
  677. .ie n \{\
  678. \h'-04' 3.\h'+01'\c
  679. .\}
  680. .el \{\
  681. .sp -1
  682. .IP " 3." 4.2
  683. .\}
  684. If neither was used, but
  685. \fB\-\-date\fR
  686. was given on the command line, show the timestamp in the format requested by
  687. \fB\-\-date\fR\&.
  688. .RE
  689. .sp
  690. .RS 4
  691. .ie n \{\
  692. \h'-04' 4.\h'+01'\c
  693. .\}
  694. .el \{\
  695. .sp -1
  696. .IP " 4." 4.2
  697. .\}
  698. Otherwise, show the index format\&.
  699. .RE
  700. .sp
  701. Under
  702. \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
  703. \fB\-\-reverse\fR\&. See also
  704. \fBgit-reflog\fR(1)\&.
  705. .sp
  706. Under
  707. \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
  708. .RE
  709. .PP
  710. \-\-merge
  711. .RS 4
  712. Show commits touching conflicted paths in the range
  713. \fBHEAD\fR\fB\&.\&.\&.\fR\fI<other>\fR, where
  714. \fI<other>\fR
  715. is the first existing pseudoref in
  716. \fBMERGE_HEAD\fR,
  717. \fBCHERRY_PICK_HEAD\fR,
  718. \fBREVERT_HEAD\fR
  719. or
  720. \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\&.
  721. .RE
  722. .PP
  723. \-\-boundary
  724. .RS 4
  725. Output excluded boundary commits\&. Boundary commits are prefixed with
  726. \fB\-\fR\&.
  727. .RE
  728. .SS "History Simplification"
  729. .sp
  730. 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\&.
  731. .sp
  732. The following options select the commits to be shown:
  733. .PP
  734. <paths>
  735. .RS 4
  736. Commits modifying the given <paths> are selected\&.
  737. .RE
  738. .PP
  739. \-\-simplify\-by\-decoration
  740. .RS 4
  741. Commits that are referred by some branch or tag are selected\&.
  742. .RE
  743. .sp
  744. Note that extra commits can be shown to give a meaningful history\&.
  745. .sp
  746. The following options affect the way the simplification is performed:
  747. .PP
  748. Default mode
  749. .RS 4
  750. 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)
  751. .RE
  752. .PP
  753. \-\-show\-pulls
  754. .RS 4
  755. 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\&.
  756. .RE
  757. .PP
  758. \-\-full\-history
  759. .RS 4
  760. Same as the default mode, but does not prune some history\&.
  761. .RE
  762. .PP
  763. \-\-dense
  764. .RS 4
  765. Only the selected commits are shown, plus some to have a meaningful history\&.
  766. .RE
  767. .PP
  768. \-\-sparse
  769. .RS 4
  770. All commits in the simplified history are shown\&.
  771. .RE
  772. .PP
  773. \-\-simplify\-merges
  774. .RS 4
  775. Additional option to
  776. \fB\-\-full\-history\fR
  777. to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
  778. .RE
  779. .PP
  780. \-\-ancestry\-path[=<commit>]
  781. .RS 4
  782. When given a range of commits to display (e\&.g\&.
  783. \fIcommit1\&.\&.commit2\fR
  784. or
  785. \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
  786. \fIcommit1\fR
  787. (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\&.
  788. .RE
  789. .sp
  790. A more detailed explanation follows\&.
  791. .sp
  792. 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\&.)
  793. .sp
  794. 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:
  795. .sp
  796. .if n \{\
  797. .RS 4
  798. .\}
  799. .nf
  800. \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
  801. / / / / / /
  802. I B C D E Y
  803. \e / / / / /
  804. `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
  805. .fi
  806. .if n \{\
  807. .RE
  808. .\}
  809. .sp
  810. The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
  811. .sp
  812. .RS 4
  813. .ie n \{\
  814. \h'-04'\(bu\h'+03'\c
  815. .\}
  816. .el \{\
  817. .sp -1
  818. .IP \(bu 2.3
  819. .\}
  820. \fBI\fR
  821. is the initial commit, in which
  822. \fBfoo\fR
  823. exists with contents
  824. \(lqasdf\(rq, and a file
  825. \fBquux\fR
  826. exists with contents
  827. \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
  828. \fBI\fR
  829. is !TREESAME\&.
  830. .RE
  831. .sp
  832. .RS 4
  833. .ie n \{\
  834. \h'-04'\(bu\h'+03'\c
  835. .\}
  836. .el \{\
  837. .sp -1
  838. .IP \(bu 2.3
  839. .\}
  840. In
  841. \fBA\fR,
  842. \fBfoo\fR
  843. contains just
  844. \(lqfoo\(rq\&.
  845. .RE
  846. .sp
  847. .RS 4
  848. .ie n \{\
  849. \h'-04'\(bu\h'+03'\c
  850. .\}
  851. .el \{\
  852. .sp -1
  853. .IP \(bu 2.3
  854. .\}
  855. \fBB\fR
  856. contains the same change as
  857. \fBA\fR\&. Its merge
  858. \fBM\fR
  859. is trivial and hence TREESAME to all parents\&.
  860. .RE
  861. .sp
  862. .RS 4
  863. .ie n \{\
  864. \h'-04'\(bu\h'+03'\c
  865. .\}
  866. .el \{\
  867. .sp -1
  868. .IP \(bu 2.3
  869. .\}
  870. \fBC\fR
  871. does not change
  872. \fBfoo\fR, but its merge
  873. \fBN\fR
  874. changes it to
  875. \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
  876. .RE
  877. .sp
  878. .RS 4
  879. .ie n \{\
  880. \h'-04'\(bu\h'+03'\c
  881. .\}
  882. .el \{\
  883. .sp -1
  884. .IP \(bu 2.3
  885. .\}
  886. \fBD\fR
  887. sets
  888. \fBfoo\fR
  889. to
  890. \(lqbaz\(rq\&. Its merge
  891. \fBO\fR
  892. combines the strings from
  893. \fBN\fR
  894. and
  895. \fBD\fR
  896. to
  897. \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
  898. .RE
  899. .sp
  900. .RS 4
  901. .ie n \{\
  902. \h'-04'\(bu\h'+03'\c
  903. .\}
  904. .el \{\
  905. .sp -1
  906. .IP \(bu 2.3
  907. .\}
  908. \fBE\fR
  909. changes
  910. \fBquux\fR
  911. to
  912. \(lqxyzzy\(rq, and its merge
  913. \fBP\fR
  914. combines the strings to
  915. \(lqquux xyzzy\(rq\&.
  916. \fBP\fR
  917. is TREESAME to
  918. \fBO\fR, but not to
  919. \fBE\fR\&.
  920. .RE
  921. .sp
  922. .RS 4
  923. .ie n \{\
  924. \h'-04'\(bu\h'+03'\c
  925. .\}
  926. .el \{\
  927. .sp -1
  928. .IP \(bu 2.3
  929. .\}
  930. \fBX\fR
  931. is an independent root commit that added a new file
  932. \fBside\fR, and
  933. \fBY\fR
  934. modified it\&.
  935. \fBY\fR
  936. is TREESAME to
  937. \fBX\fR\&. Its merge
  938. \fBQ\fR
  939. added
  940. \fBside\fR
  941. to
  942. \fBP\fR, and
  943. \fBQ\fR
  944. is TREESAME to
  945. \fBP\fR, but not to
  946. \fBY\fR\&.
  947. .RE
  948. .sp
  949. \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\&.
  950. .PP
  951. Default mode
  952. .RS 4
  953. Commits are included if they are not TREESAME to any parent (though this can be changed, see
  954. \fB\-\-sparse\fR
  955. 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\&.
  956. .sp
  957. This results in:
  958. .sp
  959. .if n \{\
  960. .RS 4
  961. .\}
  962. .nf
  963. \&.\-A\-\-\-N\-\-\-O
  964. / / /
  965. I\-\-\-\-\-\-\-\-\-D
  966. .fi
  967. .if n \{\
  968. .RE
  969. .\}
  970. .sp
  971. Note how the rule to only follow the TREESAME parent, if one is available, removed
  972. \fBB\fR
  973. from consideration entirely\&.
  974. \fBC\fR
  975. was considered via
  976. \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
  977. \fBI\fR
  978. is !TREESAME\&.
  979. .sp
  980. Parent/child relations are only visible with
  981. \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
  982. .RE
  983. .PP
  984. \-\-full\-history without parent rewriting
  985. .RS 4
  986. 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
  987. .sp
  988. .if n \{\
  989. .RS 4
  990. .\}
  991. .nf
  992. I A B N D O P Q
  993. .fi
  994. .if n \{\
  995. .RE
  996. .\}
  997. .sp
  998. \fBM\fR
  999. was excluded because it is TREESAME to both parents\&.
  1000. \fBE\fR,
  1001. \fBC\fR
  1002. and
  1003. \fBB\fR
  1004. were all walked, but only
  1005. \fBB\fR
  1006. was !TREESAME, so the others do not appear\&.
  1007. .sp
  1008. 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\&.
  1009. .RE
  1010. .PP
  1011. \-\-full\-history with parent rewriting
  1012. .RS 4
  1013. Ordinary commits are only included if they are !TREESAME (though this can be changed, see
  1014. \fB\-\-sparse\fR
  1015. below)\&.
  1016. .sp
  1017. Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
  1018. .sp
  1019. .if n \{\
  1020. .RS 4
  1021. .\}
  1022. .nf
  1023. \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
  1024. / / / / /
  1025. I B / D /
  1026. \e / / / /
  1027. `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
  1028. .fi
  1029. .if n \{\
  1030. .RE
  1031. .\}
  1032. .sp
  1033. Compare to
  1034. \fB\-\-full\-history\fR
  1035. without rewriting above\&. Note that
  1036. \fBE\fR
  1037. was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
  1038. \fBE\fR\*(Aqs parent
  1039. \fBI\fR\&. The same happened for
  1040. \fBC\fR
  1041. and
  1042. \fBN\fR, and
  1043. \fBX\fR,
  1044. \fBY\fR
  1045. and
  1046. \fBQ\fR\&.
  1047. .RE
  1048. .sp
  1049. In addition to the above settings, you can change whether TREESAME affects inclusion:
  1050. .PP
  1051. \-\-dense
  1052. .RS 4
  1053. Commits that are walked are included if they are not TREESAME to any parent\&.
  1054. .RE
  1055. .PP
  1056. \-\-sparse
  1057. .RS 4
  1058. All commits that are walked are included\&.
  1059. .sp
  1060. Note that without
  1061. \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\&.
  1062. .RE
  1063. .PP
  1064. \-\-simplify\-merges
  1065. .RS 4
  1066. First, build a history graph in the same way that
  1067. \fB\-\-full\-history\fR
  1068. with parent rewriting does (see above)\&.
  1069. .sp
  1070. Then simplify each commit
  1071. \fBC\fR
  1072. to its replacement
  1073. \fBC\fR\*(Aq in the final history according to the following rules:
  1074. .sp
  1075. .RS 4
  1076. .ie n \{\
  1077. \h'-04'\(bu\h'+03'\c
  1078. .\}
  1079. .el \{\
  1080. .sp -1
  1081. .IP \(bu 2.3
  1082. .\}
  1083. Set
  1084. \fBC\fR\*(Aq to
  1085. \fBC\fR\&.
  1086. .RE
  1087. .sp
  1088. .RS 4
  1089. .ie n \{\
  1090. \h'-04'\(bu\h'+03'\c
  1091. .\}
  1092. .el \{\
  1093. .sp -1
  1094. .IP \(bu 2.3
  1095. .\}
  1096. Replace each parent
  1097. \fBP\fR
  1098. of
  1099. \fBC\fR\*(Aq with its simplification
  1100. \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\&.
  1101. .RE
  1102. .sp
  1103. .RS 4
  1104. .ie n \{\
  1105. \h'-04'\(bu\h'+03'\c
  1106. .\}
  1107. .el \{\
  1108. .sp -1
  1109. .IP \(bu 2.3
  1110. .\}
  1111. If after this parent rewriting,
  1112. \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\&.
  1113. .RE
  1114. .sp
  1115. The effect of this is best shown by way of comparing to
  1116. \fB\-\-full\-history\fR
  1117. with parent rewriting\&. The example turns into:
  1118. .sp
  1119. .if n \{\
  1120. .RS 4
  1121. .\}
  1122. .nf
  1123. \&.\-A\-\-\-M\-\-\-N\-\-\-O
  1124. / / /
  1125. I B D
  1126. \e / /
  1127. `\-\-\-\-\-\-\-\-\-\*(Aq
  1128. .fi
  1129. .if n \{\
  1130. .RE
  1131. .\}
  1132. .sp
  1133. Note the major differences in
  1134. \fBN\fR,
  1135. \fBP\fR, and
  1136. \fBQ\fR
  1137. over
  1138. \fB\-\-full\-history\fR:
  1139. .sp
  1140. .RS 4
  1141. .ie n \{\
  1142. \h'-04'\(bu\h'+03'\c
  1143. .\}
  1144. .el \{\
  1145. .sp -1
  1146. .IP \(bu 2.3
  1147. .\}
  1148. \fBN\fR\*(Aqs parent list had
  1149. \fBI\fR
  1150. removed, because it is an ancestor of the other parent
  1151. \fBM\fR\&. Still,
  1152. \fBN\fR
  1153. remained because it is !TREESAME\&.
  1154. .RE
  1155. .sp
  1156. .RS 4
  1157. .ie n \{\
  1158. \h'-04'\(bu\h'+03'\c
  1159. .\}
  1160. .el \{\
  1161. .sp -1
  1162. .IP \(bu 2.3
  1163. .\}
  1164. \fBP\fR\*(Aqs parent list similarly had
  1165. \fBI\fR
  1166. removed\&.
  1167. \fBP\fR
  1168. was then removed completely, because it had one parent and is TREESAME\&.
  1169. .RE
  1170. .sp
  1171. .RS 4
  1172. .ie n \{\
  1173. \h'-04'\(bu\h'+03'\c
  1174. .\}
  1175. .el \{\
  1176. .sp -1
  1177. .IP \(bu 2.3
  1178. .\}
  1179. \fBQ\fR\*(Aqs parent list had
  1180. \fBY\fR
  1181. simplified to
  1182. \fBX\fR\&.
  1183. \fBX\fR
  1184. was then removed, because it was a TREESAME root\&.
  1185. \fBQ\fR
  1186. was then removed completely, because it had one parent and is TREESAME\&.
  1187. .RE
  1188. .RE
  1189. .sp
  1190. There is another simplification mode available:
  1191. .PP
  1192. \-\-ancestry\-path[=<commit>]
  1193. .RS 4
  1194. Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
  1195. .sp
  1196. As an example use case, consider the following commit history:
  1197. .sp
  1198. .if n \{\
  1199. .RS 4
  1200. .\}
  1201. .nf
  1202. D\-\-\-E\-\-\-\-\-\-\-F
  1203. / \e \e
  1204. B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
  1205. / \e
  1206. A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
  1207. .fi
  1208. .if n \{\
  1209. .RE
  1210. .\}
  1211. .sp
  1212. A regular
  1213. \fID\&.\&.M\fR
  1214. computes the set of commits that are ancestors of
  1215. \fBM\fR, but excludes the ones that are ancestors of
  1216. \fBD\fR\&. This is useful to see what happened to the history leading to
  1217. \fBM\fR
  1218. since
  1219. \fBD\fR, in the sense that
  1220. \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
  1221. \fBA\fR
  1222. and
  1223. \fBB\fR
  1224. (and
  1225. \fBD\fR
  1226. itself, of course)\&.
  1227. .sp
  1228. When we want to find out what commits in
  1229. \fBM\fR
  1230. are contaminated with the bug introduced by
  1231. \fBD\fR
  1232. and need fixing, however, we might want to view only the subset of
  1233. \fID\&.\&.M\fR
  1234. that are actually descendants of
  1235. \fBD\fR, i\&.e\&. excluding
  1236. \fBC\fR
  1237. and
  1238. \fBK\fR\&. This is exactly what the
  1239. \fB\-\-ancestry\-path\fR
  1240. option does\&. Applied to the
  1241. \fID\&.\&.M\fR
  1242. range, it results in:
  1243. .sp
  1244. .if n \{\
  1245. .RS 4
  1246. .\}
  1247. .nf
  1248. E\-\-\-\-\-\-\-F
  1249. \e \e
  1250. G\-\-\-H\-\-\-I\-\-\-J
  1251. \e
  1252. L\-\-M
  1253. .fi
  1254. .if n \{\
  1255. .RE
  1256. .\}
  1257. .sp
  1258. We can also use
  1259. \fB\-\-ancestry\-path=D\fR
  1260. instead of
  1261. \fB\-\-ancestry\-path\fR
  1262. which means the same thing when applied to the
  1263. \fID\&.\&.M\fR
  1264. range but is just more explicit\&.
  1265. .sp
  1266. 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
  1267. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1268. which contain that topic in their ancestry path\&. So, using
  1269. \fB\-\-ancestry\-path=H\fR
  1270. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1271. for example would result in:
  1272. .sp
  1273. .if n \{\
  1274. .RS 4
  1275. .\}
  1276. .nf
  1277. E
  1278. \e
  1279. G\-\-\-H\-\-\-I\-\-\-J
  1280. \e
  1281. L\-\-M
  1282. .fi
  1283. .if n \{\
  1284. .RE
  1285. .\}
  1286. .sp
  1287. Whereas
  1288. \fB\-\-ancestry\-path=K\fR
  1289. \fBD\fR\fB\&.\&.\fR\fBM\fR
  1290. would result in
  1291. .sp
  1292. .if n \{\
  1293. .RS 4
  1294. .\}
  1295. .nf
  1296. K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
  1297. .fi
  1298. .if n \{\
  1299. .RE
  1300. .\}
  1301. .RE
  1302. .sp
  1303. Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
  1304. .sp
  1305. 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:
  1306. .sp
  1307. .if n \{\
  1308. .RS 4
  1309. .\}
  1310. .nf
  1311. \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
  1312. / / \e \e \e/ / /
  1313. I B \e R\-\*(Aq`\-Z\*(Aq /
  1314. \e / \e/ /
  1315. \e / /\e /
  1316. `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
  1317. .fi
  1318. .if n \{\
  1319. .RE
  1320. .\}
  1321. .sp
  1322. 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\&.
  1323. .sp
  1324. 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:
  1325. .sp
  1326. .if n \{\
  1327. .RS 4
  1328. .\}
  1329. .nf
  1330. I\-\-\-X
  1331. .fi
  1332. .if n \{\
  1333. .RE
  1334. .\}
  1335. .sp
  1336. 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:
  1337. .sp
  1338. .if n \{\
  1339. .RS 4
  1340. .\}
  1341. .nf
  1342. \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
  1343. / / \e \e \e/ / /
  1344. I B \e R\-\*(Aq`\-\-\*(Aq /
  1345. \e / \e/ /
  1346. \e / /\e /
  1347. `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
  1348. .fi
  1349. .if n \{\
  1350. .RE
  1351. .\}
  1352. .sp
  1353. 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\&.
  1354. .sp
  1355. 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:
  1356. .sp
  1357. .if n \{\
  1358. .RS 4
  1359. .\}
  1360. .nf
  1361. \&.\-A\-\-\-M\-\-\&.
  1362. / / \e
  1363. I B R
  1364. \e / /
  1365. \e / /
  1366. `\-\-\-X\-\-\*(Aq
  1367. .fi
  1368. .if n \{\
  1369. .RE
  1370. .\}
  1371. .sp
  1372. 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\&.
  1373. .sp
  1374. 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\&.
  1375. .sp
  1376. 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\&.
  1377. .PP
  1378. \-\-show\-pulls
  1379. .RS 4
  1380. 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\&.
  1381. .sp
  1382. When a merge commit is included by
  1383. \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
  1384. \fB\-\-show\-pulls\fR
  1385. on this example (and no other options) the resulting graph is:
  1386. .sp
  1387. .if n \{\
  1388. .RS 4
  1389. .\}
  1390. .nf
  1391. I\-\-\-X\-\-\-R\-\-\-N
  1392. .fi
  1393. .if n \{\
  1394. .RE
  1395. .\}
  1396. .sp
  1397. Here, the merge commits
  1398. \fBR\fR
  1399. and
  1400. \fBN\fR
  1401. are included because they pulled the commits
  1402. \fBX\fR
  1403. and
  1404. \fBR\fR
  1405. into the base branch, respectively\&. These merges are the reason the commits
  1406. \fBA\fR
  1407. and
  1408. \fBB\fR
  1409. do not appear in the default history\&.
  1410. .sp
  1411. When
  1412. \fB\-\-show\-pulls\fR
  1413. is paired with
  1414. \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
  1415. .sp
  1416. .if n \{\
  1417. .RS 4
  1418. .\}
  1419. .nf
  1420. \&.\-A\-\-\-M\-\-\&. N
  1421. / / \e /
  1422. I B R
  1423. \e / /
  1424. \e / /
  1425. `\-\-\-X\-\-\*(Aq
  1426. .fi
  1427. .if n \{\
  1428. .RE
  1429. .\}
  1430. .sp
  1431. Notice that since
  1432. \fBM\fR
  1433. is reachable from
  1434. \fBR\fR, the edge from
  1435. \fBN\fR
  1436. to
  1437. \fBM\fR
  1438. was simplified away\&. However,
  1439. \fBN\fR
  1440. still appears in the history as an important commit because it "pulled" the change
  1441. \fBR\fR
  1442. into the main branch\&.
  1443. .RE
  1444. .sp
  1445. 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)\&.
  1446. .SH "MAPPING AUTHORS"
  1447. .sp
  1448. See \fBgitmailmap\fR(5)\&.
  1449. .sp
  1450. Note that if \fBgit\fR \fBshortlog\fR is run outside of a repository (to process log contents on standard input), it will look for a \&.\fBmailmap\fR file in the current directory\&.
  1451. .SH "GIT"
  1452. .sp
  1453. Part of the \fBgit\fR(1) suite