1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <article lang="en" id="git-log(1)">
\r
6 <title>git-log(1)</title>
\r
8 <primary>git-log(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-log - Show commit logs</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git log</emphasis> [<options>] [<since>..<until>] [[--] <path>…]</literallayout>
\r
21 <simplesect id="_description">
\r
22 <title>DESCRIPTION</title>
\r
23 <simpara>Shows the commit logs.</simpara>
\r
24 <simpara>The command takes options applicable to the <emphasis>git rev-list</emphasis>
\r
25 command to control what is shown and how, and options applicable to
\r
26 the <emphasis>git diff-*</emphasis> commands to control how the changes
\r
27 each commit introduces are shown.</simpara>
\r
29 <simplesect id="_options">
\r
30 <title>OPTIONS</title>
\r
38 Limits the number of commits to show.
\r
39 Note that this is a commit limiting option, see below.
\r
45 <since>..<until>
\r
49 Show only commits between the named two commits. When
\r
50 either <since> or <until> is omitted, it defaults to
\r
51 <emphasis>HEAD</emphasis>, i.e. the tip of the current branch.
\r
52 For a more complete list of ways to spell <since>
\r
53 and <until>, see <xref linkend="gitrevisions(7)" />.
\r
63 Continue listing the history of a file beyond renames
\r
64 (works only for a single file).
\r
73 --decorate[=short|full|no]
\r
77 Print out the ref names of any commits that are shown. If <emphasis>short</emphasis> is
\r
78 specified, the ref name prefixes <emphasis>refs/heads/</emphasis>, <emphasis>refs/tags/</emphasis> and
\r
79 <emphasis>refs/remotes/</emphasis> will not be printed. If <emphasis>full</emphasis> is specified, the
\r
80 full ref name (including prefix) will be printed. The default option
\r
81 is <emphasis>short</emphasis>.
\r
91 Print out the ref name given on the command line by which each
\r
102 Without this flag, "git log -p <path>…" shows commits that
\r
103 touch the specified paths, and diffs about the same specified
\r
104 paths. With this, the full diff is shown for commits that touch
\r
105 the specified paths; this means that "<path>…" limits only
\r
106 commits, and doesn't limit diff for those commits.
\r
108 <simpara>Note that this affects all diff-based output types, e.g. those
\r
109 produced by --stat etc.</simpara>
\r
118 Before the log message print out its size in bytes. Intended
\r
119 mainly for porcelain tools consumption. If git is unable to
\r
120 produce a valid value size is set to zero.
\r
121 Note that only message is considered, if also a diff is shown
\r
122 its size is not included.
\r
128 [--] <path>…
\r
132 Show only commits that are enough to explain how the files
\r
133 that match the specified paths came to be. See "History
\r
134 Simplification" below for details and other simplification
\r
137 <simpara>To prevent confusion with options and branch names, paths may need to
\r
138 be prefixed with "-- " to separate them from options or refnames.</simpara>
\r
142 <section id="_commit_limiting">
\r
143 <title>Commit Limiting</title>
\r
144 <simpara>Besides specifying a range of commits that should be listed using the
\r
145 special notations explained in the description, additional commit
\r
146 limiting may be applied. Note that they are applied before commit
\r
147 ordering and formatting options, such as <emphasis>--reverse</emphasis>.</simpara>
\r
151 -n <emphasis>number</emphasis>
\r
154 --max-count=<number>
\r
158 Limit the number of commits to output.
\r
164 --skip=<number>
\r
168 Skip <emphasis>number</emphasis> commits before starting to show the commit output.
\r
174 --since=<date>
\r
177 --after=<date>
\r
181 Show commits more recent than a specific date.
\r
187 --until=<date>
\r
190 --before=<date>
\r
194 Show commits older than a specific date.
\r
200 --author=<pattern>
\r
203 --committer=<pattern>
\r
207 Limit the commits output to ones with author/committer
\r
208 header lines that match the specified pattern (regular expression).
\r
214 --grep=<pattern>
\r
218 Limit the commits output to ones with log message that
\r
219 matches the specified pattern (regular expression).
\r
229 Limit the commits output to ones that match all given --grep,
\r
230 --author and --committer instead of ones that match at least one.
\r
239 --regexp-ignore-case
\r
243 Match the regexp limiting patterns without regard to letters case.
\r
256 Consider the limiting patterns to be extended regular expressions
\r
257 instead of the default basic regular expressions.
\r
270 Consider the limiting patterns to be fixed strings (don't interpret
\r
271 pattern as a regular expression).
\r
281 Stop when a given path disappears from the tree.
\r
291 Print only merge commits. This is exactly the same as <emphasis>--min-parents=2</emphasis>.
\r
301 Do not print commits with more than one parent. This is
\r
302 exactly the same as <emphasis>--max-parents=1</emphasis>.
\r
308 --min-parents=<number>
\r
311 --max-parents=<number>
\r
321 Show only commits which have at least (or at most) that many
\r
322 commits. In particular, <emphasis>--max-parents=1</emphasis> is the same as <emphasis>--no-merges</emphasis>,
\r
323 <emphasis>--min-parents=2</emphasis> is the same as <emphasis>--merges</emphasis>. <emphasis>--max-parents=0</emphasis>
\r
324 gives all root commits and <emphasis>--min-parents=3</emphasis> all octopus merges.
\r
326 <simpara><emphasis>--no-min-parents</emphasis> and <emphasis>--no-max-parents</emphasis> reset these limits (to no limit)
\r
327 again. Equivalent forms are <emphasis>--min-parents=0</emphasis> (any commit has 0 or more
\r
328 parents) and <emphasis>--max-parents=-1</emphasis> (negative numbers denote no upper limit).</simpara>
\r
337 Follow only the first parent commit upon seeing a merge
\r
338 commit. This option can give a better overview when
\r
339 viewing the evolution of a particular topic branch,
\r
340 because merges into a topic branch tend to be only about
\r
341 adjusting to updated upstream from time to time, and
\r
342 this option allows you to ignore the individual commits
\r
343 brought in to your history by such a merge.
\r
353 Reverses the meaning of the <emphasis>^</emphasis> prefix (or lack thereof)
\r
354 for all following revision specifiers, up to the next <emphasis>--not</emphasis>.
\r
364 Pretend as if all the refs in <emphasis>refs/</emphasis> are listed on the
\r
365 command line as <emphasis><commit></emphasis>.
\r
371 --branches[=<pattern>]
\r
375 Pretend as if all the refs in <emphasis>refs/heads</emphasis> are listed
\r
376 on the command line as <emphasis><commit></emphasis>. If <emphasis><pattern></emphasis> is given, limit
\r
377 branches to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>,
\r
378 <emphasis>*</emphasis>, or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
384 --tags[=<pattern>]
\r
388 Pretend as if all the refs in <emphasis>refs/tags</emphasis> are listed
\r
389 on the command line as <emphasis><commit></emphasis>. If <emphasis><pattern></emphasis> is given, limit
\r
390 tags to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>, <emphasis>*</emphasis>,
\r
391 or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
397 --remotes[=<pattern>]
\r
401 Pretend as if all the refs in <emphasis>refs/remotes</emphasis> are listed
\r
402 on the command line as <emphasis><commit></emphasis>. If <emphasis><pattern></emphasis> is given, limit
\r
403 remote-tracking branches to ones matching given shell glob.
\r
404 If pattern lacks <emphasis>?</emphasis>, <emphasis>*</emphasis>, or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
410 --glob=<glob-pattern>
\r
414 Pretend as if all the refs matching shell glob <emphasis><glob-pattern></emphasis>
\r
415 are listed on the command line as <emphasis><commit></emphasis>. Leading <emphasis>refs/</emphasis>,
\r
416 is automatically prepended if missing. If pattern lacks <emphasis>?</emphasis>, <emphasis>*</emphasis>,
\r
417 or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
427 Upon seeing an invalid object name in the input, pretend as if
\r
428 the bad input was not given.
\r
438 Pretend as if the bad bisection ref <emphasis>refs/bisect/bad</emphasis>
\r
439 was listed and as if it was followed by <emphasis>--not</emphasis> and the good
\r
440 bisection refs <emphasis>refs/bisect/good-*</emphasis> on the command
\r
451 In addition to the <emphasis><commit></emphasis> listed on the command
\r
452 line, read them from the standard input. If a <emphasis>--</emphasis> separator is
\r
453 seen, stop reading commits and start reading paths to limit the
\r
464 Like <emphasis>--cherry-pick</emphasis> (see below) but mark equivalent commits
\r
465 with <emphasis>=</emphasis> rather than omitting them, and inequivalent ones with <emphasis>+</emphasis>.
\r
475 Omit any commit that introduces the same change as
\r
476 another commit on the "other side" when the set of
\r
477 commits are limited with symmetric difference.
\r
479 <simpara>For example, if you have two branches, <emphasis>A</emphasis> and <emphasis>B</emphasis>, a usual way
\r
480 to list all commits on only one side of them is with
\r
481 <emphasis>--left-right</emphasis> (see the example below in the description of
\r
482 the <emphasis>--left-right</emphasis> option). It however shows the commits that were cherry-picked
\r
483 from the other branch (for example, "3rd on b" may be cherry-picked
\r
484 from branch A). With this option, such pairs of commits are
\r
485 excluded from the output.</simpara>
\r
497 List only commits on the respective side of a symmetric range,
\r
498 i.e. only those which would be marked <emphasis><</emphasis> resp. <emphasis>></emphasis> by
\r
499 <emphasis>--left-right</emphasis>.
\r
501 <simpara>For example, <emphasis>--cherry-pick --right-only A...B</emphasis> omits those
\r
502 commits from <emphasis>B</emphasis> which are in <emphasis>A</emphasis> or are patch-equivalent to a commit in
\r
503 <emphasis>A</emphasis>. In other words, this lists the <emphasis>+</emphasis> commits from <emphasis>git cherry A B</emphasis>.
\r
504 More precisely, <emphasis>--cherry-pick --right-only --no-merges</emphasis> gives the exact
\r
514 A synonym for <emphasis>--right-only --cherry-mark --no-merges</emphasis>; useful to
\r
515 limit the output to the commits on our side and mark those that
\r
516 have been applied to the other side of a forked history with
\r
517 <emphasis>git log --cherry upstream...mybranch</emphasis>, similar to
\r
518 <emphasis>git cherry upstream mybranch</emphasis>.
\r
531 Instead of walking the commit ancestry chain, walk
\r
532 reflog entries from the most recent one to older ones.
\r
533 When this option is used you cannot specify commits to
\r
534 exclude (that is, <emphasis>^commit</emphasis>, <emphasis>commit1..commit2</emphasis>,
\r
535 nor <emphasis>commit1...commit2</emphasis> notations cannot be used).
\r
537 <simpara>With <emphasis>--pretty</emphasis> format other than oneline (for obvious reasons),
\r
538 this causes the output to have two extra lines of information
\r
539 taken from the reflog. By default, <emphasis>commit@{Nth}</emphasis> notation is
\r
540 used in the output. When the starting commit is specified as
\r
541 <emphasis>commit@{now}</emphasis>, output also uses <emphasis>commit@{timestamp}</emphasis> notation
\r
542 instead. Under <emphasis>--pretty=oneline</emphasis>, the commit message is
\r
543 prefixed with this information on the same line.
\r
544 This option cannot be combined with <emphasis>--reverse</emphasis>.
\r
545 See also <xref linkend="git-reflog(1)" />.</simpara>
\r
554 After a failed merge, show refs that touch files having a
\r
555 conflict and don't exist on all heads to merge.
\r
565 Output uninteresting commits at the boundary, which are usually
\r
572 <section id="_history_simplification">
\r
573 <title>History Simplification</title>
\r
574 <simpara>Sometimes you are only interested in parts of the history, for example the
\r
575 commits modifying a particular <path>. But there are two parts of
\r
576 <emphasis>History Simplification</emphasis>, one part is selecting the commits and the other
\r
577 is how to do it, as there are various strategies to simplify the history.</simpara>
\r
578 <simpara>The following options select the commits to be shown:</simpara>
\r
586 Commits modifying the given <paths> are selected.
\r
592 --simplify-by-decoration
\r
596 Commits that are referred by some branch or tag are selected.
\r
601 <simpara>Note that extra commits can be shown to give a meaningful history.</simpara>
\r
602 <simpara>The following options affect the way the simplification is performed:</simpara>
\r
610 Simplifies the history to the simplest history explaining the
\r
611 final state of the tree. Simplest because it prunes some side
\r
612 branches if the end result is the same (i.e. merging branches
\r
613 with the same content)
\r
623 Same as the default mode, but does not prune some history.
\r
633 Only the selected commits are shown, plus some to have a
\r
634 meaningful history.
\r
644 All commits in the simplified history are shown.
\r
654 Additional option to <emphasis>--full-history</emphasis> to remove some needless
\r
655 merges from the resulting history, as there are no selected
\r
656 commits contributing to this merge.
\r
666 When given a range of commits to display (e.g. <emphasis>commit1..commit2</emphasis>
\r
667 or <emphasis>commit2 ^commit1</emphasis>), only display commits that exist
\r
668 directly on the ancestry chain between the <emphasis>commit1</emphasis> and
\r
669 <emphasis>commit2</emphasis>, i.e. commits that are both descendants of <emphasis>commit1</emphasis>,
\r
670 and ancestors of <emphasis>commit2</emphasis>.
\r
675 <simpara>A more detailed explanation follows.</simpara>
\r
676 <simpara>Suppose you specified <emphasis>foo</emphasis> as the <paths>. We shall call commits
\r
677 that modify <emphasis>foo</emphasis> !TREESAME, and the rest TREESAME. (In a diff
\r
678 filtered for <emphasis>foo</emphasis>, they look different and equal, respectively.)</simpara>
\r
679 <simpara>In the following, we will always refer to the same example history to
\r
680 illustrate the differences between simplification settings. We assume
\r
681 that you are filtering for a file <emphasis>foo</emphasis> in this commit graph:</simpara>
\r
682 <screen> .-A---M---N---O---P
\r
686 `-------------'</screen>
\r
687 <simpara>The horizontal line of history A---P is taken to be the first parent of
\r
688 each merge. The commits are:</simpara>
\r
692 <emphasis>I</emphasis> is the initial commit, in which <emphasis>foo</emphasis> exists with contents
\r
693 "asdf", and a file <emphasis>quux</emphasis> exists with contents "quux". Initial
\r
694 commits are compared to an empty tree, so <emphasis>I</emphasis> is !TREESAME.
\r
699 In <emphasis>A</emphasis>, <emphasis>foo</emphasis> contains just "foo".
\r
704 <emphasis>B</emphasis> contains the same change as <emphasis>A</emphasis>. Its merge <emphasis>M</emphasis> is trivial and
\r
705 hence TREESAME to all parents.
\r
710 <emphasis>C</emphasis> does not change <emphasis>foo</emphasis>, but its merge <emphasis>N</emphasis> changes it to "foobar",
\r
711 so it is not TREESAME to any parent.
\r
716 <emphasis>D</emphasis> sets <emphasis>foo</emphasis> to "baz". Its merge <emphasis>O</emphasis> combines the strings from
\r
717 <emphasis>N</emphasis> and <emphasis>D</emphasis> to "foobarbaz"; i.e., it is not TREESAME to any parent.
\r
722 <emphasis>E</emphasis> changes <emphasis>quux</emphasis> to "xyzzy", and its merge <emphasis>P</emphasis> combines the
\r
723 strings to "quux xyzzy". Despite appearing interesting, <emphasis>P</emphasis> is
\r
724 TREESAME to all parents.
\r
728 <simpara><emphasis>rev-list</emphasis> walks backwards through history, including or excluding
\r
729 commits based on whether <emphasis>--full-history</emphasis> and/or parent rewriting
\r
730 (via <emphasis>--parents</emphasis> or <emphasis>--children</emphasis>) are used. The following settings
\r
731 are available.</simpara>
\r
739 Commits are included if they are not TREESAME to any parent
\r
740 (though this can be changed, see <emphasis>--sparse</emphasis> below). If the
\r
741 commit was a merge, and it was TREESAME to one parent, follow
\r
742 only that parent. (Even if there are several TREESAME
\r
743 parents, follow only one of them.) Otherwise, follow all
\r
746 <simpara>This results in:</simpara>
\r
747 <screen> .-A---N---O
\r
749 I---------D</screen>
\r
750 <simpara>Note how the rule to only follow the TREESAME parent, if one is
\r
751 available, removed <emphasis>B</emphasis> from consideration entirely. <emphasis>C</emphasis> was
\r
752 considered via <emphasis>N</emphasis>, but is TREESAME. Root commits are compared to an
\r
753 empty tree, so <emphasis>I</emphasis> is !TREESAME.</simpara>
\r
754 <simpara>Parent/child relations are only visible with --parents, but that does
\r
755 not affect the commits selected in default mode, so we have shown the
\r
756 parent lines.</simpara>
\r
761 --full-history without parent rewriting
\r
765 This mode differs from the default in one point: always follow
\r
766 all parents of a merge, even if it is TREESAME to one of them.
\r
767 Even if more than one side of the merge has commits that are
\r
768 included, this does not imply that the merge itself is! In
\r
769 the example, we get
\r
771 <screen> I A B N D O</screen>
\r
772 <simpara><emphasis>P</emphasis> and <emphasis>M</emphasis> were excluded because they are TREESAME to a parent. <emphasis>E</emphasis>,
\r
773 <emphasis>C</emphasis> and <emphasis>B</emphasis> were all walked, but only <emphasis>B</emphasis> was !TREESAME, so the others
\r
774 do not appear.</simpara>
\r
775 <simpara>Note that without parent rewriting, it is not really possible to talk
\r
776 about the parent/child relationships between the commits, so we show
\r
777 them disconnected.</simpara>
\r
782 --full-history with parent rewriting
\r
786 Ordinary commits are only included if they are !TREESAME
\r
787 (though this can be changed, see <emphasis>--sparse</emphasis> below).
\r
789 <simpara>Merges are always included. However, their parent list is rewritten:
\r
790 Along each parent, prune away commits that are not included
\r
791 themselves. This results in</simpara>
\r
792 <screen> .-A---M---N---O---P
\r
796 `-------------'</screen>
\r
797 <simpara>Compare to <emphasis>--full-history</emphasis> without rewriting above. Note that <emphasis>E</emphasis>
\r
798 was pruned away because it is TREESAME, but the parent list of P was
\r
799 rewritten to contain <emphasis>E</emphasis>'s parent <emphasis>I</emphasis>. The same happened for <emphasis>C</emphasis> and
\r
800 <emphasis>N</emphasis>. Note also that <emphasis>P</emphasis> was included despite being TREESAME.</simpara>
\r
804 <simpara>In addition to the above settings, you can change whether TREESAME
\r
805 affects inclusion:</simpara>
\r
813 Commits that are walked are included if they are not TREESAME
\r
824 All commits that are walked are included.
\r
826 <simpara>Note that without <emphasis>--full-history</emphasis>, this still simplifies merges: if
\r
827 one of the parents is TREESAME, we follow only that one, so the other
\r
828 sides of the merge are never walked.</simpara>
\r
837 First, build a history graph in the same way that
\r
838 <emphasis>--full-history</emphasis> with parent rewriting does (see above).
\r
840 <simpara>Then simplify each commit <emphasis>C</emphasis> to its replacement <emphasis>C'</emphasis> in the final
\r
841 history according to the following rules:</simpara>
\r
845 Set <emphasis>C'</emphasis> to <emphasis>C</emphasis>.
\r
850 Replace each parent <emphasis>P</emphasis> of <emphasis>C'</emphasis> with its simplification <emphasis>P'</emphasis>. In
\r
851 the process, drop parents that are ancestors of other parents, and
\r
857 If after this parent rewriting, <emphasis>C'</emphasis> is a root or merge commit (has
\r
858 zero or >1 parents), a boundary commit, or !TREESAME, it remains.
\r
859 Otherwise, it is replaced with its only parent.
\r
863 <simpara>The effect of this is best shown by way of comparing to
\r
864 <emphasis>--full-history</emphasis> with parent rewriting. The example turns into:</simpara>
\r
865 <screen> .-A---M---N---O
\r
869 `---------'</screen>
\r
870 <simpara>Note the major differences in <emphasis>N</emphasis> and <emphasis>P</emphasis> over <emphasis>--full-history</emphasis>:</simpara>
\r
874 <emphasis>N</emphasis>'s parent list had <emphasis>I</emphasis> removed, because it is an ancestor of the
\r
875 other parent <emphasis>M</emphasis>. Still, <emphasis>N</emphasis> remained because it is !TREESAME.
\r
880 <emphasis>P</emphasis>'s parent list similarly had <emphasis>I</emphasis> removed. <emphasis>P</emphasis> was then
\r
881 removed completely, because it had one parent and is TREESAME.
\r
888 <simpara>Finally, there is a fifth simplification mode available:</simpara>
\r
896 Limit the displayed commits to those directly on the ancestry
\r
897 chain between the "from" and "to" commits in the given commit
\r
898 range. I.e. only display commits that are ancestor of the "to"
\r
899 commit, and descendants of the "from" commit.
\r
901 <simpara>As an example use case, consider the following commit history:</simpara>
\r
902 <screen> D---E-------F
\r
904 B---C---G---H---I---J
\r
906 A-------K---------------L--M</screen>
\r
907 <simpara>A regular <emphasis>D..M</emphasis> computes the set of commits that are ancestors of <emphasis>M</emphasis>,
\r
908 but excludes the ones that are ancestors of <emphasis>D</emphasis>. This is useful to see
\r
909 what happened to the history leading to <emphasis>M</emphasis> since <emphasis>D</emphasis>, in the sense
\r
910 that "what does <emphasis>M</emphasis> have that did not exist in <emphasis>D</emphasis>". The result in this
\r
911 example would be all the commits, except <emphasis>A</emphasis> and <emphasis>B</emphasis> (and <emphasis>D</emphasis> itself,
\r
912 of course).</simpara>
\r
913 <simpara>When we want to find out what commits in <emphasis>M</emphasis> are contaminated with the
\r
914 bug introduced by <emphasis>D</emphasis> and need fixing, however, we might want to view
\r
915 only the subset of <emphasis>D..M</emphasis> that are actually descendants of <emphasis>D</emphasis>, i.e.
\r
916 excluding <emphasis>C</emphasis> and <emphasis>K</emphasis>. This is exactly what the <emphasis>--ancestry-path</emphasis>
\r
917 option does. Applied to the <emphasis>D..M</emphasis> range, it results in:</simpara>
\r
926 <simpara>The <emphasis>--simplify-by-decoration</emphasis> option allows you to view only the
\r
927 big picture of the topology of the history, by omitting commits
\r
928 that are not referenced by tags. Commits are marked as !TREESAME
\r
929 (in other words, kept after history simplification rules described
\r
930 above) if (1) they are referenced by tags, or (2) they change the
\r
931 contents of the paths given on the command line. All other
\r
932 commits are marked as TREESAME (subject to be simplified away).</simpara>
\r
934 <section id="_commit_ordering">
\r
935 <title>Commit Ordering</title>
\r
936 <simpara>By default, the commits are shown in reverse chronological order.</simpara>
\r
944 This option makes them appear in topological order (i.e.
\r
945 descendant commits are shown before their parents).
\r
955 This option is similar to <emphasis>--topo-order</emphasis> in the sense that no
\r
956 parent comes before all of its children, but otherwise things
\r
957 are still ordered in the commit timestamp order.
\r
967 Output the commits in reverse order.
\r
968 Cannot be combined with <emphasis>--walk-reflogs</emphasis>.
\r
974 <section id="_object_traversal">
\r
975 <title>Object Traversal</title>
\r
976 <simpara>These options are mostly targeted for packing of git repositories.</simpara>
\r
984 Print the object IDs of any object referenced by the listed
\r
985 commits. <emphasis>--objects foo ^bar</emphasis> thus means "send me
\r
986 all object IDs which I need to download if I have the commit
\r
987 object <emphasis>bar</emphasis>, but not <emphasis>foo</emphasis>".
\r
997 Similar to <emphasis>--objects</emphasis>, but also print the IDs of excluded
\r
998 commits prefixed with a "-" character. This is used by
\r
999 <xref linkend="git-pack-objects(1)" /> to build "thin" pack, which records
\r
1000 objects in deltified form based on objects contained in these
\r
1001 excluded commits to reduce network traffic.
\r
1011 Only useful with <emphasis>--objects</emphasis>; print the object IDs that are not
\r
1022 Only show the given revs, but do not traverse their ancestors.
\r
1032 Overrides a previous --no-walk.
\r
1038 <section id="_commit_formatting">
\r
1039 <title>Commit Formatting</title>
\r
1043 --pretty[=<format>]
\r
1046 --format=<format>
\r
1050 Pretty-print the contents of the commit logs in a given format,
\r
1051 where <emphasis><format></emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,
\r
1052 <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis> and <emphasis>format:<string></emphasis>. See
\r
1053 the "PRETTY FORMATS" section for some additional details for each
\r
1054 format. When omitted, the format defaults to <emphasis>medium</emphasis>.
\r
1056 <simpara>Note: you can specify the default pretty format in the repository
\r
1057 configuration (see <xref linkend="git-config(1)" />).</simpara>
\r
1066 Instead of showing the full 40-byte hexadecimal commit object
\r
1067 name, show only a partial prefix. Non default number of
\r
1068 digits can be specified with "--abbrev=<n>" (which also modifies
\r
1069 diff output, if it is displayed).
\r
1071 <simpara>This should make "--pretty=oneline" a whole lot more readable for
\r
1072 people using 80-column terminals.</simpara>
\r
1077 --no-abbrev-commit
\r
1081 Show the full 40-byte hexadecimal commit object name. This negates
\r
1082 <emphasis>--abbrev-commit</emphasis> and those options which imply it such as
\r
1083 "--oneline". It also overrides the <emphasis>log.abbrevCommit</emphasis> variable.
\r
1093 This is a shorthand for "--pretty=oneline --abbrev-commit"
\r
1100 --encoding[=<encoding>]
\r
1104 The commit objects record the encoding used for the log message
\r
1105 in their encoding header; this option can be used to tell the
\r
1106 command to re-code the commit log message in the encoding
\r
1107 preferred by the user. For non plumbing commands this
\r
1108 defaults to UTF-8.
\r
1114 --notes[=<ref>]
\r
1118 Show the notes (see <xref linkend="git-notes(1)" />) that annotate the
\r
1119 commit, when showing the commit log message. This is the default
\r
1120 for <emphasis>git log</emphasis>, <emphasis>git show</emphasis> and <emphasis>git whatchanged</emphasis> commands when
\r
1121 there is no <emphasis>--pretty</emphasis>, <emphasis>--format</emphasis> nor <emphasis>--oneline</emphasis> option given
\r
1122 on the command line.
\r
1124 <simpara>By default, the notes shown are from the notes refs listed in the
\r
1125 <emphasis>core.notesRef</emphasis> and <emphasis>notes.displayRef</emphasis> variables (or corresponding
\r
1126 environment overrides). See <xref linkend="git-config(1)" /> for more details.</simpara>
\r
1127 <simpara>With an optional <emphasis><ref></emphasis> argument, show this notes ref instead of the
\r
1128 default notes ref(s). The ref is taken to be in <emphasis>refs/notes/</emphasis> if it
\r
1129 is not qualified.</simpara>
\r
1130 <simpara>Multiple --notes options can be combined to control which notes are
\r
1131 being displayed. Examples: "--notes=foo" will show only notes from
\r
1132 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
\r
1133 "refs/notes/foo" and from the default notes ref(s).</simpara>
\r
1142 Do not show notes. This negates the above <emphasis>--notes</emphasis> option, by
\r
1143 resetting the list of notes refs from which notes are shown.
\r
1144 Options are parsed in the order given on the command line, so e.g.
\r
1145 "--notes --notes=foo --no-notes --notes=bar" will only show notes
\r
1146 from "refs/notes/bar".
\r
1152 --show-notes[=<ref>]
\r
1155 --[no-]standard-notes
\r
1159 These options are deprecated. Use the above --notes/--no-notes
\r
1170 Synonym for <emphasis>--date=relative</emphasis>.
\r
1176 --date=(relative|local|default|iso|rfc|short|raw)
\r
1180 Only takes effect for dates shown in human-readable format, such
\r
1181 as when using "--pretty". <emphasis>log.date</emphasis> config variable sets a default
\r
1182 value for log command's --date option.
\r
1184 <simpara><emphasis>--date=relative</emphasis> shows dates relative to the current time,
\r
1185 e.g. "2 hours ago".</simpara>
\r
1186 <simpara><emphasis>--date=local</emphasis> shows timestamps in user's local timezone.</simpara>
\r
1187 <simpara><emphasis>--date=iso</emphasis> (or <emphasis>--date=iso8601</emphasis>) shows timestamps in ISO 8601 format.</simpara>
\r
1188 <simpara><emphasis>--date=rfc</emphasis> (or <emphasis>--date=rfc2822</emphasis>) shows timestamps in RFC 2822
\r
1189 format, often found in E-mail messages.</simpara>
\r
1190 <simpara><emphasis>--date=short</emphasis> shows only date but not time, in <emphasis>YYYY-MM-DD</emphasis> format.</simpara>
\r
1191 <simpara><emphasis>--date=raw</emphasis> shows the date in the internal raw git format <emphasis>%s %z</emphasis> format.</simpara>
\r
1192 <simpara><emphasis>--date=default</emphasis> shows timestamps in the original timezone
\r
1193 (either committer's or author's).</simpara>
\r
1202 Print also the parents of the commit (in the form "commit parent…").
\r
1203 Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.
\r
1213 Print also the children of the commit (in the form "commit child…").
\r
1214 Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.
\r
1224 Mark which side of a symmetric diff a commit is reachable from.
\r
1225 Commits from the left side are prefixed with <emphasis><</emphasis> and those from
\r
1226 the right with <emphasis>></emphasis>. If combined with <emphasis>--boundary</emphasis>, those
\r
1227 commits are prefixed with <emphasis>-</emphasis>.
\r
1229 <simpara>For example, if you have this topology:</simpara>
\r
1230 <screen> y---b---b branch B
\r
1234 o---x---a---a branch A</screen>
\r
1235 <simpara>you would get an output like this:</simpara>
\r
1236 <screen> $ git rev-list --left-right --boundary --pretty=oneline A...B
\r
1238 >bbbbbbb... 3rd on b
\r
1239 >bbbbbbb... 2nd on b
\r
1240 <aaaaaaa... 3rd on a
\r
1241 <aaaaaaa... 2nd on a
\r
1242 -yyyyyyy... 1st on b
\r
1243 -xxxxxxx... 1st on a</screen>
\r
1252 Draw a text-based graphical representation of the commit history
\r
1253 on the left hand side of the output. This may cause extra lines
\r
1254 to be printed in between commits, in order for the graph history
\r
1255 to be drawn properly.
\r
1257 <simpara>This enables parent rewriting, see <emphasis>History Simplification</emphasis> below.</simpara>
\r
1258 <simpara>This implies the <emphasis>--topo-order</emphasis> option by default, but the
\r
1259 <emphasis>--date-order</emphasis> option may also be specified.</simpara>
\r
1264 <section id="_diff_formatting">
\r
1265 <title>Diff Formatting</title>
\r
1266 <simpara>Below are listed options that control the formatting of diff output.
\r
1267 Some of them are specific to <xref linkend="git-rev-list(1)" />, however other diff
\r
1268 options may be given. See <xref linkend="git-diff-files(1)" /> for more options.</simpara>
\r
1276 With this option, diff output for a merge commit
\r
1277 shows the differences from each of the parents to the merge result
\r
1278 simultaneously instead of showing pairwise diff between a parent
\r
1279 and the result one at a time. Furthermore, it lists only files
\r
1280 which were modified from all parents.
\r
1290 This flag implies the <emphasis>-c</emphasis> options and further compresses the
\r
1291 patch output by omitting uninteresting hunks whose contents in
\r
1292 the parents have only two variants and the merge result picks
\r
1293 one of them without modification.
\r
1303 This flag makes the merge commits show the full diff like
\r
1304 regular commits; for each merge parent, a separate log entry
\r
1305 and diff is generated. An exception is that only diff against
\r
1306 the first parent is shown when <emphasis>--first-parent</emphasis> option is given;
\r
1307 in that case, the output represents the changes the merge
\r
1308 brought <emphasis>into</emphasis> the then-current branch.
\r
1318 Show recursive diffs.
\r
1328 Show the tree objects in the diff output. This implies <emphasis>-r</emphasis>.
\r
1338 Suppress diff output.
\r
1345 <simplesect id="_pretty_formats">
\r
1346 <title>PRETTY FORMATS</title>
\r
1347 <simpara>If the commit is a merge, and if the pretty-format
\r
1348 is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is
\r
1349 inserted before the <emphasis>Author:</emphasis> line. This line begins with
\r
1350 "Merge: " and the sha1s of ancestral commits are printed,
\r
1351 separated by spaces. Note that the listed commits may not
\r
1352 necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you
\r
1353 have limited your view of history: for example, if you are
\r
1354 only interested in changes related to a certain directory or
\r
1356 <simpara>There are several built-in formats, and you can define
\r
1357 additional formats by setting a pretty.<name>
\r
1358 config option to either another format name, or a
\r
1359 <emphasis>format:</emphasis> string, as described below (see
\r
1360 <xref linkend="git-config(1)" />). Here are the details of the
\r
1361 built-in formats:</simpara>
\r
1365 <emphasis>oneline</emphasis>
\r
1367 <literallayout class="monospaced"><sha1> <title line></literallayout>
\r
1368 <simpara>This is designed to be as compact as possible.</simpara>
\r
1372 <emphasis>short</emphasis>
\r
1374 <literallayout class="monospaced">commit <sha1>
\r
1375 Author: <author></literallayout>
\r
1376 <literallayout class="monospaced"><title line></literallayout>
\r
1380 <emphasis>medium</emphasis>
\r
1382 <literallayout class="monospaced">commit <sha1>
\r
1383 Author: <author>
\r
1384 Date: <author date></literallayout>
\r
1385 <literallayout class="monospaced"><title line></literallayout>
\r
1386 <literallayout class="monospaced"><full commit message></literallayout>
\r
1390 <emphasis>full</emphasis>
\r
1392 <literallayout class="monospaced">commit <sha1>
\r
1393 Author: <author>
\r
1394 Commit: <committer></literallayout>
\r
1395 <literallayout class="monospaced"><title line></literallayout>
\r
1396 <literallayout class="monospaced"><full commit message></literallayout>
\r
1400 <emphasis>fuller</emphasis>
\r
1402 <literallayout class="monospaced">commit <sha1>
\r
1403 Author: <author>
\r
1404 AuthorDate: <author date>
\r
1405 Commit: <committer>
\r
1406 CommitDate: <committer date></literallayout>
\r
1407 <literallayout class="monospaced"><title line></literallayout>
\r
1408 <literallayout class="monospaced"><full commit message></literallayout>
\r
1412 <emphasis>email</emphasis>
\r
1414 <literallayout class="monospaced">From <sha1> <date>
\r
1415 From: <author>
\r
1416 Date: <author date>
\r
1417 Subject: [PATCH] <title line></literallayout>
\r
1418 <literallayout class="monospaced"><full commit message></literallayout>
\r
1422 <emphasis>raw</emphasis>
\r
1424 <simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as
\r
1425 stored in the commit object. Notably, the SHA1s are
\r
1426 displayed in full, regardless of whether --abbrev or
\r
1427 --no-abbrev are used, and <emphasis>parents</emphasis> information show the
\r
1428 true parent commits, without taking grafts nor history
\r
1429 simplification into account.</simpara>
\r
1433 <emphasis>format:<string></emphasis>
\r
1435 <simpara>The <emphasis>format:<string></emphasis> format allows you to specify which information
\r
1436 you want to show. It works a little bit like printf format,
\r
1437 with the notable exception that you get a newline with <emphasis>%n</emphasis>
\r
1438 instead of <emphasis>\n</emphasis>.</simpara>
\r
1439 <simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</emphasis>
\r
1440 would show something like this:</simpara>
\r
1441 <screen>The author of fe6e0ee was Junio C Hamano, 23 hours ago
\r
1442 The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</screen>
\r
1443 <simpara>The placeholders are:</simpara>
\r
1447 <emphasis>%H</emphasis>: commit hash
\r
1452 <emphasis>%h</emphasis>: abbreviated commit hash
\r
1457 <emphasis>%T</emphasis>: tree hash
\r
1462 <emphasis>%t</emphasis>: abbreviated tree hash
\r
1467 <emphasis>%P</emphasis>: parent hashes
\r
1472 <emphasis>%p</emphasis>: abbreviated parent hashes
\r
1477 <emphasis>%an</emphasis>: author name
\r
1482 <emphasis>%aN</emphasis>: author name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1487 <emphasis>%ae</emphasis>: author email
\r
1492 <emphasis>%aE</emphasis>: author email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1497 <emphasis>%ad</emphasis>: author date (format respects --date= option)
\r
1502 <emphasis>%aD</emphasis>: author date, RFC2822 style
\r
1507 <emphasis>%ar</emphasis>: author date, relative
\r
1512 <emphasis>%at</emphasis>: author date, UNIX timestamp
\r
1517 <emphasis>%ai</emphasis>: author date, ISO 8601 format
\r
1522 <emphasis>%cn</emphasis>: committer name
\r
1527 <emphasis>%cN</emphasis>: committer name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1532 <emphasis>%ce</emphasis>: committer email
\r
1537 <emphasis>%cE</emphasis>: committer email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1542 <emphasis>%cd</emphasis>: committer date
\r
1547 <emphasis>%cD</emphasis>: committer date, RFC2822 style
\r
1552 <emphasis>%cr</emphasis>: committer date, relative
\r
1557 <emphasis>%ct</emphasis>: committer date, UNIX timestamp
\r
1562 <emphasis>%ci</emphasis>: committer date, ISO 8601 format
\r
1567 <emphasis>%d</emphasis>: ref names, like the --decorate option of <xref linkend="git-log(1)" />
\r
1572 <emphasis>%e</emphasis>: encoding
\r
1577 <emphasis>%s</emphasis>: subject
\r
1582 <emphasis>%f</emphasis>: sanitized subject line, suitable for a filename
\r
1587 <emphasis>%b</emphasis>: body
\r
1592 <emphasis>%B</emphasis>: raw body (unwrapped subject and body)
\r
1597 <emphasis>%N</emphasis>: commit notes
\r
1602 <emphasis>%gD</emphasis>: reflog selector, e.g., <emphasis>refs/stash@{1}</emphasis>
\r
1607 <emphasis>%gd</emphasis>: shortened reflog selector, e.g., <emphasis>stash@{1}</emphasis>
\r
1612 <emphasis>%gn</emphasis>: reflog identity name
\r
1617 <emphasis>%gN</emphasis>: reflog identity name (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1622 <emphasis>%ge</emphasis>: reflog identity email
\r
1627 <emphasis>%gE</emphasis>: reflog identity email (respecting .mailmap, see <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1632 <emphasis>%gs</emphasis>: reflog subject
\r
1637 <emphasis>%Cred</emphasis>: switch color to red
\r
1642 <emphasis>%Cgreen</emphasis>: switch color to green
\r
1647 <emphasis>%Cblue</emphasis>: switch color to blue
\r
1652 <emphasis>%Creset</emphasis>: reset color
\r
1657 <emphasis>%C(…)</emphasis>: color specification, as described in color.branch.* config option
\r
1662 <emphasis>%m</emphasis>: left, right or boundary mark
\r
1667 <emphasis>%n</emphasis>: newline
\r
1672 <emphasis>%%</emphasis>: a raw <emphasis>%</emphasis>
\r
1677 <emphasis>%x00</emphasis>: print a byte from a hex code
\r
1682 <emphasis>%w([<w>[,<i1>[,<i2>]]])</emphasis>: switch line wrapping, like the -w option of
\r
1683 <xref linkend="git-shortlog(1)" />.
\r
1689 <note><simpara>Some placeholders may depend on other options given to the
\r
1690 revision traversal engine. For example, the <emphasis>%g*</emphasis> reflog options will
\r
1691 insert an empty string unless we are traversing reflog entries (e.g., by
\r
1692 <emphasis>git log -g</emphasis>). The <emphasis>%d</emphasis> placeholder will use the "short" decoration
\r
1693 format if <emphasis>--decorate</emphasis> was not already provided on the command line.</simpara></note>
\r
1694 <simpara>If you add a <emphasis>+</emphasis> (plus sign) after <emphasis>%</emphasis> of a placeholder, a line-feed
\r
1695 is inserted immediately before the expansion if and only if the
\r
1696 placeholder expands to a non-empty string.</simpara>
\r
1697 <simpara>If you add a <emphasis>-</emphasis> (minus sign) after <emphasis>%</emphasis> of a placeholder, line-feeds that
\r
1698 immediately precede the expansion are deleted if and only if the
\r
1699 placeholder expands to an empty string.</simpara>
\r
1700 <simpara>If you add a ` ` (space) after <emphasis>%</emphasis> of a placeholder, a space
\r
1701 is inserted immediately before the expansion if and only if the
\r
1702 placeholder expands to a non-empty string.</simpara>
\r
1706 <emphasis>tformat:</emphasis>
\r
1708 <simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it
\r
1709 provides "terminator" semantics instead of "separator" semantics. In
\r
1710 other words, each commit has the message terminator character (usually a
\r
1711 newline) appended, rather than a separator placed between entries.
\r
1712 This means that the final entry of a single-line format will be properly
\r
1713 terminated with a new line, just as the "oneline" format does.
\r
1714 For example:</simpara>
\r
1715 <screen>$ git log -2 --pretty=format:%h 4da45bef \
\r
1716 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
\r
1718 7134973 -- NO NEWLINE
\r
1720 $ git log -2 --pretty=tformat:%h 4da45bef \
\r
1721 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
\r
1724 <simpara>In addition, any unrecognized string that has a <emphasis>%</emphasis> in it is interpreted
\r
1725 as if it has <emphasis>tformat:</emphasis> in front of it. For example, these two are
\r
1726 equivalent:</simpara>
\r
1727 <screen>$ git log -2 --pretty=tformat:%h 4da45bef
\r
1728 $ git log -2 --pretty=%h 4da45bef</screen>
\r
1732 <simplesect id="_common_diff_options">
\r
1733 <title>Common diff options</title>
\r
1747 Generate patch (see section on generating patches).
\r
1757 --unified=<n>
\r
1761 Generate diffs with <n> lines of context instead of
\r
1763 Implies <emphasis>-p</emphasis>.
\r
1773 Generate the raw format.
\r
1784 Synonym for <emphasis>-p --raw</emphasis>.
\r
1794 Spend extra time to make sure the smallest possible
\r
1805 Generate a diff using the "patience diff" algorithm.
\r
1815 Generate a diff using the "histogram diff" algorithm.
\r
1821 --stat[=<width>[,<name-width>[,<count>]]]
\r
1825 Generate a diffstat. By default, as much space as necessary
\r
1826 will be used for the filename part, and the rest for the graph
\r
1827 part. Maximum width defaults to terminal width, or 80 columns
\r
1828 if not connected to a terminal, and can be overriden by
\r
1829 <emphasis><width></emphasis>. The width of the filename part can be limited by
\r
1830 giving another width <emphasis><name-width></emphasis> after a comma. The width
\r
1831 of the graph part can be limited by using
\r
1832 <emphasis>--stat-graph-width=<width></emphasis> (affects all commands generating
\r
1833 a stat graph) or by setting <emphasis>diff.statGraphWidth=<width></emphasis>
\r
1834 (does not affect <emphasis>git format-patch</emphasis>).
\r
1835 By giving a third parameter <emphasis><count></emphasis>, you can limit the
\r
1836 output to the first <emphasis><count></emphasis> lines, followed by <emphasis>...</emphasis> if
\r
1839 <simpara>These parameters can also be set individually with <emphasis>--stat-width=<width></emphasis>,
\r
1840 <emphasis>--stat-name-width=<name-width></emphasis> and <emphasis>--stat-count=<count></emphasis>.</simpara>
\r
1849 Similar to <emphasis>--stat</emphasis>, but shows number of added and
\r
1850 deleted lines in decimal notation and pathname without
\r
1851 abbreviation, to make it more machine friendly. For
\r
1852 binary files, outputs two <emphasis>-</emphasis> instead of saying
\r
1853 <emphasis>0 0</emphasis>.
\r
1863 Output only the last line of the <emphasis>--stat</emphasis> format containing total
\r
1864 number of modified files, as well as number of added and deleted
\r
1871 --dirstat[=<param1,param2,…>]
\r
1875 Output the distribution of relative amount of changes for each
\r
1876 sub-directory. The behavior of <emphasis>--dirstat</emphasis> can be customized by
\r
1877 passing it a comma separated list of parameters.
\r
1878 The defaults are controlled by the <emphasis>diff.dirstat</emphasis> configuration
\r
1879 variable (see <xref linkend="git-config(1)" />).
\r
1880 The following parameters are available:
\r
1885 <emphasis>changes</emphasis>
\r
1889 Compute the dirstat numbers by counting the lines that have been
\r
1890 removed from the source, or added to the destination. This ignores
\r
1891 the amount of pure code movements within a file. In other words,
\r
1892 rearranging lines in a file is not counted as much as other changes.
\r
1893 This is the default behavior when no parameter is given.
\r
1899 <emphasis>lines</emphasis>
\r
1903 Compute the dirstat numbers by doing the regular line-based diff
\r
1904 analysis, and summing the removed/added line counts. (For binary
\r
1905 files, count 64-byte chunks instead, since binary files have no
\r
1906 natural concept of lines). This is a more expensive <emphasis>--dirstat</emphasis>
\r
1907 behavior than the <emphasis>changes</emphasis> behavior, but it does count rearranged
\r
1908 lines within a file as much as other changes. The resulting output
\r
1909 is consistent with what you get from the other <emphasis>--*stat</emphasis> options.
\r
1915 <emphasis>files</emphasis>
\r
1919 Compute the dirstat numbers by counting the number of files changed.
\r
1920 Each changed file counts equally in the dirstat analysis. This is
\r
1921 the computationally cheapest <emphasis>--dirstat</emphasis> behavior, since it does
\r
1922 not have to look at the file contents at all.
\r
1928 <emphasis>cumulative</emphasis>
\r
1932 Count changes in a child directory for the parent directory as well.
\r
1933 Note that when using <emphasis>cumulative</emphasis>, the sum of the percentages
\r
1934 reported may exceed 100%. The default (non-cumulative) behavior can
\r
1935 be specified with the <emphasis>noncumulative</emphasis> parameter.
\r
1945 An integer parameter specifies a cut-off percent (3% by default).
\r
1946 Directories contributing less than this percentage of the changes
\r
1947 are not shown in the output.
\r
1952 <simpara>Example: The following will count changed files, while ignoring
\r
1953 directories with less than 10% of the total amount of changed files,
\r
1954 and accumulating child directory counts in the parent directories:
\r
1955 <emphasis>--dirstat=files,10,cumulative</emphasis>.</simpara>
\r
1964 Output a condensed summary of extended header information
\r
1965 such as creations, renames and mode changes.
\r
1975 Synonym for <emphasis>-p --stat</emphasis>.
\r
1985 Separate the commits with NULs instead of with new newlines.
\r
1987 <simpara>Also, when <emphasis>--raw</emphasis> or <emphasis>--numstat</emphasis> has been given, do not munge
\r
1988 pathnames and use NULs as output field terminators.</simpara>
\r
1989 <simpara>Without this option, each pathname output will have TAB, LF, double quotes,
\r
1990 and backslash characters replaced with <emphasis>\t</emphasis>, <emphasis>\n</emphasis>, <emphasis>\"</emphasis>, and <emphasis>\\</emphasis>,
\r
1991 respectively, and the pathname will be enclosed in double quotes if
\r
1992 any of those replacements occurred.</simpara>
\r
2001 Show only names of changed files.
\r
2011 Show only names and status of changed files. See the description
\r
2012 of the <emphasis>--diff-filter</emphasis> option on what the status letters mean.
\r
2018 --submodule[=<format>]
\r
2022 Specify how differences in submodules are shown. When <emphasis>--submodule</emphasis>
\r
2023 or <emphasis>--submodule=log</emphasis> is given, the <emphasis>log</emphasis> format is used. This format lists
\r
2024 the commits in the range like <xref linkend="git-submodule(1)" /> <emphasis>summary</emphasis> does.
\r
2025 Omitting the <emphasis>--submodule</emphasis> option or specifying <emphasis>--submodule=short</emphasis>,
\r
2026 uses the <emphasis>short</emphasis> format. This format just shows the names of the commits
\r
2027 at the beginning and end of the range.
\r
2033 --color[=<when>]
\r
2037 Show colored diff.
\r
2038 The value must be <emphasis>always</emphasis> (the default for <emphasis><when></emphasis>), <emphasis>never</emphasis>, or <emphasis>auto</emphasis>.
\r
2039 The default value is <emphasis>never</emphasis>.
\r
2049 Turn off colored diff.
\r
2050 It is the same as <emphasis>--color=never</emphasis>.
\r
2056 --word-diff[=<mode>]
\r
2060 Show a word diff, using the <mode> to delimit changed words.
\r
2061 By default, words are delimited by whitespace; see
\r
2062 <emphasis>--word-diff-regex</emphasis> below. The <mode> defaults to <emphasis>plain</emphasis>, and
\r
2072 Highlight changed words using only colors. Implies <emphasis>--color</emphasis>.
\r
2082 Show words as <emphasis>[-removed-]</emphasis> and <emphasis>{+added+}</emphasis>. Makes no
\r
2083 attempts to escape the delimiters if they appear in the input,
\r
2084 so the output may be ambiguous.
\r
2094 Use a special line-based format intended for script
\r
2095 consumption. Added/removed/unchanged runs are printed in the
\r
2096 usual unified diff format, starting with a <emphasis>+</emphasis>/<emphasis>-</emphasis>/` `
\r
2097 character at the beginning of the line and extending to the
\r
2098 end of the line. Newlines in the input are represented by a
\r
2099 tilde <emphasis>~</emphasis> on a line of its own.
\r
2109 Disable word diff again.
\r
2114 <simpara>Note that despite the name of the first mode, color is used to
\r
2115 highlight the changed parts in all modes if enabled.</simpara>
\r
2120 --word-diff-regex=<regex>
\r
2124 Use <regex> to decide what a word is, instead of considering
\r
2125 runs of non-whitespace to be a word. Also implies
\r
2126 <emphasis>--word-diff</emphasis> unless it was already enabled.
\r
2128 <simpara>Every non-overlapping match of the
\r
2129 <regex> is considered a word. Anything between these matches is
\r
2130 considered whitespace and ignored(!) for the purposes of finding
\r
2131 differences. You may want to append <emphasis>|[^[:space:]]</emphasis> to your regular
\r
2132 expression to make sure that it matches all non-whitespace characters.
\r
2133 A match that contains a newline is silently truncated(!) at the
\r
2134 newline.</simpara>
\r
2135 <simpara>The regex can also be set via a diff driver or configuration option, see
\r
2136 <xref linkend="gitattributes(1)" /> or <xref linkend="git-config(1)" />. Giving it explicitly
\r
2137 overrides any diff driver or configuration setting. Diff drivers
\r
2138 override configuration settings.</simpara>
\r
2143 --color-words[=<regex>]
\r
2147 Equivalent to <emphasis>--word-diff=color</emphasis> plus (if a regex was
\r
2148 specified) <emphasis>--word-diff-regex=<regex></emphasis>.
\r
2158 Turn off rename detection, even when the configuration
\r
2159 file gives the default to do so.
\r
2169 Warn if changes introduce whitespace errors. What are
\r
2170 considered whitespace errors is controlled by <emphasis>core.whitespace</emphasis>
\r
2171 configuration. By default, trailing whitespaces (including
\r
2172 lines that solely consist of whitespaces) and a space character
\r
2173 that is immediately followed by a tab character inside the
\r
2174 initial indent of the line are considered whitespace errors.
\r
2175 Exits with non-zero status if problems are found. Not compatible
\r
2186 Instead of the first handful of characters, show the full
\r
2187 pre- and post-image blob object names on the "index"
\r
2188 line when generating patch format output.
\r
2198 In addition to <emphasis>--full-index</emphasis>, output a binary diff that
\r
2199 can be applied with <emphasis>git-apply</emphasis>.
\r
2205 --abbrev[=<n>]
\r
2209 Instead of showing the full 40-byte hexadecimal object
\r
2210 name in diff-raw format output and diff-tree header
\r
2211 lines, show only a partial prefix. This is
\r
2212 independent of the <emphasis>--full-index</emphasis> option above, which controls
\r
2213 the diff-patch output format. Non default number of
\r
2214 digits can be specified with <emphasis>--abbrev=<n></emphasis>.
\r
2220 -B[<n>][/<m>]
\r
2223 --break-rewrites[=[<n>][/<m>]]
\r
2227 Break complete rewrite changes into pairs of delete and
\r
2228 create. This serves two purposes:
\r
2230 <simpara>It affects the way a change that amounts to a total rewrite of a file
\r
2231 not as a series of deletion and insertion mixed together with a very
\r
2232 few lines that happen to match textually as the context, but as a
\r
2233 single deletion of everything old followed by a single insertion of
\r
2234 everything new, and the number <emphasis>m</emphasis> controls this aspect of the -B
\r
2235 option (defaults to 60%). <emphasis>-B/70%</emphasis> specifies that less than 30% of the
\r
2236 original should remain in the result for git to consider it a total
\r
2237 rewrite (i.e. otherwise the resulting patch will be a series of
\r
2238 deletion and insertion mixed together with context lines).</simpara>
\r
2239 <simpara>When used with -M, a totally-rewritten file is also considered as the
\r
2240 source of a rename (usually -M only considers a file that disappeared
\r
2241 as the source of a rename), and the number <emphasis>n</emphasis> controls this aspect of
\r
2242 the -B option (defaults to 50%). <emphasis>-B20%</emphasis> specifies that a change with
\r
2243 addition and deletion compared to 20% or more of the file's size are
\r
2244 eligible for being picked up as a possible source of a rename to
\r
2245 another file.</simpara>
\r
2253 --find-renames[=<n>]
\r
2257 If generating diffs, detect and report renames for each commit.
\r
2258 For following files across renames while traversing history, see
\r
2259 <emphasis>--follow</emphasis>.
\r
2260 If <emphasis>n</emphasis> is specified, it is a threshold on the similarity
\r
2261 index (i.e. amount of addition/deletions compared to the
\r
2262 file's size). For example, <emphasis>-M90%</emphasis> means git should consider a
\r
2263 delete/add pair to be a rename if more than 90% of the file
\r
2273 --find-copies[=<n>]
\r
2277 Detect copies as well as renames. See also <emphasis>--find-copies-harder</emphasis>.
\r
2278 If <emphasis>n</emphasis> is specified, it has the same meaning as for <emphasis>-M<n></emphasis>.
\r
2284 --find-copies-harder
\r
2288 For performance reasons, by default, <emphasis>-C</emphasis> option finds copies only
\r
2289 if the original file of the copy was modified in the same
\r
2290 changeset. This flag makes the command
\r
2291 inspect unmodified files as candidates for the source of
\r
2292 copy. This is a very expensive operation for large
\r
2293 projects, so use it with caution. Giving more than one
\r
2294 <emphasis>-C</emphasis> option has the same effect.
\r
2303 --irreversible-delete
\r
2307 Omit the preimage for deletes, i.e. print only the header but not
\r
2308 the diff between the preimage and <emphasis>/dev/null</emphasis>. The resulting patch
\r
2309 is not meant to be applied with <emphasis>patch</emphasis> nor <emphasis>git apply</emphasis>; this is
\r
2310 solely for people who want to just concentrate on reviewing the
\r
2311 text after the change. In addition, the output obviously lack
\r
2312 enough information to apply such a patch in reverse, even manually,
\r
2313 hence the name of the option.
\r
2315 <simpara>When used together with <emphasis>-B</emphasis>, omit also the preimage in the deletion part
\r
2316 of a delete/create pair.</simpara>
\r
2325 The <emphasis>-M</emphasis> and <emphasis>-C</emphasis> options require O(n^2) processing time where n
\r
2326 is the number of potential rename/copy targets. This
\r
2327 option prevents rename/copy detection from running if
\r
2328 the number of rename/copy targets exceeds the specified
\r
2335 --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]]
\r
2339 Select only files that are Added (<emphasis>A</emphasis>), Copied (<emphasis>C</emphasis>),
\r
2340 Deleted (<emphasis>D</emphasis>), Modified (<emphasis>M</emphasis>), Renamed (<emphasis>R</emphasis>), have their
\r
2341 type (i.e. regular file, symlink, submodule, …) changed (<emphasis>T</emphasis>),
\r
2342 are Unmerged (<emphasis>U</emphasis>), are
\r
2343 Unknown (<emphasis>X</emphasis>), or have had their pairing Broken (<emphasis>B</emphasis>).
\r
2344 Any combination of the filter characters (including none) can be used.
\r
2345 When <emphasis>*</emphasis> (All-or-none) is added to the combination, all
\r
2346 paths are selected if there is any file that matches
\r
2347 other criteria in the comparison; if there is no file
\r
2348 that matches other criteria, nothing is selected.
\r
2358 Look for differences that introduce or remove an instance of
\r
2359 <string>. Note that this is different than the string simply
\r
2360 appearing in diff output; see the <emphasis>pickaxe</emphasis> entry in
\r
2361 <xref linkend="gitdiffcore(7)" /> for more details.
\r
2371 Look for differences whose added or removed line matches
\r
2372 the given <regex>.
\r
2382 When <emphasis>-S</emphasis> or <emphasis>-G</emphasis> finds a change, show all the changes in that
\r
2383 changeset, not just the files that contain the change
\r
2384 in <string>.
\r
2394 Make the <string> not a plain string but an extended POSIX
\r
2401 -O<orderfile>
\r
2405 Output the patch in the order specified in the
\r
2406 <orderfile>, which has one shell glob pattern per line.
\r
2416 Swap two inputs; that is, show differences from index or
\r
2417 on-disk file to tree contents.
\r
2423 --relative[=<path>]
\r
2427 When run from a subdirectory of the project, it can be
\r
2428 told to exclude changes outside the directory and show
\r
2429 pathnames relative to it with this option. When you are
\r
2430 not in a subdirectory (e.g. in a bare repository), you
\r
2431 can name which subdirectory to make the output relative
\r
2432 to by giving a <path> as an argument.
\r
2445 Treat all files as text.
\r
2451 --ignore-space-at-eol
\r
2455 Ignore changes in whitespace at EOL.
\r
2464 --ignore-space-change
\r
2468 Ignore changes in amount of whitespace. This ignores whitespace
\r
2469 at line end, and considers all other sequences of one or
\r
2470 more whitespace characters to be equivalent.
\r
2479 --ignore-all-space
\r
2483 Ignore whitespace when comparing lines. This ignores
\r
2484 differences even if one line has whitespace where the other
\r
2491 --inter-hunk-context=<lines>
\r
2495 Show the context between diff hunks, up to the specified number
\r
2496 of lines, thereby fusing hunks that are close to each other.
\r
2505 --function-context
\r
2509 Show whole surrounding functions of changes.
\r
2519 Allow an external diff helper to be executed. If you set an
\r
2520 external diff driver with <xref linkend="gitattributes(5)" />, you need
\r
2521 to use this option with <xref linkend="git-log(1)" /> and friends.
\r
2531 Disallow external diff drivers.
\r
2544 Allow (or disallow) external text conversion filters to be run
\r
2545 when comparing binary files. See <xref linkend="gitattributes(5)" /> for
\r
2546 details. Because textconv filters are typically a one-way
\r
2547 conversion, the resulting diff is suitable for human
\r
2548 consumption, but cannot be applied. For this reason, textconv
\r
2549 filters are enabled by default only for <xref linkend="git-diff(1)" /> and
\r
2550 <xref linkend="git-log(1)" />, but not for <xref linkend="git-format-patch(1)" /> or
\r
2551 diff plumbing commands.
\r
2557 --ignore-submodules[=<when>]
\r
2561 Ignore changes to submodules in the diff generation. <when> can be
\r
2562 either "none", "untracked", "dirty" or "all", which is the default
\r
2563 Using "none" will consider the submodule modified when it either contains
\r
2564 untracked or modified files or its HEAD differs from the commit recorded
\r
2565 in the superproject and can be used to override any settings of the
\r
2566 <emphasis>ignore</emphasis> option in <xref linkend="git-config(1)" /> or <xref linkend="gitmodules(5)" />. When
\r
2567 "untracked" is used submodules are not considered dirty when they only
\r
2568 contain untracked content (but they are still scanned for modified
\r
2569 content). Using "dirty" ignores all changes to the work tree of submodules,
\r
2570 only changes to the commits stored in the superproject are shown (this was
\r
2571 the behavior until 1.7.0). Using "all" hides all changes to submodules.
\r
2577 --src-prefix=<prefix>
\r
2581 Show the given source prefix instead of "a/".
\r
2587 --dst-prefix=<prefix>
\r
2591 Show the given destination prefix instead of "b/".
\r
2601 Do not show any source or destination prefix.
\r
2606 <simpara>For more detailed explanation on these common options, see also
\r
2607 <xref linkend="gitdiffcore(7)" />.</simpara>
\r
2609 <simplesect id="_generating_patches_with_p">
\r
2610 <title>Generating patches with -p</title>
\r
2611 <simpara>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
\r
2612 with a <emphasis>-p</emphasis> option, "git diff" without the <emphasis>--raw</emphasis> option, or
\r
2613 "git log" with the "-p" option, they
\r
2614 do not produce the output described above; instead they produce a
\r
2615 patch file. You can customize the creation of such patches via the
\r
2616 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</simpara>
\r
2617 <simpara>What the -p option produces is slightly different from the traditional
\r
2618 diff format:</simpara>
\r
2619 <orderedlist numeration="arabic">
\r
2622 It is preceded with a "git diff" header that looks like this:
\r
2624 <literallayout class="monospaced">diff --git a/file1 b/file2</literallayout>
\r
2625 <simpara>The <emphasis>a/</emphasis> and <emphasis>b/</emphasis> filenames are the same unless rename/copy is
\r
2626 involved. Especially, even for a creation or a deletion,
\r
2627 <emphasis>/dev/null</emphasis> is <emphasis>not</emphasis> used in place of the <emphasis>a/</emphasis> or <emphasis>b/</emphasis> filenames.</simpara>
\r
2628 <simpara>When rename/copy is involved, <emphasis>file1</emphasis> and <emphasis>file2</emphasis> show the
\r
2629 name of the source file of the rename/copy and the name of
\r
2630 the file that rename/copy produces, respectively.</simpara>
\r
2634 It is followed by one or more extended header lines:
\r
2636 <literallayout class="monospaced">old mode <mode>
\r
2637 new mode <mode>
\r
2638 deleted file mode <mode>
\r
2639 new file mode <mode>
\r
2640 copy from <path>
\r
2641 copy to <path>
\r
2642 rename from <path>
\r
2643 rename to <path>
\r
2644 similarity index <number>
\r
2645 dissimilarity index <number>
\r
2646 index <hash>..<hash> <mode></literallayout>
\r
2647 <simpara>File modes are printed as 6-digit octal numbers including the file type
\r
2648 and file permission bits.</simpara>
\r
2649 <simpara>Path names in extended headers do not include the <emphasis>a/</emphasis> and <emphasis>b/</emphasis> prefixes.</simpara>
\r
2650 <simpara>The similarity index is the percentage of unchanged lines, and
\r
2651 the dissimilarity index is the percentage of changed lines. It
\r
2652 is a rounded down integer, followed by a percent sign. The
\r
2653 similarity index value of 100% is thus reserved for two equal
\r
2654 files, while 100% dissimilarity means that no line from the old
\r
2655 file made it into the new one.</simpara>
\r
2656 <simpara>The index line includes the SHA-1 checksum before and after the change.
\r
2657 The <mode> is included if the file mode does not change; otherwise,
\r
2658 separate lines indicate the old and the new mode.</simpara>
\r
2662 TAB, LF, double quote and backslash characters in pathnames
\r
2663 are represented as <emphasis>\t</emphasis>, <emphasis>\n</emphasis>, <emphasis>\"</emphasis> and <emphasis>\\</emphasis>, respectively.
\r
2664 If there is need for such substitution then the whole
\r
2665 pathname is put in double quotes.
\r
2670 All the <emphasis>file1</emphasis> files in the output refer to files before the
\r
2671 commit, and all the <emphasis>file2</emphasis> files refer to files after the commit.
\r
2672 It is incorrect to apply each change to each file sequentially. For
\r
2673 example, this patch will swap a and b:
\r
2675 <literallayout class="monospaced">diff --git a/a b/b
\r
2678 diff --git a/b b/a
\r
2680 rename to a</literallayout>
\r
2684 <simplesect id="_combined_diff_format">
\r
2685 <title>combined diff format</title>
\r
2686 <simpara>Any diff-generating command can take the -c` or <emphasis>--cc</emphasis> option to
\r
2687 produce a <emphasis>combined diff</emphasis> when showing a merge. This is the default
\r
2688 format when showing merges with <xref linkend="git-diff(1)" /> or
\r
2689 <xref linkend="git-show(1)" />. Note also that you can give the `-m option to any
\r
2690 of these commands to force generation of diffs with individual parents
\r
2691 of a merge.</simpara>
\r
2692 <simpara>A <emphasis>combined diff</emphasis> format looks like this:</simpara>
\r
2693 <screen>diff --combined describe.c
\r
2694 index fabadb8,cc95eb0..4866510
\r
2697 @@@ -98,20 -98,12 +98,20 @@@
\r
2698 return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
\r
2701 - static void describe(char *arg)
\r
2702 -static void describe(struct commit *cmit, int last_one)
\r
2703 ++static void describe(char *arg, int last_one)
\r
2705 + unsigned char sha1[20];
\r
2706 + struct commit *cmit;
\r
2707 struct commit_list *list;
\r
2708 static int initialized = 0;
\r
2709 struct commit_name *n;
\r
2711 + if (get_sha1(arg, sha1) < 0)
\r
2712 + usage(describe_usage);
\r
2713 + cmit = lookup_commit_reference(sha1);
\r
2715 + usage(describe_usage);
\r
2717 if (!initialized) {
\r
2719 for_each_ref(get_name);</screen>
\r
2720 <orderedlist numeration="arabic">
\r
2723 It is preceded with a "git diff" header, that looks like
\r
2724 this (when <emphasis>-c</emphasis> option is used):
\r
2726 <literallayout class="monospaced">diff --combined file</literallayout>
\r
2727 <simpara>or like this (when <emphasis>--cc</emphasis> option is used):</simpara>
\r
2728 <literallayout class="monospaced">diff --cc file</literallayout>
\r
2732 It is followed by one or more extended header lines
\r
2733 (this example shows a merge with two parents):
\r
2735 <literallayout class="monospaced">index <hash>,<hash>..<hash>
\r
2736 mode <mode>,<mode>..<mode>
\r
2737 new file mode <mode>
\r
2738 deleted file mode <mode>,<mode></literallayout>
\r
2739 <simpara>The <emphasis>mode <mode>,<mode>..<mode></emphasis> line appears only if at least one of
\r
2740 the <mode> is different from the rest. Extended headers with
\r
2741 information about detected contents movement (renames and
\r
2742 copying detection) are designed to work with diff of two
\r
2743 <tree-ish> and are not used by combined diff format.</simpara>
\r
2747 It is followed by two-line from-file/to-file header
\r
2749 <literallayout class="monospaced">--- a/file
\r
2750 +++ b/file</literallayout>
\r
2751 <simpara>Similar to two-line header for traditional <emphasis>unified</emphasis> diff
\r
2752 format, <emphasis>/dev/null</emphasis> is used to signal created or deleted
\r
2757 Chunk header format is modified to prevent people from
\r
2758 accidentally feeding it to <emphasis>patch -p1</emphasis>. Combined diff format
\r
2759 was created for review of merge commit changes, and was not
\r
2760 meant for apply. The change is similar to the change in the
\r
2761 extended <emphasis>index</emphasis> header:
\r
2763 <literallayout class="monospaced">@@@ <from-file-range> <from-file-range> <to-file-range> @@@</literallayout>
\r
2764 <simpara>There are (number of parents + 1) <emphasis>@</emphasis> characters in the chunk
\r
2765 header for combined diff format.</simpara>
\r
2768 <simpara>Unlike the traditional <emphasis>unified</emphasis> diff format, which shows two
\r
2769 files A and B with a single column that has <emphasis>-</emphasis> (minus --
\r
2770 appears in A but removed in B), <emphasis>+</emphasis> (plus -- missing in A but
\r
2771 added to B), or <emphasis>" "</emphasis> (space -- unchanged) prefix, this format
\r
2772 compares two or more files file1, file2,… with one file X, and
\r
2773 shows how X differs from each of fileN. One column for each of
\r
2774 fileN is prepended to the output line to note how X's line is
\r
2775 different from it.</simpara>
\r
2776 <simpara>A <emphasis>-</emphasis> character in the column N means that the line appears in
\r
2777 fileN but it does not appear in the result. A <emphasis>+</emphasis> character
\r
2778 in the column N means that the line appears in the result,
\r
2779 and fileN does not have that line (in other words, the line was
\r
2780 added, from the point of view of that parent).</simpara>
\r
2781 <simpara>In the above example output, the function signature was changed
\r
2782 from both files (hence two <emphasis>-</emphasis> removals from both file1 and
\r
2783 file2, plus <emphasis>++</emphasis> to mean one line that was added does not appear
\r
2784 in either file1 nor file2). Also eight other lines are the same
\r
2785 from file1 but do not appear in file2 (hence prefixed with <emphasis>+</emphasis>).</simpara>
\r
2786 <simpara>When shown by <emphasis>git diff-tree -c</emphasis>, it compares the parents of a
\r
2787 merge commit with the merge result (i.e. file1..fileN are the
\r
2788 parents). When shown by <emphasis>git diff-files -c</emphasis>, it compares the
\r
2789 two unresolved merge parents with the working tree file
\r
2790 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
\r
2791 "their version").</simpara>
\r
2793 <simplesect id="_examples">
\r
2794 <title>Examples</title>
\r
2798 <emphasis>git log --no-merges</emphasis>
\r
2802 Show the whole commit history, but skip any merges
\r
2808 <emphasis>git log v2.6.12.. include/scsi drivers/scsi</emphasis>
\r
2812 Show all commits since version <emphasis>v2.6.12</emphasis> that changed any file
\r
2813 in the include/scsi or drivers/scsi subdirectories
\r
2819 <emphasis>git log --since="2 weeks ago" -- gitk</emphasis>
\r
2823 Show the changes during the last two weeks to the file <emphasis>gitk</emphasis>.
\r
2824 The "--" is necessary to avoid confusion with the <emphasis role="strong">branch</emphasis> named
\r
2825 <emphasis>gitk</emphasis>
\r
2831 <emphasis>git log --name-status release..test</emphasis>
\r
2835 Show the commits that are in the "test" branch but not yet
\r
2836 in the "release" branch, along with the list of paths
\r
2837 each commit modifies.
\r
2843 <emphasis>git log --follow builtin-rev-list.c</emphasis>
\r
2847 Shows the commits that changed builtin-rev-list.c, including
\r
2848 those commits that occurred before the file was given its
\r
2855 <emphasis>git log --branches --not --remotes=origin</emphasis>
\r
2859 Shows all commits that are in any of local branches but not in
\r
2860 any of remote-tracking branches for <emphasis>origin</emphasis> (what you have that
\r
2867 <emphasis>git log master --not --remotes=*/master</emphasis>
\r
2871 Shows all commits that are in local master but not in any remote
\r
2872 repository master branches.
\r
2878 <emphasis>git log -p -m --first-parent</emphasis>
\r
2882 Shows the history including change diffs, but only from the
\r
2883 "main branch" perspective, skipping commits that come from merged
\r
2884 branches, and showing full diffs of changes introduced by the merges.
\r
2885 This makes sense only when following a strict policy of merging all
\r
2886 topic branches when staying on a single integration branch.
\r
2892 <simplesect id="_discussion">
\r
2893 <title>Discussion</title>
\r
2894 <simpara>At the core level, git is character encoding agnostic.</simpara>
\r
2898 The pathnames recorded in the index and in the tree objects
\r
2899 are treated as uninterpreted sequences of non-NUL bytes.
\r
2900 What readdir(2) returns are what are recorded and compared
\r
2901 with the data git keeps track of, which in turn are expected
\r
2902 to be what lstat(2) and creat(2) accepts. There is no such
\r
2903 thing as pathname encoding translation.
\r
2908 The contents of the blob objects are uninterpreted sequences
\r
2909 of bytes. There is no encoding translation at the core
\r
2915 The commit log messages are uninterpreted sequences of non-NUL
\r
2920 <simpara>Although we encourage that the commit log messages are encoded
\r
2921 in UTF-8, both the core and git Porcelain are designed not to
\r
2922 force UTF-8 on projects. If all participants of a particular
\r
2923 project find it more convenient to use legacy encodings, git
\r
2924 does not forbid it. However, there are a few things to keep in
\r
2926 <orderedlist numeration="arabic">
\r
2929 <emphasis>git commit</emphasis> and <emphasis>git commit-tree</emphasis> issues
\r
2930 a warning if the commit log message given to it does not look
\r
2931 like a valid UTF-8 string, unless you explicitly say your
\r
2932 project uses a legacy encoding. The way to say this is to
\r
2933 have i18n.commitencoding in <emphasis>.git/config</emphasis> file, like this:
\r
2936 commitencoding = ISO-8859-1</screen>
\r
2937 <simpara>Commit objects created with the above setting record the value
\r
2938 of <emphasis>i18n.commitencoding</emphasis> in its <emphasis>encoding</emphasis> header. This is to
\r
2939 help other people who look at them later. Lack of this header
\r
2940 implies that the commit log message is encoded in UTF-8.</simpara>
\r
2944 <emphasis>git log</emphasis>, <emphasis>git show</emphasis>, <emphasis>git blame</emphasis> and friends look at the
\r
2945 <emphasis>encoding</emphasis> header of a commit object, and try to re-code the
\r
2946 log message into UTF-8 unless otherwise specified. You can
\r
2947 specify the desired output encoding with
\r
2948 <emphasis>i18n.logoutputencoding</emphasis> in <emphasis>.git/config</emphasis> file, like this:
\r
2951 logoutputencoding = ISO-8859-1</screen>
\r
2952 <simpara>If you do not have this configuration variable, the value of
\r
2953 <emphasis>i18n.commitencoding</emphasis> is used instead.</simpara>
\r
2956 <simpara>Note that we deliberately chose not to re-code the commit log
\r
2957 message when a commit is made to force UTF-8 at the commit
\r
2958 object level, because re-coding to UTF-8 is not necessarily a
\r
2959 reversible operation.</simpara>
\r
2961 <simplesect id="_configuration">
\r
2962 <title>Configuration</title>
\r
2963 <simpara>See <xref linkend="git-config(1)" /> for core variables and <xref linkend="git-diff(1)" />
\r
2964 for settings related to diff generation.</simpara>
\r
2972 Default for the <emphasis>--format</emphasis> option. (See "PRETTY FORMATS" above.)
\r
2973 Defaults to "medium".
\r
2979 i18n.logOutputEncoding
\r
2983 Encoding to use when displaying logs. (See "Discussion", above.)
\r
2984 Defaults to the value of <emphasis>i18n.commitEncoding</emphasis> if set, UTF-8
\r
2995 Default format for human-readable dates. (Compare the
\r
2996 <emphasis>--date</emphasis> option.) Defaults to "default", which means to write
\r
2997 dates like <emphasis>Sat May 8 19:35:34 2010 -0500</emphasis>.
\r
3007 If <emphasis>false</emphasis>, <emphasis>git log</emphasis> and related commands will not treat the
\r
3008 initial commit as a big creation event. Any root commits in
\r
3009 <emphasis>git log -p</emphasis> output would be shown without a diff attached.
\r
3010 The default is <emphasis>true</emphasis>.
\r
3020 See <xref linkend="git-shortlog(1)" />.
\r
3030 Which refs, in addition to the default set by <emphasis>core.notesRef</emphasis>
\r
3031 or <emphasis>GIT_NOTES_REF</emphasis>, to read notes from when showing commit
\r
3032 messages with the <emphasis>log</emphasis> family of commands. See
\r
3033 <xref linkend="git-notes(1)" />.
\r
3035 <simpara>May be an unabbreviated ref name or a glob and may be specified
\r
3036 multiple times. A warning will be issued for refs that do not exist,
\r
3037 but a glob that does not match any refs is silently ignored.</simpara>
\r
3038 <simpara>This setting can be disabled by the <emphasis>--no-notes</emphasis> option,
\r
3039 overridden by the <emphasis>GIT_NOTES_DISPLAY_REF</emphasis> environment variable,
\r
3040 and overridden by the <emphasis>--notes=<ref></emphasis> option.</simpara>
\r
3045 <simplesect id="_git">
\r
3046 <title>GIT</title>
\r
3047 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r