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-show.1 (75931B)


  1. '\" t
  2. .\" Title: git-show
  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\-SHOW" "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-show \- Show various types of objects
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit show\fR [<options>] [<object>\&...\:]
  36. .fi
  37. .SH "DESCRIPTION"
  38. .sp
  39. Shows one or more objects (blobs, trees, tags and commits)\&.
  40. .sp
  41. For commits it shows the log message and textual diff\&. It also presents the merge commit in a special format as produced by \fIgit diff\-tree \-\-cc\fR\&.
  42. .sp
  43. For tags, it shows the tag message and the referenced objects\&.
  44. .sp
  45. For trees, it shows the names (equivalent to \fIgit ls\-tree\fR with \-\-name\-only)\&.
  46. .sp
  47. For plain blobs, it shows the plain contents\&.
  48. .sp
  49. Some options that \fIgit log\fR command understands can be used to control how the changes the commit introduces are shown\&.
  50. .sp
  51. This manual page describes only the most frequently used options\&.
  52. .SH "OPTIONS"
  53. .PP
  54. <object>\&...\:
  55. .RS 4
  56. The names of objects to show (defaults to
  57. \fIHEAD\fR)\&. For a more complete list of ways to spell object names, see "SPECIFYING REVISIONS" section in
  58. \fBgitrevisions\fR(7)\&.
  59. .RE
  60. .PP
  61. \-\-pretty[=<format>], \-\-format=<format>
  62. .RS 4
  63. Pretty\-print the contents of the commit logs in a given format, where
  64. \fI<format>\fR
  65. can be one of
  66. \fIoneline\fR,
  67. \fIshort\fR,
  68. \fImedium\fR,
  69. \fIfull\fR,
  70. \fIfuller\fR,
  71. \fIreference\fR,
  72. \fIemail\fR,
  73. \fIraw\fR,
  74. \fIformat:<string>\fR
  75. and
  76. \fItformat:<string>\fR\&. When
  77. \fI<format>\fR
  78. is none of the above, and has
  79. \fI%placeholder\fR
  80. in it, it acts as if
  81. \fI\-\-pretty=tformat:<format>\fR
  82. were given\&.
  83. .sp
  84. See the "PRETTY FORMATS" section for some additional details for each format\&. When
  85. \fI=<format>\fR
  86. part is omitted, it defaults to
  87. \fImedium\fR\&.
  88. .sp
  89. Note: you can specify the default pretty format in the repository configuration (see
  90. \fBgit-config\fR(1))\&.
  91. .RE
  92. .PP
  93. \-\-abbrev\-commit
  94. .RS 4
  95. 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\&.
  96. .sp
  97. This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
  98. .RE
  99. .PP
  100. \-\-no\-abbrev\-commit
  101. .RS 4
  102. Show the full 40\-byte hexadecimal commit object name\&. This negates
  103. \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
  104. \fBlog\&.abbrevCommit\fR
  105. variable\&.
  106. .RE
  107. .PP
  108. \-\-oneline
  109. .RS 4
  110. This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
  111. .RE
  112. .PP
  113. \-\-encoding=<encoding>
  114. .RS 4
  115. 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
  116. \fBX\fR
  117. and we are outputting in
  118. \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\&.
  119. .RE
  120. .PP
  121. \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
  122. .RS 4
  123. Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
  124. \fI<n>\fR) in the log message before showing it in the output\&.
  125. \fB\-\-expand\-tabs\fR
  126. is a short\-hand for
  127. \fB\-\-expand\-tabs=8\fR, and
  128. \fB\-\-no\-expand\-tabs\fR
  129. is a short\-hand for
  130. \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
  131. .sp
  132. By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
  133. \fImedium\fR, which is the default,
  134. \fIfull\fR, and
  135. \fIfuller\fR)\&.
  136. .RE
  137. .PP
  138. \-\-notes[=<ref>]
  139. .RS 4
  140. Show the notes (see
  141. \fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for
  142. \fBgit\fR
  143. \fBlog\fR,
  144. \fBgit\fR
  145. \fBshow\fR
  146. and
  147. \fBgit\fR
  148. \fBwhatchanged\fR
  149. commands when there is no
  150. \fB\-\-pretty\fR,
  151. \fB\-\-format\fR, or
  152. \fB\-\-oneline\fR
  153. option given on the command line\&.
  154. .sp
  155. By default, the notes shown are from the notes refs listed in the
  156. \fBcore\&.notesRef\fR
  157. and
  158. \fBnotes\&.displayRef\fR
  159. variables (or corresponding environment overrides)\&. See
  160. \fBgit-config\fR(1)
  161. for more details\&.
  162. .sp
  163. With an optional
  164. \fI<ref>\fR
  165. argument, use the ref to find the notes to display\&. The ref can specify the full refname when it begins with
  166. \fBrefs/notes/\fR; when it begins with
  167. \fBnotes/\fR,
  168. \fBrefs/\fR
  169. and otherwise
  170. \fBrefs/notes/\fR
  171. is prefixed to form the full name of the ref\&.
  172. .sp
  173. Multiple \-\-notes options can be combined to control which notes are being displayed\&. Examples: "\-\-notes=foo" will show only notes from "refs/notes/foo"; "\-\-notes=foo \-\-notes" will show both notes from "refs/notes/foo" and from the default notes ref(s)\&.
  174. .RE
  175. .PP
  176. \-\-no\-notes
  177. .RS 4
  178. Do not show notes\&. This negates the above
  179. \fB\-\-notes\fR
  180. option, by resetting the list of notes refs from which notes are shown\&. Options are parsed in the order given on the command line, so e\&.g\&. "\-\-notes \-\-notes=foo \-\-no\-notes \-\-notes=bar" will only show notes from "refs/notes/bar"\&.
  181. .RE
  182. .PP
  183. \-\-show\-notes\-by\-default
  184. .RS 4
  185. Show the default notes unless options for displaying specific notes are given\&.
  186. .RE
  187. .PP
  188. \-\-show\-notes[=<ref>], \-\-[no\-]standard\-notes
  189. .RS 4
  190. These options are deprecated\&. Use the above \-\-notes/\-\-no\-notes options instead\&.
  191. .RE
  192. .PP
  193. \-\-show\-signature
  194. .RS 4
  195. Check the validity of a signed commit object by passing the signature to
  196. \fBgpg\fR
  197. \fB\-\-verify\fR
  198. and show the output\&.
  199. .RE
  200. .SH "PRETTY FORMATS"
  201. .sp
  202. 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\&.
  203. .sp
  204. 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:
  205. .sp
  206. .RS 4
  207. .ie n \{\
  208. \h'-04'\(bu\h'+03'\c
  209. .\}
  210. .el \{\
  211. .sp -1
  212. .IP \(bu 2.3
  213. .\}
  214. \fIoneline\fR
  215. .sp
  216. .if n \{\
  217. .RS 4
  218. .\}
  219. .nf
  220. <hash> <title\-line>
  221. .fi
  222. .if n \{\
  223. .RE
  224. .\}
  225. .sp
  226. This is designed to be as compact as possible\&.
  227. .RE
  228. .sp
  229. .RS 4
  230. .ie n \{\
  231. \h'-04'\(bu\h'+03'\c
  232. .\}
  233. .el \{\
  234. .sp -1
  235. .IP \(bu 2.3
  236. .\}
  237. \fIshort\fR
  238. .sp
  239. .if n \{\
  240. .RS 4
  241. .\}
  242. .nf
  243. commit <hash>
  244. Author: <author>
  245. .fi
  246. .if n \{\
  247. .RE
  248. .\}
  249. .sp
  250. .if n \{\
  251. .RS 4
  252. .\}
  253. .nf
  254. <title\-line>
  255. .fi
  256. .if n \{\
  257. .RE
  258. .\}
  259. .RE
  260. .sp
  261. .RS 4
  262. .ie n \{\
  263. \h'-04'\(bu\h'+03'\c
  264. .\}
  265. .el \{\
  266. .sp -1
  267. .IP \(bu 2.3
  268. .\}
  269. \fImedium\fR
  270. .sp
  271. .if n \{\
  272. .RS 4
  273. .\}
  274. .nf
  275. commit <hash>
  276. Author: <author>
  277. Date: <author\-date>
  278. .fi
  279. .if n \{\
  280. .RE
  281. .\}
  282. .sp
  283. .if n \{\
  284. .RS 4
  285. .\}
  286. .nf
  287. <title\-line>
  288. .fi
  289. .if n \{\
  290. .RE
  291. .\}
  292. .sp
  293. .if n \{\
  294. .RS 4
  295. .\}
  296. .nf
  297. <full\-commit\-message>
  298. .fi
  299. .if n \{\
  300. .RE
  301. .\}
  302. .RE
  303. .sp
  304. .RS 4
  305. .ie n \{\
  306. \h'-04'\(bu\h'+03'\c
  307. .\}
  308. .el \{\
  309. .sp -1
  310. .IP \(bu 2.3
  311. .\}
  312. \fIfull\fR
  313. .sp
  314. .if n \{\
  315. .RS 4
  316. .\}
  317. .nf
  318. commit <hash>
  319. Author: <author>
  320. Commit: <committer>
  321. .fi
  322. .if n \{\
  323. .RE
  324. .\}
  325. .sp
  326. .if n \{\
  327. .RS 4
  328. .\}
  329. .nf
  330. <title\-line>
  331. .fi
  332. .if n \{\
  333. .RE
  334. .\}
  335. .sp
  336. .if n \{\
  337. .RS 4
  338. .\}
  339. .nf
  340. <full\-commit\-message>
  341. .fi
  342. .if n \{\
  343. .RE
  344. .\}
  345. .RE
  346. .sp
  347. .RS 4
  348. .ie n \{\
  349. \h'-04'\(bu\h'+03'\c
  350. .\}
  351. .el \{\
  352. .sp -1
  353. .IP \(bu 2.3
  354. .\}
  355. \fIfuller\fR
  356. .sp
  357. .if n \{\
  358. .RS 4
  359. .\}
  360. .nf
  361. commit <hash>
  362. Author: <author>
  363. AuthorDate: <author\-date>
  364. Commit: <committer>
  365. CommitDate: <committer\-date>
  366. .fi
  367. .if n \{\
  368. .RE
  369. .\}
  370. .sp
  371. .if n \{\
  372. .RS 4
  373. .\}
  374. .nf
  375. <title\-line>
  376. .fi
  377. .if n \{\
  378. .RE
  379. .\}
  380. .sp
  381. .if n \{\
  382. .RS 4
  383. .\}
  384. .nf
  385. <full\-commit\-message>
  386. .fi
  387. .if n \{\
  388. .RE
  389. .\}
  390. .RE
  391. .sp
  392. .RS 4
  393. .ie n \{\
  394. \h'-04'\(bu\h'+03'\c
  395. .\}
  396. .el \{\
  397. .sp -1
  398. .IP \(bu 2.3
  399. .\}
  400. \fIreference\fR
  401. .sp
  402. .if n \{\
  403. .RS 4
  404. .\}
  405. .nf
  406. <abbrev\-hash> (<title\-line>, <short\-author\-date>)
  407. .fi
  408. .if n \{\
  409. .RE
  410. .\}
  411. .sp
  412. This format is used to refer to another commit in a commit message and is the same as
  413. \fB\-\-pretty=\fR\*(Aqformat:%C(\fBauto\fR)%h (%s, %ad)\*(Aq\&. By default, the date is formatted with
  414. \fB\-\-date=short\fR
  415. unless another
  416. \fB\-\-date\fR
  417. option is explicitly specified\&. As with any
  418. \fBformat:\fR
  419. with format placeholders, its output is not affected by other options like
  420. \fB\-\-decorate\fR
  421. and
  422. \fB\-\-walk\-reflogs\fR\&.
  423. .RE
  424. .sp
  425. .RS 4
  426. .ie n \{\
  427. \h'-04'\(bu\h'+03'\c
  428. .\}
  429. .el \{\
  430. .sp -1
  431. .IP \(bu 2.3
  432. .\}
  433. \fIemail\fR
  434. .sp
  435. .if n \{\
  436. .RS 4
  437. .\}
  438. .nf
  439. From <hash> <date>
  440. From: <author>
  441. Date: <author\-date>
  442. Subject: [PATCH] <title\-line>
  443. .fi
  444. .if n \{\
  445. .RE
  446. .\}
  447. .sp
  448. .if n \{\
  449. .RS 4
  450. .\}
  451. .nf
  452. <full\-commit\-message>
  453. .fi
  454. .if n \{\
  455. .RE
  456. .\}
  457. .RE
  458. .sp
  459. .RS 4
  460. .ie n \{\
  461. \h'-04'\(bu\h'+03'\c
  462. .\}
  463. .el \{\
  464. .sp -1
  465. .IP \(bu 2.3
  466. .\}
  467. \fImboxrd\fR
  468. .sp
  469. Like
  470. \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\&.
  471. .RE
  472. .sp
  473. .RS 4
  474. .ie n \{\
  475. \h'-04'\(bu\h'+03'\c
  476. .\}
  477. .el \{\
  478. .sp -1
  479. .IP \(bu 2.3
  480. .\}
  481. \fIraw\fR
  482. .sp
  483. The
  484. \fIraw\fR
  485. 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
  486. \fIparents\fR
  487. 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
  488. \fBgit\fR
  489. \fBlog\fR
  490. \fB\-\-raw\fR\&. To get full object names in a raw diff format, use
  491. \fB\-\-no\-abbrev\fR\&.
  492. .RE
  493. .sp
  494. .RS 4
  495. .ie n \{\
  496. \h'-04'\(bu\h'+03'\c
  497. .\}
  498. .el \{\
  499. .sp -1
  500. .IP \(bu 2.3
  501. .\}
  502. \fIformat:<format\-string>\fR
  503. .sp
  504. The
  505. \fIformat:<format\-string>\fR
  506. 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
  507. \fI%n\fR
  508. instead of
  509. \fI\en\fR\&.
  510. .sp
  511. E\&.g,
  512. \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
  513. would show something like this:
  514. .sp
  515. .if n \{\
  516. .RS 4
  517. .\}
  518. .nf
  519. The author of fe6e0ee was Junio C Hamano, 23 hours ago
  520. The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
  521. .fi
  522. .if n \{\
  523. .RE
  524. .\}
  525. .sp
  526. The placeholders are:
  527. .sp
  528. .RS 4
  529. .ie n \{\
  530. \h'-04'\(bu\h'+03'\c
  531. .\}
  532. .el \{\
  533. .sp -1
  534. .IP \(bu 2.3
  535. .\}
  536. Placeholders that expand to a single literal character:
  537. .PP
  538. \fI%n\fR
  539. .RS 4
  540. newline
  541. .RE
  542. .PP
  543. \fI%%\fR
  544. .RS 4
  545. a raw
  546. \fI%\fR
  547. .RE
  548. .PP
  549. \fI%x00\fR
  550. .RS 4
  551. \fI%x\fR
  552. 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)\&.
  553. .RE
  554. .RE
  555. .sp
  556. .RS 4
  557. .ie n \{\
  558. \h'-04'\(bu\h'+03'\c
  559. .\}
  560. .el \{\
  561. .sp -1
  562. .IP \(bu 2.3
  563. .\}
  564. Placeholders that affect formatting of later placeholders:
  565. .PP
  566. \fI%Cred\fR
  567. .RS 4
  568. switch color to red
  569. .RE
  570. .PP
  571. \fI%Cgreen\fR
  572. .RS 4
  573. switch color to green
  574. .RE
  575. .PP
  576. \fI%Cblue\fR
  577. .RS 4
  578. switch color to blue
  579. .RE
  580. .PP
  581. \fI%Creset\fR
  582. .RS 4
  583. reset color
  584. .RE
  585. .PP
  586. \fI%C(\&...\:)\fR
  587. .RS 4
  588. color specification, as described under Values in the "CONFIGURATION FILE" section of
  589. \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by
  590. \fBcolor\&.diff\fR,
  591. \fBcolor\&.ui\fR, or
  592. \fB\-\-color\fR, and respecting the
  593. \fBauto\fR
  594. 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
  595. \fB\-\-color=always\fR
  596. to enable color for the whole output, including this format and anything else git might color)\&.
  597. \fBauto\fR
  598. alone (i\&.e\&. %C(\fBauto\fR)) will turn on auto coloring on the next placeholders until the color is switched again\&.
  599. .RE
  600. .PP
  601. \fI%m\fR
  602. .RS 4
  603. left (<), right (>) or boundary (\fB\-\fR) mark
  604. .RE
  605. .PP
  606. \fI%w([<w>[,<i1>[,<i2>]]])\fR
  607. .RS 4
  608. switch line wrapping, like the \-w option of
  609. \fBgit-shortlog\fR(1)\&.
  610. .RE
  611. .PP
  612. \fI%<( <N> [,trunc|ltrunc|mtrunc])\fR
  613. .RS 4
  614. make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis
  615. \fI\&.\&.\fR) at the left (ltrunc)
  616. \fB\&.\&.\fR\fBft\fR, the middle (mtrunc)
  617. \fBmi\fR\fB\&.\&.\fR\fBle\fR, or the end (trunc)
  618. \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\&.
  619. .RE
  620. .PP
  621. \fI%<|( <M> )\fR
  622. .RS 4
  623. 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\&.
  624. .RE
  625. .PP
  626. \fI%>( <N> )\fR, \fI%>|( <M> )\fR
  627. .RS 4
  628. similar to
  629. \fI%<( <N> )\fR,
  630. \fI%<|( <M> )\fR
  631. respectively, but padding spaces on the left
  632. .RE
  633. .PP
  634. \fI%>>( <N> )\fR, \fI%>>|( <M> )\fR
  635. .RS 4
  636. similar to
  637. \fI%>( <N> )\fR,
  638. \fI%>|( <M> )\fR
  639. respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces
  640. .RE
  641. .PP
  642. \fI%><( <N> )\fR, \fI%><|( <M> )\fR
  643. .RS 4
  644. similar to
  645. \fI%<( <N> )\fR,
  646. \fI%<|( <M> )\fR
  647. respectively, but padding both sides (i\&.e\&. the text is centered)
  648. .RE
  649. .RE
  650. .sp
  651. .RS 4
  652. .ie n \{\
  653. \h'-04'\(bu\h'+03'\c
  654. .\}
  655. .el \{\
  656. .sp -1
  657. .IP \(bu 2.3
  658. .\}
  659. Placeholders that expand to information extracted from the commit:
  660. .PP
  661. \fI%H\fR
  662. .RS 4
  663. commit hash
  664. .RE
  665. .PP
  666. \fI%h\fR
  667. .RS 4
  668. abbreviated commit hash
  669. .RE
  670. .PP
  671. \fI%T\fR
  672. .RS 4
  673. tree hash
  674. .RE
  675. .PP
  676. \fI%t\fR
  677. .RS 4
  678. abbreviated tree hash
  679. .RE
  680. .PP
  681. \fI%P\fR
  682. .RS 4
  683. parent hashes
  684. .RE
  685. .PP
  686. \fI%p\fR
  687. .RS 4
  688. abbreviated parent hashes
  689. .RE
  690. .PP
  691. \fI%an\fR
  692. .RS 4
  693. author name
  694. .RE
  695. .PP
  696. \fI%aN\fR
  697. .RS 4
  698. author name (respecting \&.mailmap, see
  699. \fBgit-shortlog\fR(1)
  700. or
  701. \fBgit-blame\fR(1))
  702. .RE
  703. .PP
  704. \fI%ae\fR
  705. .RS 4
  706. author email
  707. .RE
  708. .PP
  709. \fI%aE\fR
  710. .RS 4
  711. author email (respecting \&.mailmap, see
  712. \fBgit-shortlog\fR(1)
  713. or
  714. \fBgit-blame\fR(1))
  715. .RE
  716. .PP
  717. \fI%al\fR
  718. .RS 4
  719. author email local\-part (the part before the
  720. \fI@\fR
  721. sign)
  722. .RE
  723. .PP
  724. \fI%aL\fR
  725. .RS 4
  726. author local\-part (see
  727. \fI%al\fR) respecting \&.mailmap, see
  728. \fBgit-shortlog\fR(1)
  729. or
  730. \fBgit-blame\fR(1))
  731. .RE
  732. .PP
  733. \fI%ad\fR
  734. .RS 4
  735. author date (format respects \-\-date= option)
  736. .RE
  737. .PP
  738. \fI%aD\fR
  739. .RS 4
  740. author date, RFC2822 style
  741. .RE
  742. .PP
  743. \fI%ar\fR
  744. .RS 4
  745. author date, relative
  746. .RE
  747. .PP
  748. \fI%at\fR
  749. .RS 4
  750. author date, UNIX timestamp
  751. .RE
  752. .PP
  753. \fI%ai\fR
  754. .RS 4
  755. author date, ISO 8601\-like format
  756. .RE
  757. .PP
  758. \fI%aI\fR
  759. .RS 4
  760. author date, strict ISO 8601 format
  761. .RE
  762. .PP
  763. \fI%as\fR
  764. .RS 4
  765. author date, short format (\fBYYYY\-MM\-DD\fR)
  766. .RE
  767. .PP
  768. \fI%ah\fR
  769. .RS 4
  770. author date, human style (like the
  771. \fB\-\-date=human\fR
  772. option of
  773. \fBgit-rev-list\fR(1))
  774. .RE
  775. .PP
  776. \fI%cn\fR
  777. .RS 4
  778. committer name
  779. .RE
  780. .PP
  781. \fI%cN\fR
  782. .RS 4
  783. committer name (respecting \&.mailmap, see
  784. \fBgit-shortlog\fR(1)
  785. or
  786. \fBgit-blame\fR(1))
  787. .RE
  788. .PP
  789. \fI%ce\fR
  790. .RS 4
  791. committer email
  792. .RE
  793. .PP
  794. \fI%cE\fR
  795. .RS 4
  796. committer email (respecting \&.mailmap, see
  797. \fBgit-shortlog\fR(1)
  798. or
  799. \fBgit-blame\fR(1))
  800. .RE
  801. .PP
  802. \fI%cl\fR
  803. .RS 4
  804. committer email local\-part (the part before the
  805. \fI@\fR
  806. sign)
  807. .RE
  808. .PP
  809. \fI%cL\fR
  810. .RS 4
  811. committer local\-part (see
  812. \fI%cl\fR) respecting \&.mailmap, see
  813. \fBgit-shortlog\fR(1)
  814. or
  815. \fBgit-blame\fR(1))
  816. .RE
  817. .PP
  818. \fI%cd\fR
  819. .RS 4
  820. committer date (format respects \-\-date= option)
  821. .RE
  822. .PP
  823. \fI%cD\fR
  824. .RS 4
  825. committer date, RFC2822 style
  826. .RE
  827. .PP
  828. \fI%cr\fR
  829. .RS 4
  830. committer date, relative
  831. .RE
  832. .PP
  833. \fI%ct\fR
  834. .RS 4
  835. committer date, UNIX timestamp
  836. .RE
  837. .PP
  838. \fI%ci\fR
  839. .RS 4
  840. committer date, ISO 8601\-like format
  841. .RE
  842. .PP
  843. \fI%cI\fR
  844. .RS 4
  845. committer date, strict ISO 8601 format
  846. .RE
  847. .PP
  848. \fI%cs\fR
  849. .RS 4
  850. committer date, short format (\fBYYYY\-MM\-DD\fR)
  851. .RE
  852. .PP
  853. \fI%ch\fR
  854. .RS 4
  855. committer date, human style (like the
  856. \fB\-\-date=human\fR
  857. option of
  858. \fBgit-rev-list\fR(1))
  859. .RE
  860. .PP
  861. \fI%d\fR
  862. .RS 4
  863. ref names, like the \-\-decorate option of
  864. \fBgit-log\fR(1)
  865. .RE
  866. .PP
  867. \fI%D\fR
  868. .RS 4
  869. ref names without the " (", ")" wrapping\&.
  870. .RE
  871. .PP
  872. \fI%(decorate[:<options>])\fR
  873. .RS 4
  874. ref names with custom decorations\&. The
  875. \fBdecorate\fR
  876. 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\&.
  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. \fIprefix=<value>\fR: Shown before the list of ref names\&. Defaults to "\ \&("\&.
  887. .RE
  888. .sp
  889. .RS 4
  890. .ie n \{\
  891. \h'-04'\(bu\h'+03'\c
  892. .\}
  893. .el \{\
  894. .sp -1
  895. .IP \(bu 2.3
  896. .\}
  897. \fIsuffix=<value>\fR: Shown after the list of ref names\&. Defaults to ")"\&.
  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. \fIseparator=<value>\fR: Shown between ref names\&. Defaults to "\fB,\fR\ \&"\&.
  909. .RE
  910. .sp
  911. .RS 4
  912. .ie n \{\
  913. \h'-04'\(bu\h'+03'\c
  914. .\}
  915. .el \{\
  916. .sp -1
  917. .IP \(bu 2.3
  918. .\}
  919. \fIpointer=<value>\fR: Shown between HEAD and the branch it points to, if any\&. Defaults to "\ \&\fB\-\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. \fItag=<value>\fR: Shown before tag names\&. Defaults to "\fBtag:\fR\ \&"\&.
  931. .RE
  932. .RE
  933. .RE
  934. .sp
  935. For example, to produce decorations with no wrapping or tag annotations, and spaces as separators:
  936. .sp
  937. + %(\fBdecorate:prefix=,suffix=,tag=,separator=\fR
  938. )
  939. .PP
  940. \fI%(describe[:<options>])\fR
  941. .RS 4
  942. human\-readable name, like
  943. \fBgit-describe\fR(1); empty string for undescribable commits\&. The
  944. \fBdescribe\fR
  945. 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\&.
  946. .sp
  947. .RS 4
  948. .ie n \{\
  949. \h'-04'\(bu\h'+03'\c
  950. .\}
  951. .el \{\
  952. .sp -1
  953. .IP \(bu 2.3
  954. .\}
  955. \fItags[=<bool\-value>]\fR: Instead of only considering annotated tags, consider lightweight tags as well\&.
  956. .RE
  957. .sp
  958. .RS 4
  959. .ie n \{\
  960. \h'-04'\(bu\h'+03'\c
  961. .\}
  962. .el \{\
  963. .sp -1
  964. .IP \(bu 2.3
  965. .\}
  966. \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\&.
  967. .RE
  968. .sp
  969. .RS 4
  970. .ie n \{\
  971. \h'-04'\(bu\h'+03'\c
  972. .\}
  973. .el \{\
  974. .sp -1
  975. .IP \(bu 2.3
  976. .\}
  977. \fImatch=<pattern>\fR: Only consider tags matching the given
  978. \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
  979. .RE
  980. .sp
  981. .RS 4
  982. .ie n \{\
  983. \h'-04'\(bu\h'+03'\c
  984. .\}
  985. .el \{\
  986. .sp -1
  987. .IP \(bu 2.3
  988. .\}
  989. \fIexclude=<pattern>\fR: Do not consider tags matching the given
  990. \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
  991. .RE
  992. .RE
  993. .PP
  994. \fI%S\fR
  995. .RS 4
  996. ref name given on the command line by which the commit was reached (like
  997. \fBgit\fR
  998. \fBlog\fR
  999. \fB\-\-source\fR), only works with
  1000. \fBgit\fR
  1001. \fBlog\fR
  1002. .RE
  1003. .PP
  1004. \fI%e\fR
  1005. .RS 4
  1006. encoding
  1007. .RE
  1008. .PP
  1009. \fI%s\fR
  1010. .RS 4
  1011. subject
  1012. .RE
  1013. .PP
  1014. \fI%f\fR
  1015. .RS 4
  1016. sanitized subject line, suitable for a filename
  1017. .RE
  1018. .PP
  1019. \fI%b\fR
  1020. .RS 4
  1021. body
  1022. .RE
  1023. .PP
  1024. \fI%B\fR
  1025. .RS 4
  1026. raw body (unwrapped subject and body)
  1027. .RE
  1028. .PP
  1029. \fI%N\fR
  1030. .RS 4
  1031. commit notes
  1032. .RE
  1033. .PP
  1034. \fI%GG\fR
  1035. .RS 4
  1036. raw verification message from GPG for a signed commit
  1037. .RE
  1038. .PP
  1039. \fI%G?\fR
  1040. .RS 4
  1041. 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
  1042. .RE
  1043. .PP
  1044. \fI%GS\fR
  1045. .RS 4
  1046. show the name of the signer for a signed commit
  1047. .RE
  1048. .PP
  1049. \fI%GK\fR
  1050. .RS 4
  1051. show the key used to sign a signed commit
  1052. .RE
  1053. .PP
  1054. \fI%GF\fR
  1055. .RS 4
  1056. show the fingerprint of the key used to sign a signed commit
  1057. .RE
  1058. .PP
  1059. \fI%GP\fR
  1060. .RS 4
  1061. show the fingerprint of the primary key whose subkey was used to sign a signed commit
  1062. .RE
  1063. .PP
  1064. \fI%GT\fR
  1065. .RS 4
  1066. show the trust level for the key used to sign a signed commit
  1067. .RE
  1068. .PP
  1069. \fI%gD\fR
  1070. .RS 4
  1071. reflog selector, e\&.g\&.,
  1072. \fBrefs/stash@\fR{1} or
  1073. \fBrefs/stash@\fR{2
  1074. \fBminutes\fR
  1075. \fBago\fR}; the format follows the rules described for the
  1076. \fB\-g\fR
  1077. option\&. The portion before the
  1078. \fB@\fR
  1079. is the refname as given on the command line (so
  1080. \fBgit\fR
  1081. \fBlog\fR
  1082. \fB\-g\fR
  1083. \fBrefs/heads/master\fR
  1084. would yield
  1085. \fBrefs/heads/master@\fR{0})\&.
  1086. .RE
  1087. .PP
  1088. \fI%gd\fR
  1089. .RS 4
  1090. shortened reflog selector; same as %gD, but the refname portion is shortened for human readability (so
  1091. \fBrefs/heads/master\fR
  1092. becomes just
  1093. \fBmaster\fR)\&.
  1094. .RE
  1095. .PP
  1096. \fI%gn\fR
  1097. .RS 4
  1098. reflog identity name
  1099. .RE
  1100. .PP
  1101. \fI%gN\fR
  1102. .RS 4
  1103. reflog identity name (respecting \&.mailmap, see
  1104. \fBgit-shortlog\fR(1)
  1105. or
  1106. \fBgit-blame\fR(1))
  1107. .RE
  1108. .PP
  1109. \fI%ge\fR
  1110. .RS 4
  1111. reflog identity email
  1112. .RE
  1113. .PP
  1114. \fI%gE\fR
  1115. .RS 4
  1116. reflog identity email (respecting \&.mailmap, see
  1117. \fBgit-shortlog\fR(1)
  1118. or
  1119. \fBgit-blame\fR(1))
  1120. .RE
  1121. .PP
  1122. \fI%gs\fR
  1123. .RS 4
  1124. reflog subject
  1125. .RE
  1126. .PP
  1127. \fI%(trailers[:<options>])\fR
  1128. .RS 4
  1129. display the trailers of the body as interpreted by
  1130. \fBgit-interpret-trailers\fR(1)\&. The
  1131. \fBtrailers\fR
  1132. 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\&.
  1133. .sp
  1134. .RS 4
  1135. .ie n \{\
  1136. \h'-04'\(bu\h'+03'\c
  1137. .\}
  1138. .el \{\
  1139. .sp -1
  1140. .IP \(bu 2.3
  1141. .\}
  1142. \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
  1143. \fBonly\fR
  1144. option so that non\-trailer lines in the trailer block are hidden\&. If that is not desired it can be disabled with
  1145. \fBonly=false\fR\&. E\&.g\&., %(\fBtrailers:key=Reviewed\-by\fR) shows trailer lines with key
  1146. \fBReviewed\-by\fR\&.
  1147. .RE
  1148. .sp
  1149. .RS 4
  1150. .ie n \{\
  1151. \h'-04'\(bu\h'+03'\c
  1152. .\}
  1153. .el \{\
  1154. .sp -1
  1155. .IP \(bu 2.3
  1156. .\}
  1157. \fIonly[=<bool>]\fR: select whether non\-trailer lines from the trailer block should be included\&.
  1158. .RE
  1159. .sp
  1160. .RS 4
  1161. .ie n \{\
  1162. \h'-04'\(bu\h'+03'\c
  1163. .\}
  1164. .el \{\
  1165. .sp -1
  1166. .IP \(bu 2.3
  1167. .\}
  1168. \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\&.
  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. \fIunfold[=<bool>]\fR: make it behave as if interpret\-trailer\(cqs
  1180. \fB\-\-unfold\fR
  1181. option was given\&. E\&.g\&., %(\fBtrailers:only,unfold=true\fR) unfolds and shows all trailer lines\&.
  1182. .RE
  1183. .sp
  1184. .RS 4
  1185. .ie n \{\
  1186. \h'-04'\(bu\h'+03'\c
  1187. .\}
  1188. .el \{\
  1189. .sp -1
  1190. .IP \(bu 2.3
  1191. .\}
  1192. \fIkeyonly[=<bool>]\fR: only show the key part of the trailer\&.
  1193. .RE
  1194. .sp
  1195. .RS 4
  1196. .ie n \{\
  1197. \h'-04'\(bu\h'+03'\c
  1198. .\}
  1199. .el \{\
  1200. .sp -1
  1201. .IP \(bu 2.3
  1202. .\}
  1203. \fIvalueonly[=<bool>]\fR: only show the value part of the trailer\&.
  1204. .RE
  1205. .sp
  1206. .RS 4
  1207. .ie n \{\
  1208. \h'-04'\(bu\h'+03'\c
  1209. .\}
  1210. .el \{\
  1211. .sp -1
  1212. .IP \(bu 2.3
  1213. .\}
  1214. \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
  1215. \fIseparator=<sep>\fR
  1216. above\&.
  1217. .RE
  1218. .RE
  1219. .RE
  1220. .if n \{\
  1221. .sp
  1222. .\}
  1223. .RS 4
  1224. .it 1 an-trap
  1225. .nr an-no-space-flag 1
  1226. .nr an-break-flag 1
  1227. .br
  1228. .ps +1
  1229. \fBNote\fR
  1230. .ps -1
  1231. .br
  1232. .sp
  1233. 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\&.
  1234. .sp .5v
  1235. .RE
  1236. .sp
  1237. 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\&.
  1238. .sp
  1239. 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\&.
  1240. .sp
  1241. 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\&.
  1242. .sp
  1243. 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\&.
  1244. .sp
  1245. .RS 4
  1246. .ie n \{\
  1247. \h'-04'\(bu\h'+03'\c
  1248. .\}
  1249. .el \{\
  1250. .sp -1
  1251. .IP \(bu 2.3
  1252. .\}
  1253. \fItformat:\fR
  1254. .sp
  1255. The
  1256. \fItformat:\fR
  1257. format works exactly like
  1258. \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:
  1259. .sp
  1260. .if n \{\
  1261. .RS 4
  1262. .\}
  1263. .nf
  1264. $ git log \-2 \-\-pretty=format:%h 4da45bef \e
  1265. | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
  1266. 4da45be
  1267. 7134973 \-\- NO NEWLINE
  1268. $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
  1269. | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
  1270. 4da45be
  1271. 7134973
  1272. .fi
  1273. .if n \{\
  1274. .RE
  1275. .\}
  1276. .sp
  1277. In addition, any unrecognized string that has a % in it is interpreted as if it has
  1278. \fBtformat:\fR
  1279. in front of it\&. For example, these two are equivalent:
  1280. .sp
  1281. .if n \{\
  1282. .RS 4
  1283. .\}
  1284. .nf
  1285. $ git log \-2 \-\-pretty=tformat:%h 4da45bef
  1286. $ git log \-2 \-\-pretty=%h 4da45bef
  1287. .fi
  1288. .if n \{\
  1289. .RE
  1290. .\}
  1291. .RE
  1292. .SH "DIFF FORMATTING"
  1293. .sp
  1294. The options below can be used to change the way \fBgit\fR \fBshow\fR generates diff output\&.
  1295. .PP
  1296. \fB\-p\fR, \fB\-u\fR, \fB\-\-patch\fR
  1297. .RS 4
  1298. Generate patch (see
  1299. the section called \(lqGENERATING PATCH TEXT WITH \-P\(rq)\&.
  1300. .RE
  1301. .PP
  1302. \fB\-s\fR, \fB\-\-no\-patch\fR
  1303. .RS 4
  1304. Suppress all output from the diff machinery\&. Useful for commands like
  1305. \fBgit\fR
  1306. \fBshow\fR
  1307. that show the patch by default to squelch their output, or to cancel the effect of options like
  1308. \fB\-\-patch\fR,
  1309. \fB\-\-stat\fR
  1310. earlier on the command line in an alias\&.
  1311. .RE
  1312. .PP
  1313. \-m
  1314. .RS 4
  1315. Show diffs for merge commits in the default format\&. This is similar to
  1316. \fB\-\-diff\-merges=on\fR, except
  1317. \fB\-m\fR
  1318. will produce no output unless
  1319. \fB\-p\fR
  1320. is given as well\&.
  1321. .RE
  1322. .PP
  1323. \-c
  1324. .RS 4
  1325. Produce combined diff output for merge commits\&. Shortcut for
  1326. \fB\-\-diff\-merges=combined\fR
  1327. \fB\-p\fR\&.
  1328. .RE
  1329. .PP
  1330. \-\-cc
  1331. .RS 4
  1332. Produce dense combined diff output for merge commits\&. Shortcut for
  1333. \fB\-\-diff\-merges=dense\-combined\fR
  1334. \fB\-p\fR\&.
  1335. .RE
  1336. .PP
  1337. \-\-dd
  1338. .RS 4
  1339. Produce diff with respect to first parent for both merge and regular commits\&. Shortcut for
  1340. \fB\-\-diff\-merges=first\-parent\fR
  1341. \fB\-p\fR\&.
  1342. .RE
  1343. .PP
  1344. \-\-remerge\-diff
  1345. .RS 4
  1346. Produce remerge\-diff output for merge commits\&. Shortcut for
  1347. \fB\-\-diff\-merges=remerge\fR
  1348. \fB\-p\fR\&.
  1349. .RE
  1350. .PP
  1351. \-\-no\-diff\-merges
  1352. .RS 4
  1353. Synonym for
  1354. \fB\-\-diff\-merges=off\fR\&.
  1355. .RE
  1356. .PP
  1357. \-\-diff\-merges=<format>
  1358. .RS 4
  1359. Specify diff format to be used for merge commits\&. Default is `dense\-combined` unless
  1360. \fB\-\-first\-parent\fR
  1361. is in use, in which case
  1362. \fBfirst\-parent\fR
  1363. is the default\&.
  1364. .sp
  1365. The following formats are supported:
  1366. .PP
  1367. off, none
  1368. .RS 4
  1369. Disable output of diffs for merge commits\&. Useful to override implied value\&.
  1370. .RE
  1371. .PP
  1372. on, m
  1373. .RS 4
  1374. Make diff output for merge commits to be shown in the default format\&. The default format can be changed using
  1375. \fBlog\&.diffMerges\fR
  1376. configuration variable, whose default value is
  1377. \fBseparate\fR\&.
  1378. .RE
  1379. .PP
  1380. first\-parent, 1
  1381. .RS 4
  1382. Show full diff with respect to first parent\&. This is the same format as
  1383. \fB\-\-patch\fR
  1384. produces for non\-merge commits\&.
  1385. .RE
  1386. .PP
  1387. separate
  1388. .RS 4
  1389. Show full diff with respect to each of parents\&. Separate log entry and diff is generated for each parent\&.
  1390. .RE
  1391. .PP
  1392. combined, c
  1393. .RS 4
  1394. Show differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time\&. Furthermore, it lists only files which were modified from all parents\&.
  1395. .RE
  1396. .PP
  1397. dense\-combined, cc
  1398. .RS 4
  1399. Further compress output produced by
  1400. \fB\-\-diff\-merges=combined\fR
  1401. by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification\&.
  1402. .RE
  1403. .PP
  1404. remerge, r
  1405. .RS 4
  1406. Remerge two\-parent merge commits to create a temporary tree object\(em\:potentially containing files with conflict markers and such\&. A diff is then shown between that temporary tree and the actual merge commit\&.
  1407. .sp
  1408. The output emitted when this option is used is subject to change, and so is its interaction with other options (unless explicitly documented)\&.
  1409. .RE
  1410. .RE
  1411. .PP
  1412. \-\-combined\-all\-paths
  1413. .RS 4
  1414. Cause combined diffs (used for merge commits) to list the name of the file from all parents\&. It thus only has effect when
  1415. \fB\-\-diff\-merges=\fR[\fBdense\-\fR]\fBcombined\fR
  1416. is in use, and is likely only useful if filename changes are detected (i\&.e\&. when either rename or copy detection have been requested)\&.
  1417. .RE
  1418. .PP
  1419. \fB\-U\fR\fI<n>\fR, \fB\-\-unified=\fR\fI<n>\fR
  1420. .RS 4
  1421. Generate diffs with
  1422. \fI<n>\fR
  1423. lines of context instead of the usual three\&. Implies
  1424. \fB\-\-patch\fR\&.
  1425. .RE
  1426. .PP
  1427. \fB\-\-output=\fR\fI<file>\fR
  1428. .RS 4
  1429. Output to a specific file instead of stdout\&.
  1430. .RE
  1431. .PP
  1432. \fB\-\-output\-indicator\-new=\fR\fI<char>\fR, \fB\-\-output\-indicator\-old=\fR\fI<char>\fR, \fB\-\-output\-indicator\-context=\fR\fI<char>\fR
  1433. .RS 4
  1434. Specify the character used to indicate new, old or context lines in the generated patch\&. Normally they are
  1435. \fB+\fR,
  1436. \fB\-\fR
  1437. and \*(Aq \*(Aq respectively\&.
  1438. .RE
  1439. .PP
  1440. \fB\-\-raw\fR
  1441. .RS 4
  1442. For each commit, show a summary of changes using the raw diff format\&. See the "RAW OUTPUT FORMAT" section of
  1443. \fBgit-diff\fR(1)\&. This is different from showing the log itself in raw format, which you can achieve with
  1444. \fB\-\-format=raw\fR\&.
  1445. .RE
  1446. .PP
  1447. \fB\-\-patch\-with\-raw\fR
  1448. .RS 4
  1449. Synonym for
  1450. \fB\-p\fR
  1451. \fB\-\-raw\fR\&.
  1452. .RE
  1453. .PP
  1454. \fB\-t\fR
  1455. .RS 4
  1456. Show the tree objects in the diff output\&.
  1457. .RE
  1458. .PP
  1459. \fB\-\-indent\-heuristic\fR
  1460. .RS 4
  1461. Enable the heuristic that shifts diff hunk boundaries to make patches easier to read\&. This is the default\&.
  1462. .RE
  1463. .PP
  1464. \fB\-\-no\-indent\-heuristic\fR
  1465. .RS 4
  1466. Disable the indent heuristic\&.
  1467. .RE
  1468. .PP
  1469. \fB\-\-minimal\fR
  1470. .RS 4
  1471. Spend extra time to make sure the smallest possible diff is produced\&.
  1472. .RE
  1473. .PP
  1474. \fB\-\-patience\fR
  1475. .RS 4
  1476. Generate a diff using the "patience diff" algorithm\&.
  1477. .RE
  1478. .PP
  1479. \fB\-\-histogram\fR
  1480. .RS 4
  1481. Generate a diff using the "histogram diff" algorithm\&.
  1482. .RE
  1483. .PP
  1484. \fB\-\-anchored=\fR\fI<text>\fR
  1485. .RS 4
  1486. Generate a diff using the "anchored diff" algorithm\&.
  1487. .sp
  1488. This option may be specified more than once\&.
  1489. .sp
  1490. If a line exists in both the source and destination, exists only once, and starts with
  1491. \fI<text>\fR, this algorithm attempts to prevent it from appearing as a deletion or addition in the output\&. It uses the "patience diff" algorithm internally\&.
  1492. .RE
  1493. .PP
  1494. \fB\-\-diff\-algorithm=\fR(\fBpatience\fR|\fBminimal\fR|\fBhistogram\fR|\fBmyers\fR)
  1495. .RS 4
  1496. Choose a diff algorithm\&. The variants are as follows:
  1497. .PP
  1498. \fBdefault\fR, \fBmyers\fR
  1499. .RS 4
  1500. The basic greedy diff algorithm\&. Currently, this is the default\&.
  1501. .RE
  1502. .PP
  1503. \fBminimal\fR
  1504. .RS 4
  1505. Spend extra time to make sure the smallest possible diff is produced\&.
  1506. .RE
  1507. .PP
  1508. \fBpatience\fR
  1509. .RS 4
  1510. Use "patience diff" algorithm when generating patches\&.
  1511. .RE
  1512. .PP
  1513. \fBhistogram\fR
  1514. .RS 4
  1515. This algorithm extends the patience algorithm to "support low\-occurrence common elements"\&.
  1516. .RE
  1517. .sp
  1518. For instance, if you configured the
  1519. \fBdiff\&.algorithm\fR
  1520. variable to a non\-default value and want to use the default one, then you have to use
  1521. \fB\-\-diff\-algorithm=default\fR
  1522. option\&.
  1523. .RE
  1524. .PP
  1525. \fB\-\-stat\fR[\fB=\fR\fI<width>\fR[\fB,\fR\fI<name\-width>\fR[\fB,\fR\fI<count>\fR]]]
  1526. .RS 4
  1527. Generate a diffstat\&. By default, as much space as necessary will be used for the filename part, and the rest for the graph part\&. Maximum width defaults to terminal width, or 80 columns if not connected to a terminal, and can be overridden by
  1528. \fI<width>\fR\&. The width of the filename part can be limited by giving another width
  1529. \fI<name\-width>\fR
  1530. after a comma or by setting
  1531. \fBdiff\&.statNameWidth=\fR\fI<name\-width>\fR\&. The width of the graph part can be limited by using
  1532. \fB\-\-stat\-graph\-width=\fR\fI<graph\-width>\fR
  1533. or by setting
  1534. \fBdiff\&.statGraphWidth=\fR\fI<graph\-width>\fR\&. Using
  1535. \fB\-\-stat\fR
  1536. or
  1537. \fB\-\-stat\-graph\-width\fR
  1538. affects all commands generating a stat graph, while setting
  1539. \fBdiff\&.statNameWidth\fR
  1540. or
  1541. \fBdiff\&.statGraphWidth\fR
  1542. does not affect
  1543. \fBgit\fR
  1544. \fBformat\-patch\fR\&. By giving a third parameter
  1545. \fI<count>\fR, you can limit the output to the first
  1546. \fI<count>\fR
  1547. lines, followed by \&.\&.\&. if there are more\&.
  1548. .sp
  1549. These parameters can also be set individually with
  1550. \fB\-\-stat\-width=\fR\fI<width>\fR,
  1551. \fB\-\-stat\-name\-width=\fR\fI<name\-width>\fR
  1552. and
  1553. \fB\-\-stat\-count=\fR\fI<count>\fR\&.
  1554. .RE
  1555. .PP
  1556. \fB\-\-compact\-summary\fR
  1557. .RS 4
  1558. Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally
  1559. \fB+l\fR
  1560. if it\(cqs a symlink) and mode changes (\fB+x\fR
  1561. or
  1562. \fB\-x\fR
  1563. for adding or removing executable bit respectively) in diffstat\&. The information is put between the filename part and the graph part\&. Implies
  1564. \fB\-\-stat\fR\&.
  1565. .RE
  1566. .PP
  1567. \fB\-\-numstat\fR
  1568. .RS 4
  1569. Similar to
  1570. \fB\-\-stat\fR, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\&. For binary files, outputs two
  1571. \fB\-\fR
  1572. instead of saying
  1573. \fB0\fR
  1574. \fB0\fR\&.
  1575. .RE
  1576. .PP
  1577. \fB\-\-shortstat\fR
  1578. .RS 4
  1579. Output only the last line of the
  1580. \fB\-\-stat\fR
  1581. format containing total number of modified files, as well as number of added and deleted lines\&.
  1582. .RE
  1583. .PP
  1584. \fB\-X\fR [\fI<param>\fR\fB,\&.\&.\fR\&.], \fB\-\-dirstat\fR[\fB=\fR\fI<param>\fR\fB,\&.\&.\fR\&.]
  1585. .RS 4
  1586. Output the distribution of relative amount of changes for each sub\-directory\&. The behavior of
  1587. \fB\-\-dirstat\fR
  1588. can be customized by passing it a comma separated list of parameters\&. The defaults are controlled by the
  1589. \fBdiff\&.dirstat\fR
  1590. configuration variable (see
  1591. \fBgit-config\fR(1))\&. The following parameters are available:
  1592. .PP
  1593. \fBchanges\fR
  1594. .RS 4
  1595. Compute the dirstat numbers by counting the lines that have been removed from the source, or added to the destination\&. This ignores the amount of pure code movements within a file\&. In other words, rearranging lines in a file is not counted as much as other changes\&. This is the default behavior when no parameter is given\&.
  1596. .RE
  1597. .PP
  1598. \fBlines\fR
  1599. .RS 4
  1600. Compute the dirstat numbers by doing the regular line\-based diff analysis, and summing the removed/added line counts\&. (For binary files, count 64\-byte chunks instead, since binary files have no natural concept of lines)\&. This is a more expensive
  1601. \fB\-\-dirstat\fR
  1602. behavior than the
  1603. \fBchanges\fR
  1604. behavior, but it does count rearranged lines within a file as much as other changes\&. The resulting output is consistent with what you get from the other
  1605. \fB\-\-\fR*stat options\&.
  1606. .RE
  1607. .PP
  1608. \fBfiles\fR
  1609. .RS 4
  1610. Compute the dirstat numbers by counting the number of files changed\&. Each changed file counts equally in the dirstat analysis\&. This is the computationally cheapest
  1611. \fB\-\-dirstat\fR
  1612. behavior, since it does not have to look at the file contents at all\&.
  1613. .RE
  1614. .PP
  1615. \fBcumulative\fR
  1616. .RS 4
  1617. Count changes in a child directory for the parent directory as well\&. Note that when using
  1618. \fBcumulative\fR, the sum of the percentages reported may exceed 100%\&. The default (non\-cumulative) behavior can be specified with the
  1619. \fBnoncumulative\fR
  1620. parameter\&.
  1621. .RE
  1622. .PP
  1623. \fI<limit>\fR
  1624. .RS 4
  1625. An integer parameter specifies a cut\-off percent (3% by default)\&. Directories contributing less than this percentage of the changes are not shown in the output\&.
  1626. .RE
  1627. .sp
  1628. Example: The following will count changed files, while ignoring directories with less than 10% of the total amount of changed files, and accumulating child directory counts in the parent directories:
  1629. \fB\-\-dirstat=files,10,cumulative\fR\&.
  1630. .RE
  1631. .PP
  1632. \fB\-\-cumulative\fR
  1633. .RS 4
  1634. Synonym for
  1635. \fB\-\-dirstat=cumulative\fR\&.
  1636. .RE
  1637. .PP
  1638. \fB\-\-dirstat\-by\-file\fR[\fB=\fR\fI<param>\fR\fB,\&.\&.\fR\&.]
  1639. .RS 4
  1640. Synonym for
  1641. \fB\-\-dirstat=files,\fR\fI<param>\fR\fB,\&.\&.\fR\&.\&.
  1642. .RE
  1643. .PP
  1644. \fB\-\-summary\fR
  1645. .RS 4
  1646. Output a condensed summary of extended header information such as creations, renames and mode changes\&.
  1647. .RE
  1648. .PP
  1649. \fB\-\-patch\-with\-stat\fR
  1650. .RS 4
  1651. Synonym for
  1652. \fB\-p\fR
  1653. \fB\-\-stat\fR\&.
  1654. .RE
  1655. .PP
  1656. \fB\-z\fR
  1657. .RS 4
  1658. Separate the commits with
  1659. \fINUL\fRs instead of newlines\&.
  1660. .sp
  1661. Also, when
  1662. \fB\-\-raw\fR
  1663. or
  1664. \fB\-\-numstat\fR
  1665. has been given, do not munge pathnames and use
  1666. \fINUL\fRs as output field terminators\&.
  1667. .sp
  1668. Without this option, pathnames with "unusual" characters are quoted as explained for the configuration variable
  1669. \fBcore\&.quotePath\fR
  1670. (see
  1671. \fBgit-config\fR(1))\&.
  1672. .RE
  1673. .PP
  1674. \fB\-\-name\-only\fR
  1675. .RS 4
  1676. Show only the name of each changed file in the post\-image tree\&. The file names are often encoded in UTF\-8\&. For more information see the discussion about encoding in the
  1677. \fBgit-log\fR(1)
  1678. manual page\&.
  1679. .RE
  1680. .PP
  1681. \fB\-\-name\-status\fR
  1682. .RS 4
  1683. Show only the name(s) and status of each changed file\&. See the description of the
  1684. \fB\-\-diff\-filter\fR
  1685. option on what the status letters mean\&. Just like
  1686. \fB\-\-name\-only\fR
  1687. the file names are often encoded in UTF\-8\&.
  1688. .RE
  1689. .PP
  1690. \fB\-\-submodule\fR[\fB=\fR\fI<format>\fR]
  1691. .RS 4
  1692. Specify how differences in submodules are shown\&. When specifying
  1693. \fB\-\-submodule=short\fR
  1694. the
  1695. \fBshort\fR
  1696. format is used\&. This format just shows the names of the commits at the beginning and end of the range\&. When
  1697. \fB\-\-submodule\fR
  1698. or
  1699. \fB\-\-submodule=log\fR
  1700. is specified, the
  1701. \fBlog\fR
  1702. format is used\&. This format lists the commits in the range like
  1703. \fBgit-submodule\fR(1)
  1704. \fBsummary\fR
  1705. does\&. When
  1706. \fB\-\-submodule=diff\fR
  1707. is specified, the
  1708. \fBdiff\fR
  1709. format is used\&. This format shows an inline diff of the changes in the submodule contents between the commit range\&. Defaults to
  1710. \fBdiff\&.submodule\fR
  1711. or the
  1712. \fBshort\fR
  1713. format if the config option is unset\&.
  1714. .RE
  1715. .PP
  1716. \fB\-\-color\fR[\fB=\fR\fI<when>\fR]
  1717. .RS 4
  1718. Show colored diff\&.
  1719. \fB\-\-color\fR
  1720. (i\&.e\&. without
  1721. \fB=\fR\fI<when>\fR) is the same as
  1722. \fB\-\-color=always\fR\&.
  1723. \fI<when>\fR
  1724. can be one of
  1725. \fBalways\fR,
  1726. \fBnever\fR, or
  1727. \fBauto\fR\&.
  1728. .RE
  1729. .PP
  1730. \fB\-\-no\-color\fR
  1731. .RS 4
  1732. Turn off colored diff\&. It is the same as
  1733. \fB\-\-color=never\fR\&.
  1734. .RE
  1735. .PP
  1736. \fB\-\-color\-moved\fR[\fB=\fR\fI<mode>\fR]
  1737. .RS 4
  1738. Moved lines of code are colored differently\&. The
  1739. \fI<mode>\fR
  1740. defaults to
  1741. \fBno\fR
  1742. if the option is not given and to
  1743. \fBzebra\fR
  1744. if the option with no mode is given\&. The mode must be one of:
  1745. .PP
  1746. \fBno\fR
  1747. .RS 4
  1748. Moved lines are not highlighted\&.
  1749. .RE
  1750. .PP
  1751. \fBdefault\fR
  1752. .RS 4
  1753. Is a synonym for
  1754. \fBzebra\fR\&. This may change to a more sensible mode in the future\&.
  1755. .RE
  1756. .PP
  1757. \fBplain\fR
  1758. .RS 4
  1759. Any line that is added in one location and was removed in another location will be colored with
  1760. \fBcolor\&.diff\&.newMoved\fR\&. Similarly
  1761. \fBcolor\&.diff\&.oldMoved\fR
  1762. will be used for removed lines that are added somewhere else in the diff\&. This mode picks up any moved line, but it is not very useful in a review to determine if a block of code was moved without permutation\&.
  1763. .RE
  1764. .PP
  1765. \fBblocks\fR
  1766. .RS 4
  1767. Blocks of moved text of at least 20 alphanumeric characters are detected greedily\&. The detected blocks are painted using either the
  1768. \fBcolor\&.diff\&.\fR(\fBold\fR|\fBnew\fR)\fBMoved\fR
  1769. color\&. Adjacent blocks cannot be told apart\&.
  1770. .RE
  1771. .PP
  1772. \fBzebra\fR
  1773. .RS 4
  1774. Blocks of moved text are detected as in
  1775. \fBblocks\fR
  1776. mode\&. The blocks are painted using either the
  1777. \fBcolor\&.diff\&.\fR(\fBold\fR|\fBnew\fR)\fBMoved\fR
  1778. color or
  1779. \fBcolor\&.diff\&.\fR(\fBold\fR|\fBnew\fR)\fBMovedAlternative\fR\&. The change between the two colors indicates that a new block was detected\&.
  1780. .RE
  1781. .PP
  1782. \fBdimmed\-zebra\fR
  1783. .RS 4
  1784. Similar to
  1785. \fBzebra\fR, but additional dimming of uninteresting parts of moved code is performed\&. The bordering lines of two adjacent blocks are considered interesting, the rest is uninteresting\&.
  1786. \fBdimmed_zebra\fR
  1787. is a deprecated synonym\&.
  1788. .RE
  1789. .RE
  1790. .PP
  1791. \fB\-\-no\-color\-moved\fR
  1792. .RS 4
  1793. Turn off move detection\&. This can be used to override configuration settings\&. It is the same as
  1794. \fB\-\-color\-moved=no\fR\&.
  1795. .RE
  1796. .PP
  1797. \fB\-\-color\-moved\-ws=\fR\fI<mode>\fR\fB,\&.\&.\fR\&.
  1798. .RS 4
  1799. This configures how whitespace is ignored when performing the move detection for
  1800. \fB\-\-color\-moved\fR\&. These modes can be given as a comma separated list:
  1801. .PP
  1802. \fBno\fR
  1803. .RS 4
  1804. Do not ignore whitespace when performing move detection\&.
  1805. .RE
  1806. .PP
  1807. \fBignore\-space\-at\-eol\fR
  1808. .RS 4
  1809. Ignore changes in whitespace at EOL\&.
  1810. .RE
  1811. .PP
  1812. \fBignore\-space\-change\fR
  1813. .RS 4
  1814. Ignore changes in amount of whitespace\&. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent\&.
  1815. .RE
  1816. .PP
  1817. \fBignore\-all\-space\fR
  1818. .RS 4
  1819. Ignore whitespace when comparing lines\&. This ignores differences even if one line has whitespace where the other line has none\&.
  1820. .RE
  1821. .PP
  1822. \fBallow\-indentation\-change\fR
  1823. .RS 4
  1824. Initially ignore any whitespace in the move detection, then group the moved code blocks only into a block if the change in whitespace is the same per line\&. This is incompatible with the other modes\&.
  1825. .RE
  1826. .RE
  1827. .PP
  1828. \fB\-\-no\-color\-moved\-ws\fR
  1829. .RS 4
  1830. Do not ignore whitespace when performing move detection\&. This can be used to override configuration settings\&. It is the same as
  1831. \fB\-\-color\-moved\-ws=no\fR\&.
  1832. .RE
  1833. .PP
  1834. \fB\-\-word\-diff\fR[\fB=\fR\fI<mode>\fR]
  1835. .RS 4
  1836. By default, words are delimited by whitespace; see
  1837. \fB\-\-word\-diff\-regex\fR
  1838. below\&. The
  1839. \fI<mode>\fR
  1840. defaults to
  1841. \fBplain\fR, and must be one of:
  1842. .PP
  1843. \fBcolor\fR
  1844. .RS 4
  1845. Highlight changed words using only colors\&. Implies
  1846. \fB\-\-color\fR\&.
  1847. .RE
  1848. .PP
  1849. \fBplain\fR
  1850. .RS 4
  1851. Show words as [\fB\-removed\-\fR] and {\fBadded\fR}\&. Makes no attempts to escape the delimiters if they appear in the input, so the output may be ambiguous\&.
  1852. .RE
  1853. .PP
  1854. \fBporcelain\fR
  1855. .RS 4
  1856. Use a special line\-based format intended for script consumption\&. Added/removed/unchanged runs are printed in the usual unified diff format, starting with a
  1857. \fB+\fR/\fB\-\fR/` ` character at the beginning of the line and extending to the end of the line\&. Newlines in the input are represented by a tilde
  1858. \fB~\fR
  1859. on a line of its own\&.
  1860. .RE
  1861. .PP
  1862. \fBnone\fR
  1863. .RS 4
  1864. Disable word diff again\&.
  1865. .RE
  1866. .sp
  1867. Note that despite the name of the first mode, color is used to highlight the changed parts in all modes if enabled\&.
  1868. .RE
  1869. .PP
  1870. \fB\-\-word\-diff\-regex=\fR\fI<regex>\fR
  1871. .RS 4
  1872. Use
  1873. \fI<regex>\fR
  1874. to decide what a word is, instead of considering runs of non\-whitespace to be a word\&. Also implies
  1875. \fB\-\-word\-diff\fR
  1876. unless it was already enabled\&.
  1877. .sp
  1878. Every non\-overlapping match of the
  1879. \fI<regex>\fR
  1880. is considered a word\&. Anything between these matches is considered whitespace and ignored(!) for the purposes of finding differences\&. You may want to append |[\fB^\fR[\fB:space:\fR]] to your regular expression to make sure that it matches all non\-whitespace characters\&. A match that contains a newline is silently truncated(!) at the newline\&.
  1881. .sp
  1882. For example,
  1883. \fB\-\-word\-diff\-regex=\&.\fR
  1884. will treat each character as a word and, correspondingly, show differences character by character\&.
  1885. .sp
  1886. The regex can also be set via a diff driver or configuration option, see
  1887. \fBgitattributes\fR(5)
  1888. or
  1889. \fBgit-config\fR(1)\&. Giving it explicitly overrides any diff driver or configuration setting\&. Diff drivers override configuration settings\&.
  1890. .RE
  1891. .PP
  1892. \fB\-\-color\-words\fR[\fB=\fR\fI<regex>\fR]
  1893. .RS 4
  1894. Equivalent to
  1895. \fB\-\-word\-diff=color\fR
  1896. plus (if a regex was specified)
  1897. \fB\-\-word\-diff\-regex=\fR\fI<regex>\fR\&.
  1898. .RE
  1899. .PP
  1900. \fB\-\-no\-renames\fR
  1901. .RS 4
  1902. Turn off rename detection, even when the configuration file gives the default to do so\&.
  1903. .RE
  1904. .PP
  1905. \fB\-\-\fR[\fBno\-\fR]\fBrename\-empty\fR
  1906. .RS 4
  1907. Whether to use empty blobs as rename source\&.
  1908. .RE
  1909. .PP
  1910. \fB\-\-check\fR
  1911. .RS 4
  1912. Warn if changes introduce conflict markers or whitespace errors\&. What are considered whitespace errors is controlled by
  1913. \fBcore\&.whitespace\fR
  1914. configuration\&. By default, trailing whitespaces (including lines that consist solely of whitespaces) and a space character that is immediately followed by a tab character inside the initial indent of the line are considered whitespace errors\&. Exits with non\-zero status if problems are found\&. Not compatible with
  1915. \fB\-\-exit\-code\fR\&.
  1916. .RE
  1917. .PP
  1918. \fB\-\-ws\-error\-highlight=\fR\fI<kind>\fR
  1919. .RS 4
  1920. Highlight whitespace errors in the
  1921. \fBcontext\fR,
  1922. \fBold\fR
  1923. or
  1924. \fBnew\fR
  1925. lines of the diff\&. Multiple values are separated by comma,
  1926. \fBnone\fR
  1927. resets previous values,
  1928. \fBdefault\fR
  1929. reset the list to
  1930. \fBnew\fR
  1931. and
  1932. \fBall\fR
  1933. is a shorthand for
  1934. \fBold,new,context\fR\&. When this option is not given, and the configuration variable
  1935. \fBdiff\&.wsErrorHighlight\fR
  1936. is not set, only whitespace errors in
  1937. \fBnew\fR
  1938. lines are highlighted\&. The whitespace errors are colored with
  1939. \fBcolor\&.diff\&.whitespace\fR\&.
  1940. .RE
  1941. .PP
  1942. \fB\-\-full\-index\fR
  1943. .RS 4
  1944. Instead of the first handful of characters, show the full pre\- and post\-image blob object names on the "index" line when generating patch format output\&.
  1945. .RE
  1946. .PP
  1947. \fB\-\-binary\fR
  1948. .RS 4
  1949. In addition to
  1950. \fB\-\-full\-index\fR, output a binary diff that can be applied with
  1951. \fBgit\-apply\fR\&. Implies
  1952. \fB\-\-patch\fR\&.
  1953. .RE
  1954. .PP
  1955. \fB\-\-abbrev\fR[\fB=\fR\fI<n>\fR]
  1956. .RS 4
  1957. Instead of showing the full 40\-byte hexadecimal object name in diff\-raw format output and diff\-tree header lines, show the shortest prefix that is at least
  1958. \fI<n>\fR
  1959. hexdigits long that uniquely refers the object\&. In diff\-patch output format,
  1960. \fB\-\-full\-index\fR
  1961. takes higher precedence, i\&.e\&. if
  1962. \fB\-\-full\-index\fR
  1963. is specified, full blob names will be shown regardless of
  1964. \fB\-\-abbrev\fR\&. Non default number of digits can be specified with
  1965. \fB\-\-abbrev=\fR\fI<n>\fR\&.
  1966. .RE
  1967. .PP
  1968. \fB\-B\fR[\fI<n>\fR][\fB/\fR\fI<m>\fR], \fB\-\-break\-rewrites\fR[\fB=\fR[\fI<n>\fR][\fB/\fR\fI<m>\fR]]
  1969. .RS 4
  1970. Break complete rewrite changes into pairs of delete and create\&. This serves two purposes:
  1971. .sp
  1972. It affects the way a change that amounts to a total rewrite of a file not as a series of deletion and insertion mixed together with a very few lines that happen to match textually as the context, but as a single deletion of everything old followed by a single insertion of everything new, and the number
  1973. \fI<m>\fR
  1974. controls this aspect of the
  1975. \fB\-B\fR
  1976. option (defaults to 60%)\&.
  1977. \fB\-B/70\fR% specifies that less than 30% of the original should remain in the result for Git to consider it a total rewrite (i\&.e\&. otherwise the resulting patch will be a series of deletion and insertion mixed together with context lines)\&.
  1978. .sp
  1979. When used with
  1980. \fB\-M\fR, a totally\-rewritten file is also considered as the source of a rename (usually
  1981. \fB\-M\fR
  1982. only considers a file that disappeared as the source of a rename), and the number
  1983. \fI<n>\fR
  1984. controls this aspect of the
  1985. \fB\-B\fR
  1986. option (defaults to 50%)\&.
  1987. \fB\-B20\fR% specifies that a change with addition and deletion compared to 20% or more of the file\(cqs size are eligible for being picked up as a possible source of a rename to another file\&.
  1988. .RE
  1989. .PP
  1990. \fB\-M\fR[\fI<n>\fR], \fB\-\-find\-renames\fR[\fB=\fR\fI<n>\fR]
  1991. .RS 4
  1992. If generating diffs, detect and report renames for each commit\&. For following files across renames while traversing history, see
  1993. \fB\-\-follow\fR\&. If
  1994. \fI<n>\fR
  1995. is specified, it is a threshold on the similarity index (i\&.e\&. amount of addition/deletions compared to the file\(cqs size)\&. For example,
  1996. \fB\-M90\fR% means Git should consider a delete/add pair to be a rename if more than 90% of the file hasn\(cqt changed\&. Without a % sign, the number is to be read as a fraction, with a decimal point before it\&. I\&.e\&.,
  1997. \fB\-M5\fR
  1998. becomes 0\&.5, and is thus the same as
  1999. \fB\-M50\fR%\&. Similarly,
  2000. \fB\-M05\fR
  2001. is the same as
  2002. \fB\-M5\fR%\&. To limit detection to exact renames, use
  2003. \fB\-M100\fR%\&. The default similarity index is 50%\&.
  2004. .RE
  2005. .PP
  2006. \fB\-C\fR[\fI<n>\fR], \fB\-\-find\-copies\fR[\fB=\fR\fI<n>\fR]
  2007. .RS 4
  2008. Detect copies as well as renames\&. See also
  2009. \fB\-\-find\-copies\-harder\fR\&. If
  2010. \fI<n>\fR
  2011. is specified, it has the same meaning as for
  2012. \fB\-M\fR\fI<n>\fR\&.
  2013. .RE
  2014. .PP
  2015. \fB\-\-find\-copies\-harder\fR
  2016. .RS 4
  2017. For performance reasons, by default,
  2018. \fB\-C\fR
  2019. option finds copies only if the original file of the copy was modified in the same changeset\&. This flag makes the command inspect unmodified files as candidates for the source of copy\&. This is a very expensive operation for large projects, so use it with caution\&. Giving more than one
  2020. \fB\-C\fR
  2021. option has the same effect\&.
  2022. .RE
  2023. .PP
  2024. \fB\-D\fR, \fB\-\-irreversible\-delete\fR
  2025. .RS 4
  2026. Omit the preimage for deletes, i\&.e\&. print only the header but not the diff between the preimage and
  2027. \fB/dev/null\fR\&. The resulting patch is not meant to be applied with
  2028. \fBpatch\fR
  2029. or
  2030. \fBgit\fR
  2031. \fBapply\fR; this is solely for people who want to just concentrate on reviewing the text after the change\&. In addition, the output obviously lacks enough information to apply such a patch in reverse, even manually, hence the name of the option\&.
  2032. .sp
  2033. When used together with
  2034. \fB\-B\fR, omit also the preimage in the deletion part of a delete/create pair\&.
  2035. .RE
  2036. .PP
  2037. \fB\-l\fR\fI<num>\fR
  2038. .RS 4
  2039. The
  2040. \fB\-M\fR
  2041. and
  2042. \fB\-C\fR
  2043. options involve some preliminary steps that can detect subsets of renames/copies cheaply, followed by an exhaustive fallback portion that compares all remaining unpaired destinations to all relevant sources\&. (For renames, only remaining unpaired sources are relevant; for copies, all original sources are relevant\&.) For N sources and destinations, this exhaustive check is O(N^2)\&. This option prevents the exhaustive portion of rename/copy detection from running if the number of source/destination files involved exceeds the specified number\&. Defaults to
  2044. \fBdiff\&.renameLimit\fR\&. Note that a value of 0 is treated as unlimited\&.
  2045. .RE
  2046. .PP
  2047. \fB\-\-diff\-filter=\fR[(\fBA\fR|\fBC\fR|\fBD\fR|\fBM\fR|\fBR\fR|\fBT\fR|\fBU\fR|\fBX\fR|\fBB\fR)\fB\&.\&.\&.\fR[*]]
  2048. .RS 4
  2049. Select only files that are Added (\fBA\fR), Copied (\fBC\fR), Deleted (\fBD\fR), Modified (\fBM\fR), Renamed (\fBR\fR), have their type (i\&.e\&. regular file, symlink, submodule, \&...\:) changed (\fBT\fR), are Unmerged (\fBU\fR), are Unknown (\fBX\fR), or have had their pairing Broken (\fBB\fR)\&. Any combination of the filter characters (including none) can be used\&. When * (All\-or\-none) is added to the combination, all paths are selected if there is any file that matches other criteria in the comparison; if there is no file that matches other criteria, nothing is selected\&.
  2050. .sp
  2051. Also, these upper\-case letters can be downcased to exclude\&. E\&.g\&.
  2052. \fB\-\-diff\-filter=ad\fR
  2053. excludes added and deleted paths\&.
  2054. .sp
  2055. Note that not all diffs can feature all types\&. For instance, copied and renamed entries cannot appear if detection for those types is disabled\&.
  2056. .RE
  2057. .PP
  2058. \fB\-S\fR\fI<string>\fR
  2059. .RS 4
  2060. Look for differences that change the number of occurrences of the specified
  2061. \fI<string>\fR
  2062. (i\&.e\&. addition/deletion) in a file\&. Intended for the scripter\(cqs use\&.
  2063. .sp
  2064. It is useful when you\(cqre looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively to feed the interesting block in the preimage back into
  2065. \fB\-S\fR, and keep going until you get the very first version of the block\&.
  2066. .sp
  2067. Binary files are searched as well\&.
  2068. .RE
  2069. .PP
  2070. \fB\-G\fR\fI<regex>\fR
  2071. .RS 4
  2072. Look for differences whose patch text contains added/removed lines that match
  2073. \fI<regex>\fR\&.
  2074. .sp
  2075. To illustrate the difference between
  2076. \fB\-S\fR\fI<regex>\fR
  2077. \fB\-\-pickaxe\-regex\fR
  2078. and
  2079. \fB\-G\fR\fI<regex>\fR, consider a commit with the following diff in the same file:
  2080. .sp
  2081. .if n \{\
  2082. .RS 4
  2083. .\}
  2084. .nf
  2085. + return frotz(nitfol, two\->ptr, 1, 0);
  2086. \&.\&.\&.
  2087. \- hit = frotz(nitfol, mf2\&.ptr, 1, 0);
  2088. .fi
  2089. .if n \{\
  2090. .RE
  2091. .\}
  2092. .sp
  2093. While
  2094. \fBgit\fR
  2095. \fBlog\fR
  2096. \fB\-G\fR"frotz\e(\fBnitfol\fR" will show this commit,
  2097. \fBgit\fR
  2098. \fBlog\fR
  2099. \fB\-S\fR"frotz\e(\fBnitfol\fR"
  2100. \fB\-\-pickaxe\-regex\fR
  2101. will not (because the number of occurrences of that string did not change)\&.
  2102. .sp
  2103. Unless
  2104. \fB\-\-text\fR
  2105. is supplied patches of binary files without a textconv filter will be ignored\&.
  2106. .sp
  2107. See the
  2108. \fIpickaxe\fR
  2109. entry in
  2110. \fBgitdiffcore\fR(7)
  2111. for more information\&.
  2112. .RE
  2113. .PP
  2114. \fB\-\-find\-object=\fR\fI<object\-id>\fR
  2115. .RS 4
  2116. Look for differences that change the number of occurrences of the specified object\&. Similar to
  2117. \fB\-S\fR, just the argument is different in that it doesn\(cqt search for a specific string but for a specific object id\&.
  2118. .sp
  2119. The object can be a blob or a submodule commit\&. It implies the
  2120. \fB\-t\fR
  2121. option in
  2122. \fBgit\-log\fR
  2123. to also find trees\&.
  2124. .RE
  2125. .PP
  2126. \fB\-\-pickaxe\-all\fR
  2127. .RS 4
  2128. When
  2129. \fB\-S\fR
  2130. or
  2131. \fB\-G\fR
  2132. finds a change, show all the changes in that changeset, not just the files that contain the change in
  2133. \fI<string>\fR\&.
  2134. .RE
  2135. .PP
  2136. \fB\-\-pickaxe\-regex\fR
  2137. .RS 4
  2138. Treat the
  2139. \fI<string>\fR
  2140. given to
  2141. \fB\-S\fR
  2142. as an extended POSIX regular expression to match\&.
  2143. .RE
  2144. .PP
  2145. \fB\-O\fR\fI<orderfile>\fR
  2146. .RS 4
  2147. Control the order in which files appear in the output\&. This overrides the
  2148. \fBdiff\&.orderFile\fR
  2149. configuration variable (see
  2150. \fBgit-config\fR(1))\&. To cancel
  2151. \fBdiff\&.orderFile\fR, use
  2152. \fB\-O/dev/null\fR\&.
  2153. .sp
  2154. The output order is determined by the order of glob patterns in
  2155. \fI<orderfile>\fR\&. All files with pathnames that match the first pattern are output first, all files with pathnames that match the second pattern (but not the first) are output next, and so on\&. All files with pathnames that do not match any pattern are output last, as if there was an implicit match\-all pattern at the end of the file\&. If multiple pathnames have the same rank (they match the same pattern but no earlier patterns), their output order relative to each other is the normal order\&.
  2156. .sp
  2157. \fI<orderfile>\fR
  2158. is parsed as follows:
  2159. .sp
  2160. .RS 4
  2161. .ie n \{\
  2162. \h'-04'\(bu\h'+03'\c
  2163. .\}
  2164. .el \{\
  2165. .sp -1
  2166. .IP \(bu 2.3
  2167. .\}
  2168. Blank lines are ignored, so they can be used as separators for readability\&.
  2169. .RE
  2170. .sp
  2171. .RS 4
  2172. .ie n \{\
  2173. \h'-04'\(bu\h'+03'\c
  2174. .\}
  2175. .el \{\
  2176. .sp -1
  2177. .IP \(bu 2.3
  2178. .\}
  2179. Lines starting with a hash ("#") are ignored, so they can be used for comments\&. Add a backslash ("\e") to the beginning of the pattern if it starts with a hash\&.
  2180. .RE
  2181. .sp
  2182. .RS 4
  2183. .ie n \{\
  2184. \h'-04'\(bu\h'+03'\c
  2185. .\}
  2186. .el \{\
  2187. .sp -1
  2188. .IP \(bu 2.3
  2189. .\}
  2190. Each other line contains a single pattern\&.
  2191. .RE
  2192. .sp
  2193. Patterns have the same syntax and semantics as patterns used for
  2194. \fBfnmatch\fR(3) without the
  2195. \fBFNM_PATHNAME\fR
  2196. flag, except a pathname also matches a pattern if removing any number of the final pathname components matches the pattern\&. For example, the pattern "\fBfoo\fR*bar" matches "\fBfooasdfbar\fR" and "\fBfoo/bar/baz/asdf\fR" but not "\fBfoobarx\fR"\&.
  2197. .RE
  2198. .PP
  2199. \fB\-\-skip\-to=\fR\fI<file>\fR, \fB\-\-rotate\-to=\fR\fI<file>\fR
  2200. .RS 4
  2201. Discard the files before the named
  2202. \fI<file>\fR
  2203. from the output (i\&.e\&.
  2204. \fIskip to\fR), or move them to the end of the output (i\&.e\&.
  2205. \fIrotate to\fR)\&. These options were invented primarily for the use of the
  2206. \fBgit\fR
  2207. \fBdifftool\fR
  2208. command, and may not be very useful otherwise\&.
  2209. .RE
  2210. .PP
  2211. \fB\-R\fR
  2212. .RS 4
  2213. Swap two inputs; that is, show differences from index or on\-disk file to tree contents\&.
  2214. .RE
  2215. .PP
  2216. \fB\-\-relative\fR[\fB=\fR\fI<path>\fR], \fB\-\-no\-relative\fR
  2217. .RS 4
  2218. When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\&. When you are not in a subdirectory (e\&.g\&. in a bare repository), you can name which subdirectory to make the output relative to by giving a
  2219. \fI<path>\fR
  2220. as an argument\&.
  2221. \fB\-\-no\-relative\fR
  2222. can be used to countermand both
  2223. \fBdiff\&.relative\fR
  2224. config option and previous
  2225. \fB\-\-relative\fR\&.
  2226. .RE
  2227. .PP
  2228. \fB\-a\fR, \fB\-\-text\fR
  2229. .RS 4
  2230. Treat all files as text\&.
  2231. .RE
  2232. .PP
  2233. \fB\-\-ignore\-cr\-at\-eol\fR
  2234. .RS 4
  2235. Ignore carriage\-return at the end of line when doing a comparison\&.
  2236. .RE
  2237. .PP
  2238. \fB\-\-ignore\-space\-at\-eol\fR
  2239. .RS 4
  2240. Ignore changes in whitespace at EOL\&.
  2241. .RE
  2242. .PP
  2243. \fB\-b\fR, \fB\-\-ignore\-space\-change\fR
  2244. .RS 4
  2245. Ignore changes in amount of whitespace\&. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent\&.
  2246. .RE
  2247. .PP
  2248. \fB\-w\fR, \fB\-\-ignore\-all\-space\fR
  2249. .RS 4
  2250. Ignore whitespace when comparing lines\&. This ignores differences even if one line has whitespace where the other line has none\&.
  2251. .RE
  2252. .PP
  2253. \fB\-\-ignore\-blank\-lines\fR
  2254. .RS 4
  2255. Ignore changes whose lines are all blank\&.
  2256. .RE
  2257. .PP
  2258. \fB\-I\fR\fI<regex>\fR, \fB\-\-ignore\-matching\-lines=\fR\fI<regex>\fR
  2259. .RS 4
  2260. Ignore changes whose all lines match
  2261. \fI<regex>\fR\&. This option may be specified more than once\&.
  2262. .RE
  2263. .PP
  2264. \fB\-\-inter\-hunk\-context=\fR\fI<number>\fR
  2265. .RS 4
  2266. Show the context between diff hunks, up to the specified
  2267. \fI<number>\fR
  2268. of lines, thereby fusing hunks that are close to each other\&. Defaults to
  2269. \fBdiff\&.interHunkContext\fR
  2270. or 0 if the config option is unset\&.
  2271. .RE
  2272. .PP
  2273. \fB\-W\fR, \fB\-\-function\-context\fR
  2274. .RS 4
  2275. Show whole function as context lines for each change\&. The function names are determined in the same way as
  2276. \fBgit\fR
  2277. \fBdiff\fR
  2278. works out patch hunk headers (see "Defining a custom hunk\-header" in
  2279. \fBgitattributes\fR(5))\&.
  2280. .RE
  2281. .PP
  2282. \fB\-\-ext\-diff\fR
  2283. .RS 4
  2284. Allow an external diff helper to be executed\&. If you set an external diff driver with
  2285. \fBgitattributes\fR(5), you need to use this option with
  2286. \fBgit-log\fR(1)
  2287. and friends\&.
  2288. .RE
  2289. .PP
  2290. \fB\-\-no\-ext\-diff\fR
  2291. .RS 4
  2292. Disallow external diff drivers\&.
  2293. .RE
  2294. .PP
  2295. \fB\-\-textconv\fR, \fB\-\-no\-textconv\fR
  2296. .RS 4
  2297. Allow (or disallow) external text conversion filters to be run when comparing binary files\&. See
  2298. \fBgitattributes\fR(5)
  2299. for details\&. Because textconv filters are typically a one\-way conversion, the resulting diff is suitable for human consumption, but cannot be applied\&. For this reason, textconv filters are enabled by default only for
  2300. \fBgit-diff\fR(1)
  2301. and
  2302. \fBgit-log\fR(1), but not for
  2303. \fBgit-format-patch\fR(1)
  2304. or diff plumbing commands\&.
  2305. .RE
  2306. .PP
  2307. \fB\-\-ignore\-submodules\fR[\fB=\fR(\fBnone\fR|\fBuntracked\fR|\fBdirty\fR|\fBall\fR)]
  2308. .RS 4
  2309. Ignore changes to submodules in the diff generation\&.
  2310. \fBall\fR
  2311. is the default\&. Using
  2312. \fBnone\fR
  2313. will consider the submodule modified when it either contains untracked or modified files or its
  2314. \fBHEAD\fR
  2315. differs from the commit recorded in the superproject and can be used to override any settings of the
  2316. \fBignore\fR
  2317. option in
  2318. \fBgit-config\fR(1)
  2319. or
  2320. \fBgitmodules\fR(5)\&. When
  2321. \fBuntracked\fR
  2322. is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content)\&. Using
  2323. \fBdirty\fR
  2324. ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior until 1\&.7\&.0)\&. Using
  2325. \fBall\fR
  2326. hides all changes to submodules\&.
  2327. .RE
  2328. .PP
  2329. \fB\-\-src\-prefix=\fR\fI<prefix>\fR
  2330. .RS 4
  2331. Show the given source
  2332. \fI<prefix>\fR
  2333. instead of "a/"\&.
  2334. .RE
  2335. .PP
  2336. \fB\-\-dst\-prefix=\fR\fI<prefix>\fR
  2337. .RS 4
  2338. Show the given destination
  2339. \fI<prefix>\fR
  2340. instead of "b/"\&.
  2341. .RE
  2342. .PP
  2343. \fB\-\-no\-prefix\fR
  2344. .RS 4
  2345. Do not show any source or destination prefix\&.
  2346. .RE
  2347. .PP
  2348. \fB\-\-default\-prefix\fR
  2349. .RS 4
  2350. Use the default source and destination prefixes ("a/" and "b/")\&. This overrides configuration variables such as
  2351. \fBdiff\&.noprefix\fR,
  2352. \fBdiff\&.srcPrefix\fR,
  2353. \fBdiff\&.dstPrefix\fR, and
  2354. \fBdiff\&.mnemonicPrefix\fR
  2355. (see
  2356. \fBgit-config\fR(1))\&.
  2357. .RE
  2358. .PP
  2359. \fB\-\-line\-prefix=\fR\fI<prefix>\fR
  2360. .RS 4
  2361. Prepend an additional
  2362. \fI<prefix>\fR
  2363. to every line of output\&.
  2364. .RE
  2365. .PP
  2366. \fB\-\-ita\-invisible\-in\-index\fR
  2367. .RS 4
  2368. By default entries added by
  2369. \fBgit\fR
  2370. \fBadd\fR
  2371. \fB\-N\fR
  2372. appear as an existing empty file in
  2373. \fBgit\fR
  2374. \fBdiff\fR
  2375. and a new file in
  2376. \fBgit\fR
  2377. \fBdiff\fR
  2378. \fB\-\-cached\fR\&. This option makes the entry appear as a new file in
  2379. \fBgit\fR
  2380. \fBdiff\fR
  2381. and non\-existent in
  2382. \fBgit\fR
  2383. \fBdiff\fR
  2384. \fB\-\-cached\fR\&. This option could be reverted with
  2385. \fB\-\-ita\-visible\-in\-index\fR\&. Both options are experimental and could be removed in future\&.
  2386. .RE
  2387. .sp
  2388. For more detailed explanation on these common options, see also \fBgitdiffcore\fR(7)\&.
  2389. .SH "GENERATING PATCH TEXT WITH \-P"
  2390. .sp
  2391. Running \fBgit-diff\fR(1), \fBgit-log\fR(1), \fBgit-show\fR(1), \fBgit-diff-index\fR(1), \fBgit-diff-tree\fR(1), or \fBgit-diff-files\fR(1) with the \fB\-p\fR option produces patch text\&. You can customize the creation of patch text via the \fBGIT_EXTERNAL_DIFF\fR and the \fBGIT_DIFF_OPTS\fR environment variables (see \fBgit\fR(1)), and the \fBdiff\fR attribute (see \fBgitattributes\fR(5))\&.
  2392. .sp
  2393. What the \fB\-p\fR option produces is slightly different from the traditional diff format:
  2394. .sp
  2395. .RS 4
  2396. .ie n \{\
  2397. \h'-04' 1.\h'+01'\c
  2398. .\}
  2399. .el \{\
  2400. .sp -1
  2401. .IP " 1." 4.2
  2402. .\}
  2403. It is preceded by a "git diff" header that looks like this:
  2404. .sp
  2405. .if n \{\
  2406. .RS 4
  2407. .\}
  2408. .nf
  2409. diff \-\-git a/file1 b/file2
  2410. .fi
  2411. .if n \{\
  2412. .RE
  2413. .\}
  2414. .sp
  2415. The
  2416. \fBa/\fR
  2417. and
  2418. \fBb/\fR
  2419. filenames are the same unless rename/copy is involved\&. Especially, even for a creation or a deletion,
  2420. \fB/dev/null\fR
  2421. is
  2422. \fInot\fR
  2423. used in place of the
  2424. \fBa/\fR
  2425. or
  2426. \fBb/\fR
  2427. filenames\&.
  2428. .sp
  2429. When a rename/copy is involved,
  2430. \fBfile1\fR
  2431. and
  2432. \fBfile2\fR
  2433. show the name of the source file of the rename/copy and the name of the file that the rename/copy produces, respectively\&.
  2434. .RE
  2435. .sp
  2436. .RS 4
  2437. .ie n \{\
  2438. \h'-04' 2.\h'+01'\c
  2439. .\}
  2440. .el \{\
  2441. .sp -1
  2442. .IP " 2." 4.2
  2443. .\}
  2444. It is followed by one or more extended header lines:
  2445. .sp
  2446. .if n \{\
  2447. .RS 4
  2448. .\}
  2449. .nf
  2450. \fBold\fR \fBmode\fR \fI<mode>\fR
  2451. \fBnew\fR \fBmode\fR \fI<mode>\fR
  2452. \fBdeleted\fR \fBfile\fR \fBmode\fR \fI<mode>\fR
  2453. \fBnew\fR \fBfile\fR \fBmode\fR \fI<mode>\fR
  2454. \fBcopy\fR \fBfrom\fR \fI<path>\fR
  2455. \fBcopy\fR \fBto\fR \fI<path>\fR
  2456. \fBrename\fR \fBfrom\fR \fI<path>\fR
  2457. \fBrename\fR \fBto\fR \fI<path>\fR
  2458. \fBsimilarity\fR \fBindex\fR \fI<number>\fR
  2459. \fBdissimilarity\fR \fBindex\fR \fI<number>\fR
  2460. \fBindex\fR \fI<hash>\fR`\&.\&.`\fI<hash>\fR \fI<mode>\fR
  2461. .fi
  2462. .if n \{\
  2463. .RE
  2464. .\}
  2465. File modes
  2466. \fI<mode>\fR
  2467. are printed as 6\-digit octal numbers including the file type and file permission bits\&.
  2468. .sp
  2469. Path names in extended headers do not include the
  2470. \fBa/\fR
  2471. and
  2472. \fBb/\fR
  2473. prefixes\&.
  2474. .sp
  2475. The similarity index is the percentage of unchanged lines, and the dissimilarity index is the percentage of changed lines\&. It is a rounded down integer, followed by a percent sign\&. The similarity index value of 100% is thus reserved for two equal files, while 100% dissimilarity means that no line from the old file made it into the new one\&.
  2476. .sp
  2477. The index line includes the blob object names before and after the change\&. The
  2478. \fI<mode>\fR
  2479. is included if the file mode does not change; otherwise, separate lines indicate the old and the new mode\&.
  2480. .RE
  2481. .sp
  2482. .RS 4
  2483. .ie n \{\
  2484. \h'-04' 3.\h'+01'\c
  2485. .\}
  2486. .el \{\
  2487. .sp -1
  2488. .IP " 3." 4.2
  2489. .\}
  2490. Pathnames with "unusual" characters are quoted as explained for the configuration variable
  2491. \fBcore\&.quotePath\fR
  2492. (see
  2493. \fBgit-config\fR(1))\&.
  2494. .RE
  2495. .sp
  2496. .RS 4
  2497. .ie n \{\
  2498. \h'-04' 4.\h'+01'\c
  2499. .\}
  2500. .el \{\
  2501. .sp -1
  2502. .IP " 4." 4.2
  2503. .\}
  2504. All the
  2505. \fBfile1\fR
  2506. files in the output refer to files before the commit, and all the
  2507. \fBfile2\fR
  2508. files refer to files after the commit\&. It is incorrect to apply each change to each file sequentially\&. For example, this patch will swap a and b:
  2509. .sp
  2510. .if n \{\
  2511. .RS 4
  2512. .\}
  2513. .nf
  2514. diff \-\-git a/a b/b
  2515. rename from a
  2516. rename to b
  2517. diff \-\-git a/b b/a
  2518. rename from b
  2519. rename to a
  2520. .fi
  2521. .if n \{\
  2522. .RE
  2523. .\}
  2524. .RE
  2525. .sp
  2526. .RS 4
  2527. .ie n \{\
  2528. \h'-04' 5.\h'+01'\c
  2529. .\}
  2530. .el \{\
  2531. .sp -1
  2532. .IP " 5." 4.2
  2533. .\}
  2534. Hunk headers mention the name of the function to which the hunk applies\&. See "Defining a custom hunk\-header" in
  2535. \fBgitattributes\fR(5)
  2536. for details of how to tailor this to specific languages\&.
  2537. .RE
  2538. .SH "COMBINED DIFF FORMAT"
  2539. .sp
  2540. Any diff\-generating command can take the \fB\-c\fR or \fB\-\-cc\fR option to produce a \fIcombined diff\fR when showing a merge\&. This is the default format when showing merges with \fBgit-diff\fR(1) or \fBgit-show\fR(1)\&. Note also that you can give suitable \fB\-\-diff\-merges\fR option to any of these commands to force generation of diffs in a specific format\&.
  2541. .sp
  2542. A "combined diff" format looks like this:
  2543. .sp
  2544. .if n \{\
  2545. .RS 4
  2546. .\}
  2547. .nf
  2548. diff \-\-combined describe\&.c
  2549. index fabadb8,cc95eb0\&.\&.4866510
  2550. \-\-\- a/describe\&.c
  2551. +++ b/describe\&.c
  2552. @@@ \-98,20 \-98,12 +98,20 @@@
  2553. return (a_date > b_date) ? \-1 : (a_date == b_date) ? 0 : 1;
  2554. }
  2555. \- static void describe(char *arg)
  2556. \-static void describe(struct commit *cmit, int last_one)
  2557. ++static void describe(char *arg, int last_one)
  2558. {
  2559. + unsigned char sha1[20];
  2560. + struct commit *cmit;
  2561. struct commit_list *list;
  2562. static int initialized = 0;
  2563. struct commit_name *n;
  2564. + if (get_sha1(arg, sha1) < 0)
  2565. + usage(describe_usage);
  2566. + cmit = lookup_commit_reference(sha1);
  2567. + if (!cmit)
  2568. + usage(describe_usage);
  2569. +
  2570. if (!initialized) {
  2571. initialized = 1;
  2572. for_each_ref(get_name);
  2573. .fi
  2574. .if n \{\
  2575. .RE
  2576. .\}
  2577. .sp
  2578. .RS 4
  2579. .ie n \{\
  2580. \h'-04' 1.\h'+01'\c
  2581. .\}
  2582. .el \{\
  2583. .sp -1
  2584. .IP " 1." 4.2
  2585. .\}
  2586. It is preceded by a "git diff" header, that looks like this (when the
  2587. \fB\-c\fR
  2588. option is used):
  2589. .sp
  2590. .if n \{\
  2591. .RS 4
  2592. .\}
  2593. .nf
  2594. diff \-\-combined file
  2595. .fi
  2596. .if n \{\
  2597. .RE
  2598. .\}
  2599. .sp
  2600. or like this (when the
  2601. \fB\-\-cc\fR
  2602. option is used):
  2603. .sp
  2604. .if n \{\
  2605. .RS 4
  2606. .\}
  2607. .nf
  2608. diff \-\-cc file
  2609. .fi
  2610. .if n \{\
  2611. .RE
  2612. .\}
  2613. .RE
  2614. .sp
  2615. .RS 4
  2616. .ie n \{\
  2617. \h'-04' 2.\h'+01'\c
  2618. .\}
  2619. .el \{\
  2620. .sp -1
  2621. .IP " 2." 4.2
  2622. .\}
  2623. It is followed by one or more extended header lines (this example shows a merge with two parents):
  2624. .sp
  2625. .if n \{\
  2626. .RS 4
  2627. .\}
  2628. .nf
  2629. \fBindex\fR \fI<hash>\fR\fB,\fR\fI<hash>\fR`\&.\&.\fB__\fR\fI<hash>\fR\fB__\fR
  2630. {empty}`mode \fI<mode>\fR\fB,\fR\fI<mode>\fR``\&.\&.``\fI<mode>\fR
  2631. \fBnew\fR \fBfile\fR \fBmode\fR \fI<mode>\fR
  2632. \fBdeleted\fR \fBfile\fR \fBmode\fR \fI<mode>\fR\fB,\fR\fI<mode>\fR
  2633. .fi
  2634. .if n \{\
  2635. .RE
  2636. .\}
  2637. The
  2638. \fBmode\fR
  2639. \fI<mode>\fR\fB,\fR\fI<mode>\fR\fB\&.\&.\fR\fI<mode>\fR
  2640. line appears only if at least one of the <mode> is different from the rest\&. Extended headers with information about detected content movement (renames and copying detection) are designed to work with the diff of two
  2641. \fI<tree\-ish>\fR
  2642. and are not used by combined diff format\&.
  2643. .RE
  2644. .sp
  2645. .RS 4
  2646. .ie n \{\
  2647. \h'-04' 3.\h'+01'\c
  2648. .\}
  2649. .el \{\
  2650. .sp -1
  2651. .IP " 3." 4.2
  2652. .\}
  2653. It is followed by a two\-line from\-file/to\-file header:
  2654. .sp
  2655. .if n \{\
  2656. .RS 4
  2657. .\}
  2658. .nf
  2659. \-\-\- a/file
  2660. +++ b/file
  2661. .fi
  2662. .if n \{\
  2663. .RE
  2664. .\}
  2665. .sp
  2666. Similar to the two\-line header for the traditional
  2667. \fIunified\fR
  2668. diff format,
  2669. \fB/dev/null\fR
  2670. is used to signal created or deleted files\&.
  2671. .sp
  2672. However, if the \-\-combined\-all\-paths option is provided, instead of a two\-line from\-file/to\-file, you get an N+1 line from\-file/to\-file header, where N is the number of parents in the merge commit:
  2673. .sp
  2674. .if n \{\
  2675. .RS 4
  2676. .\}
  2677. .nf
  2678. \-\-\- a/file
  2679. \-\-\- a/file
  2680. \-\-\- a/file
  2681. +++ b/file
  2682. .fi
  2683. .if n \{\
  2684. .RE
  2685. .\}
  2686. .sp
  2687. This extended format can be useful if rename or copy detection is active, to allow you to see the original name of the file in different parents\&.
  2688. .RE
  2689. .sp
  2690. .RS 4
  2691. .ie n \{\
  2692. \h'-04' 4.\h'+01'\c
  2693. .\}
  2694. .el \{\
  2695. .sp -1
  2696. .IP " 4." 4.2
  2697. .\}
  2698. Chunk header format is modified to prevent people from accidentally feeding it to
  2699. \fBpatch\fR
  2700. \fB\-p1\fR\&. Combined diff format was created for review of merge commit changes, and was not meant to be applied\&. The change is similar to the change in the extended
  2701. \fIindex\fR
  2702. header:
  2703. .sp
  2704. .if n \{\
  2705. .RS 4
  2706. .\}
  2707. .nf
  2708. @@@ <from\-file\-range> <from\-file\-range> <to\-file\-range> @@@
  2709. .fi
  2710. .if n \{\
  2711. .RE
  2712. .\}
  2713. .sp
  2714. There are (number of parents + 1)
  2715. \fB@\fR
  2716. characters in the chunk header for combined diff format\&.
  2717. .RE
  2718. .sp
  2719. Unlike the traditional \fIunified\fR diff format, which shows two files A and B with a single column that has \fB\-\fR (minus \(em appears in A but removed in B), \fB+\fR (plus \(em missing in A but added to B), or " " (space \(em unchanged) prefix, this format compares two or more files file1, file2,\&...\: with one file X, and shows how X differs from each of fileN\&. One column for each of fileN is prepended to the output line to note how X\(cqs line is different from it\&.
  2720. .sp
  2721. A \fB\-\fR character in the column N means that the line appears in fileN but it does not appear in the result\&. A \fB+\fR character in the column N means that the line appears in the result, and fileN does not have that line (in other words, the line was added, from the point of view of that parent)\&.
  2722. .sp
  2723. In the above example output, the function signature was changed from both files (hence two \fB\-\fR removals from both file1 and file2, plus \fB++\fR to mean one line that was added does not appear in either file1 or file2)\&. Also, eight other lines are the same from file1 but do not appear in file2 (hence prefixed with \fB+\fR)\&.
  2724. .sp
  2725. When shown by \fBgit\fR \fBdiff\-tree\fR \fB\-c\fR, it compares the parents of a merge commit with the merge result (i\&.e\&. file1\&.\&.fileN are the parents)\&. When shown by \fBgit\fR \fBdiff\-files\fR \fB\-c\fR, it compares the two unresolved merge parents with the working tree file (i\&.e\&. file1 is stage 2 aka "our version", file2 is stage 3 aka "their version")\&.
  2726. .SH "EXAMPLES"
  2727. .PP
  2728. \fBgit\fR \fBshow\fR \fBv1\&.0\&.0\fR
  2729. .RS 4
  2730. Shows the tag
  2731. \fBv1\&.0\&.0\fR, along with the object the tag points at\&.
  2732. .RE
  2733. .PP
  2734. \fBgit\fR \fBshow\fR \fBv1\&.0\&.0^\fR{tree}
  2735. .RS 4
  2736. Shows the tree pointed to by the tag
  2737. \fBv1\&.0\&.0\fR\&.
  2738. .RE
  2739. .PP
  2740. \fBgit\fR \fBshow\fR \fB\-s\fR \fB\-\-format=\fR%s \fBv1\&.0\&.0^\fR{commit}
  2741. .RS 4
  2742. Shows the subject of the commit pointed to by the tag
  2743. \fBv1\&.0\&.0\fR\&.
  2744. .RE
  2745. .PP
  2746. \fBgit\fR \fBshow\fR \fBnext~10:Documentation/README\fR
  2747. .RS 4
  2748. Shows the contents of the file
  2749. \fBDocumentation/README\fR
  2750. as they were current in the 10th last commit of the branch
  2751. \fBnext\fR\&.
  2752. .RE
  2753. .PP
  2754. \fBgit\fR \fBshow\fR \fBmaster:Makefile\fR \fBmaster:t/Makefile\fR
  2755. .RS 4
  2756. Concatenates the contents of said Makefiles in the head of the branch
  2757. \fBmaster\fR\&.
  2758. .RE
  2759. .SH "DISCUSSION"
  2760. .sp
  2761. Git is to some extent character encoding agnostic\&.
  2762. .sp
  2763. .RS 4
  2764. .ie n \{\
  2765. \h'-04'\(bu\h'+03'\c
  2766. .\}
  2767. .el \{\
  2768. .sp -1
  2769. .IP \(bu 2.3
  2770. .\}
  2771. The contents of the blob objects are uninterpreted sequences of bytes\&. There is no encoding translation at the core level\&.
  2772. .RE
  2773. .sp
  2774. .RS 4
  2775. .ie n \{\
  2776. \h'-04'\(bu\h'+03'\c
  2777. .\}
  2778. .el \{\
  2779. .sp -1
  2780. .IP \(bu 2.3
  2781. .\}
  2782. Path names are encoded in UTF\-8 normalization form C\&. This applies to tree objects, the index file, ref names, as well as path names in command line arguments, environment variables and config files (\&.\fBgit/config\fR
  2783. (see
  2784. \fBgit-config\fR(1)),
  2785. \fBgitignore\fR(5),
  2786. \fBgitattributes\fR(5)
  2787. and
  2788. \fBgitmodules\fR(5))\&.
  2789. .sp
  2790. Note that Git at the core level treats path names simply as sequences of non\-NUL bytes, there are no path name encoding conversions (except on Mac and Windows)\&. Therefore, using non\-ASCII path names will mostly work even on platforms and file systems that use legacy extended ASCII encodings\&. However, repositories created on such systems will not work properly on UTF\-8\-based systems (e\&.g\&. Linux, Mac, Windows) and vice versa\&. Additionally, many Git\-based tools simply assume path names to be UTF\-8 and will fail to display other encodings correctly\&.
  2791. .RE
  2792. .sp
  2793. .RS 4
  2794. .ie n \{\
  2795. \h'-04'\(bu\h'+03'\c
  2796. .\}
  2797. .el \{\
  2798. .sp -1
  2799. .IP \(bu 2.3
  2800. .\}
  2801. Commit log messages are typically encoded in UTF\-8, but other extended ASCII encodings are also supported\&. This includes ISO\-8859\-x, CP125x and many others, but
  2802. \fInot\fR
  2803. UTF\-16/32, EBCDIC and CJK multi\-byte encodings (GBK, Shift\-JIS, Big5, EUC\-x, CP9xx etc\&.)\&.
  2804. .RE
  2805. .sp
  2806. Although we encourage that the commit log messages are encoded in UTF\-8, both the core and Git Porcelain are designed not to force UTF\-8 on projects\&. If all participants of a particular project find it more convenient to use legacy encodings, Git does not forbid it\&. However, there are a few things to keep in mind\&.
  2807. .sp
  2808. .RS 4
  2809. .ie n \{\
  2810. \h'-04' 1.\h'+01'\c
  2811. .\}
  2812. .el \{\
  2813. .sp -1
  2814. .IP " 1." 4.2
  2815. .\}
  2816. \fBgit\fR
  2817. \fBcommit\fR
  2818. and
  2819. \fBgit\fR
  2820. \fBcommit\-tree\fR
  2821. issue a warning if the commit log message given to it does not look like a valid UTF\-8 string, unless you explicitly say your project uses a legacy encoding\&. The way to say this is to have
  2822. \fBi18n\&.commitEncoding\fR
  2823. in \&.\fBgit/config\fR
  2824. file, like this:
  2825. .sp
  2826. .if n \{\
  2827. .RS 4
  2828. .\}
  2829. .nf
  2830. [i18n]
  2831. commitEncoding = ISO\-8859\-1
  2832. .fi
  2833. .if n \{\
  2834. .RE
  2835. .\}
  2836. .sp
  2837. Commit objects created with the above setting record the value of
  2838. \fBi18n\&.commitEncoding\fR
  2839. in their
  2840. \fBencoding\fR
  2841. header\&. This is to help other people who look at them later\&. Lack of this header implies that the commit log message is encoded in UTF\-8\&.
  2842. .RE
  2843. .sp
  2844. .RS 4
  2845. .ie n \{\
  2846. \h'-04' 2.\h'+01'\c
  2847. .\}
  2848. .el \{\
  2849. .sp -1
  2850. .IP " 2." 4.2
  2851. .\}
  2852. \fBgit\fR
  2853. \fBlog\fR,
  2854. \fBgit\fR
  2855. \fBshow\fR,
  2856. \fBgit\fR
  2857. \fBblame\fR
  2858. and friends look at the
  2859. \fBencoding\fR
  2860. header of a commit object, and try to re\-code the log message into UTF\-8 unless otherwise specified\&. You can specify the desired output encoding with
  2861. \fBi18n\&.logOutputEncoding\fR
  2862. in \&.\fBgit/config\fR
  2863. file, like this:
  2864. .sp
  2865. .if n \{\
  2866. .RS 4
  2867. .\}
  2868. .nf
  2869. [i18n]
  2870. logOutputEncoding = ISO\-8859\-1
  2871. .fi
  2872. .if n \{\
  2873. .RE
  2874. .\}
  2875. .sp
  2876. If you do not have this configuration variable, the value of
  2877. \fBi18n\&.commitEncoding\fR
  2878. is used instead\&.
  2879. .RE
  2880. .sp
  2881. Note that we deliberately chose not to re\-code the commit log message when a commit is made to force UTF\-8 at the commit object level, because re\-coding to UTF\-8 is not necessarily a reversible operation\&.
  2882. .SH "GIT"
  2883. .sp
  2884. Part of the \fBgit\fR(1) suite