Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"/> |
| 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge"/> |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |
| 7 | <meta name="generator" content="Asciidoctor 2.0.20"/> |
| 8 | <title>git-diff-tree(1)</title> |
| 9 | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/> |
| 10 | <style> |
| 11 | /*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */ |
| 12 | /* Uncomment the following line when using as a custom stylesheet */ |
| 13 | /* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */ |
| 14 | html{font-family:sans-serif;-webkit-text-size-adjust:100%} |
| 15 | a{background:none} |
| 16 | a:focus{outline:thin dotted} |
| 17 | a:active,a:hover{outline:0} |
| 18 | h1{font-size:2em;margin:.67em 0} |
| 19 | b,strong{font-weight:bold} |
| 20 | abbr{font-size:.9em} |
| 21 | abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none} |
| 22 | dfn{font-style:italic} |
| 23 | hr{height:0} |
| 24 | mark{background:#ff0;color:#000} |
| 25 | code,kbd,pre,samp{font-family:monospace;font-size:1em} |
| 26 | pre{white-space:pre-wrap} |
| 27 | q{quotes:"\201C" "\201D" "\2018" "\2019"} |
| 28 | small{font-size:80%} |
| 29 | sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} |
| 30 | sup{top:-.5em} |
| 31 | sub{bottom:-.25em} |
| 32 | img{border:0} |
| 33 | svg:not(:root){overflow:hidden} |
| 34 | figure{margin:0} |
| 35 | audio,video{display:inline-block} |
| 36 | audio:not([controls]){display:none;height:0} |
| 37 | fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em} |
| 38 | legend{border:0;padding:0} |
| 39 | button,input,select,textarea{font-family:inherit;font-size:100%;margin:0} |
| 40 | button,input{line-height:normal} |
| 41 | button,select{text-transform:none} |
| 42 | button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer} |
| 43 | button[disabled],html input[disabled]{cursor:default} |
| 44 | input[type=checkbox],input[type=radio]{padding:0} |
| 45 | button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} |
| 46 | textarea{overflow:auto;vertical-align:top} |
| 47 | table{border-collapse:collapse;border-spacing:0} |
| 48 | *,::before,::after{box-sizing:border-box} |
| 49 | html,body{font-size:100%} |
| 50 | body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased} |
| 51 | a:hover{cursor:pointer} |
| 52 | img,object,embed{max-width:100%;height:auto} |
| 53 | object,embed{height:100%} |
| 54 | img{-ms-interpolation-mode:bicubic} |
| 55 | .left{float:left!important} |
| 56 | .right{float:right!important} |
| 57 | .text-left{text-align:left!important} |
| 58 | .text-right{text-align:right!important} |
| 59 | .text-center{text-align:center!important} |
| 60 | .text-justify{text-align:justify!important} |
| 61 | .hide{display:none} |
| 62 | img,object,svg{display:inline-block;vertical-align:middle} |
| 63 | textarea{height:auto;min-height:50px} |
| 64 | select{width:100%} |
| 65 | .subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em} |
| 66 | div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0} |
| 67 | a{color:#2156a5;text-decoration:underline;line-height:inherit} |
| 68 | a:hover,a:focus{color:#1d4b8f} |
| 69 | a img{border:0} |
| 70 | p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility} |
| 71 | p aside{font-size:.875em;line-height:1.35;font-style:italic} |
| 72 | h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em} |
| 73 | h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0} |
| 74 | h1{font-size:2.125em} |
| 75 | h2{font-size:1.6875em} |
| 76 | h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em} |
| 77 | h4,h5{font-size:1.125em} |
| 78 | h6{font-size:1em} |
| 79 | hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em} |
| 80 | em,i{font-style:italic;line-height:inherit} |
| 81 | strong,b{font-weight:bold;line-height:inherit} |
| 82 | small{font-size:60%;line-height:inherit} |
| 83 | code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)} |
| 84 | ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit} |
| 85 | ul,ol{margin-left:1.5em} |
| 86 | ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0} |
| 87 | ul.circle{list-style-type:circle} |
| 88 | ul.disc{list-style-type:disc} |
| 89 | ul.square{list-style-type:square} |
| 90 | ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit} |
| 91 | ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0} |
| 92 | dl dt{margin-bottom:.3125em;font-weight:bold} |
| 93 | dl dd{margin-bottom:1.25em} |
| 94 | blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd} |
| 95 | blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)} |
| 96 | @media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2} |
| 97 | h1{font-size:2.75em} |
| 98 | h2{font-size:2.3125em} |
| 99 | h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em} |
| 100 | h4{font-size:1.4375em}} |
| 101 | table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal} |
| 102 | table thead,table tfoot{background:#f7f8f7} |
| 103 | table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left} |
| 104 | table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)} |
| 105 | table tr.even,table tr.alt{background:#f8f8f7} |
| 106 | table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6} |
| 107 | h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em} |
| 108 | h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400} |
| 109 | .center{margin-left:auto;margin-right:auto} |
| 110 | .stretch{width:100%} |
| 111 | .clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table} |
| 112 | .clearfix::after,.float-group::after{clear:both} |
| 113 | :not(pre).nobreak{word-wrap:normal} |
| 114 | :not(pre).nowrap{white-space:nowrap} |
| 115 | :not(pre).pre-wrap{white-space:pre-wrap} |
| 116 | :not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed} |
| 117 | pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed} |
| 118 | pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit} |
| 119 | pre>code{display:block} |
| 120 | pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal} |
| 121 | em em{font-style:normal} |
| 122 | strong strong{font-weight:400} |
| 123 | .keyseq{color:rgba(51,51,51,.8)} |
| 124 | kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap} |
| 125 | .keyseq kbd:first-child{margin-left:0} |
| 126 | .keyseq kbd:last-child{margin-right:0} |
| 127 | .menuseq,.menuref{color:#000} |
| 128 | .menuseq b:not(.caret),.menuref{font-weight:inherit} |
| 129 | .menuseq{word-spacing:-.02em} |
| 130 | .menuseq b.caret{font-size:1.25em;line-height:.8} |
| 131 | .menuseq i.caret{font-weight:bold;text-align:center;width:.45em} |
| 132 | b.button::before,b.button::after{position:relative;top:-1px;font-weight:400} |
| 133 | b.button::before{content:"[";padding:0 3px 0 2px} |
| 134 | b.button::after{content:"]";padding:0 2px 0 3px} |
| 135 | p a>code:hover{color:rgba(0,0,0,.9)} |
| 136 | #header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em} |
| 137 | #header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table} |
| 138 | #header::after,#content::after,#footnotes::after,#footer::after{clear:both} |
| 139 | #content{margin-top:1.25em} |
| 140 | #content::before{content:none} |
| 141 | #header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0} |
| 142 | #header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf} |
| 143 | #header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px} |
| 144 | #header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap} |
| 145 | #header .details span:first-child{margin-left:-.125em} |
| 146 | #header .details span.email a{color:rgba(0,0,0,.85)} |
| 147 | #header .details br{display:none} |
| 148 | #header .details br+span::before{content:"\00a0\2013\00a0"} |
| 149 | #header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)} |
| 150 | #header .details br+span#revremark::before{content:"\00a0|\00a0"} |
| 151 | #header #revnumber{text-transform:capitalize} |
| 152 | #header #revnumber::after{content:"\00a0"} |
| 153 | #content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem} |
| 154 | #toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em} |
| 155 | #toc>ul{margin-left:.125em} |
| 156 | #toc ul.sectlevel0>li>a{font-style:italic} |
| 157 | #toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0} |
| 158 | #toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none} |
| 159 | #toc li{line-height:1.3334;margin-top:.3334em} |
| 160 | #toc a{text-decoration:none} |
| 161 | #toc a:active{text-decoration:underline} |
| 162 | #toctitle{color:#7a2518;font-size:1.2em} |
| 163 | @media screen and (min-width:768px){#toctitle{font-size:1.375em} |
| 164 | body.toc2{padding-left:15em;padding-right:0} |
| 165 | #toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto} |
| 166 | #toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em} |
| 167 | #toc.toc2>ul{font-size:.9em;margin-bottom:0} |
| 168 | #toc.toc2 ul ul{margin-left:0;padding-left:1em} |
| 169 | #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em} |
| 170 | body.toc2.toc-right{padding-left:0;padding-right:15em} |
| 171 | body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}} |
| 172 | @media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0} |
| 173 | #toc.toc2{width:20em} |
| 174 | #toc.toc2 #toctitle{font-size:1.375em} |
| 175 | #toc.toc2>ul{font-size:.95em} |
| 176 | #toc.toc2 ul ul{padding-left:1.25em} |
| 177 | body.toc2.toc-right{padding-left:0;padding-right:20em}} |
| 178 | #content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px} |
| 179 | #content #toc>:first-child{margin-top:0} |
| 180 | #content #toc>:last-child{margin-bottom:0} |
| 181 | #footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em} |
| 182 | #footer-text{color:hsla(0,0%,100%,.8);line-height:1.44} |
| 183 | #content{margin-bottom:.625em} |
| 184 | .sect1{padding-bottom:.625em} |
| 185 | @media screen and (min-width:768px){#content{margin-bottom:1.25em} |
| 186 | .sect1{padding-bottom:1.25em}} |
| 187 | .sect1:last-child{padding-bottom:0} |
| 188 | .sect1+.sect1{border-top:1px solid #e7e7e9} |
| 189 | #content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400} |
| 190 | #content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em} |
| 191 | #content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible} |
| 192 | #content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none} |
| 193 | #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221} |
| 194 | details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em} |
| 195 | details{margin-left:1.25rem} |
| 196 | details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent} |
| 197 | details>summary::-webkit-details-marker{display:none} |
| 198 | details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)} |
| 199 | details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)} |
| 200 | details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem} |
| 201 | .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic} |
| 202 | table.tableblock.fit-content>caption.title{white-space:nowrap;width:0} |
| 203 | .paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)} |
| 204 | .admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%} |
| 205 | .admonitionblock>table td.icon{text-align:center;width:80px} |
| 206 | .admonitionblock>table td.icon img{max-width:none} |
| 207 | .admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase} |
| 208 | .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere} |
| 209 | .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0} |
| 210 | .exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px} |
| 211 | .sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px} |
| 212 | .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center} |
| 213 | .exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0} |
| 214 | .exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0} |
| 215 | .literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em} |
| 216 | @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}} |
| 217 | @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}} |
| 218 | .literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8} |
| 219 | .literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)} |
| 220 | .listingblock>.content{position:relative} |
| 221 | .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5} |
| 222 | .listingblock:hover code[data-lang]::before{display:block} |
| 223 | .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5} |
| 224 | .listingblock.terminal pre .command:not([data-prompt])::before{content:"$"} |
| 225 | .listingblock pre.highlightjs{padding:0} |
| 226 | .listingblock pre.highlightjs>code{padding:1em;border-radius:4px} |
| 227 | .listingblock pre.prettyprint{border-width:0} |
| 228 | .prettyprint{background:#f7f7f8} |
| 229 | pre.prettyprint .linenums{line-height:1.45;margin-left:2em} |
| 230 | pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0} |
| 231 | pre.prettyprint li code[data-lang]::before{opacity:1} |
| 232 | pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none} |
| 233 | table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none} |
| 234 | table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal} |
| 235 | table.linenotable td.code{padding-left:.75em} |
| 236 | table.linenotable td.linenos,pre.pygments .linenos{border-right:1px solid;opacity:.35;padding-right:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} |
| 237 | pre.pygments span.linenos{display:inline-block;margin-right:.75em} |
| 238 | .quoteblock{margin:0 1em 1.25em 1.5em;display:table} |
| 239 | .quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em} |
| 240 | .quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify} |
| 241 | .quoteblock blockquote{margin:0;padding:0;border:0} |
| 242 | .quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)} |
| 243 | .quoteblock blockquote>.paragraph:last-child p{margin-bottom:0} |
| 244 | .quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right} |
| 245 | .verseblock{margin:0 1em 1.25em} |
| 246 | .verseblock pre{font-family:"Open Sans","DejaVu Sans",sans-serif;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility} |
| 247 | .verseblock pre strong{font-weight:400} |
| 248 | .verseblock .attribution{margin-top:1.25rem;margin-left:.5ex} |
| 249 | .quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic} |
| 250 | .quoteblock .attribution br,.verseblock .attribution br{display:none} |
| 251 | .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)} |
| 252 | .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none} |
| 253 | .quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0} |
| 254 | .quoteblock.abstract{margin:0 1em 1.25em;display:block} |
| 255 | .quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center} |
| 256 | .quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf} |
| 257 | .quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0} |
| 258 | .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem} |
| 259 | .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0} |
| 260 | p.tableblock:last-child{margin-bottom:0} |
| 261 | td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere} |
| 262 | td.tableblock>.content>:last-child{margin-bottom:-1.25em} |
| 263 | table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede} |
| 264 | table.grid-all>*>tr>*{border-width:1px} |
| 265 | table.grid-cols>*>tr>*{border-width:0 1px} |
| 266 | table.grid-rows>*>tr>*{border-width:1px 0} |
| 267 | table.frame-all{border-width:1px} |
| 268 | table.frame-ends{border-width:1px 0} |
| 269 | table.frame-sides{border-width:0 1px} |
| 270 | table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0} |
| 271 | table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0} |
| 272 | table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0} |
| 273 | table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0} |
| 274 | table.stripes-all>*>tr,table.stripes-odd>*>tr:nth-of-type(odd),table.stripes-even>*>tr:nth-of-type(even),table.stripes-hover>*>tr:hover{background:#f8f8f7} |
| 275 | th.halign-left,td.halign-left{text-align:left} |
| 276 | th.halign-right,td.halign-right{text-align:right} |
| 277 | th.halign-center,td.halign-center{text-align:center} |
| 278 | th.valign-top,td.valign-top{vertical-align:top} |
| 279 | th.valign-bottom,td.valign-bottom{vertical-align:bottom} |
| 280 | th.valign-middle,td.valign-middle{vertical-align:middle} |
| 281 | table thead th,table tfoot th{font-weight:bold} |
| 282 | tbody tr th{background:#f7f8f7} |
| 283 | tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold} |
| 284 | p.tableblock>code:only-child{background:none;padding:0} |
| 285 | p.tableblock{font-size:1em} |
| 286 | ol{margin-left:1.75em} |
| 287 | ul li ol{margin-left:1.5em} |
| 288 | dl dd{margin-left:1.125em} |
| 289 | dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0} |
| 290 | li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em} |
| 291 | ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none} |
| 292 | ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em} |
| 293 | ul.unstyled,ol.unstyled{margin-left:0} |
| 294 | li>p:empty:only-child::before{content:"";display:inline-block} |
| 295 | ul.checklist>li>p:first-child{margin-left:-1em} |
| 296 | ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em} |
| 297 | ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em} |
| 298 | ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em} |
| 299 | ul.inline>li{margin-left:1.25em} |
| 300 | .unstyled dl dt{font-weight:400;font-style:normal} |
| 301 | ol.arabic{list-style-type:decimal} |
| 302 | ol.decimal{list-style-type:decimal-leading-zero} |
| 303 | ol.loweralpha{list-style-type:lower-alpha} |
| 304 | ol.upperalpha{list-style-type:upper-alpha} |
| 305 | ol.lowerroman{list-style-type:lower-roman} |
| 306 | ol.upperroman{list-style-type:upper-roman} |
| 307 | ol.lowergreek{list-style-type:lower-greek} |
| 308 | .hdlist>table,.colist>table{border:0;background:none} |
| 309 | .hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none} |
| 310 | td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em} |
| 311 | td.hdlist1{font-weight:bold;padding-bottom:1.25em} |
| 312 | td.hdlist2{word-wrap:anywhere} |
| 313 | .literalblock+.colist,.listingblock+.colist{margin-top:-.5em} |
| 314 | .colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top} |
| 315 | .colist td:not([class]):first-child img{max-width:none} |
| 316 | .colist td:not([class]):last-child{padding:.25em 0} |
| 317 | .thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd} |
| 318 | .imageblock.left{margin:.25em .625em 1.25em 0} |
| 319 | .imageblock.right{margin:.25em 0 1.25em .625em} |
| 320 | .imageblock>.title{margin-bottom:0} |
| 321 | .imageblock.thumb,.imageblock.th{border-width:6px} |
| 322 | .imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em} |
| 323 | .image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0} |
| 324 | .image.left{margin-right:.625em} |
| 325 | .image.right{margin-left:.625em} |
| 326 | a.image{text-decoration:none;display:inline-block} |
| 327 | a.image object{pointer-events:none} |
| 328 | sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super} |
| 329 | sup.footnote a,sup.footnoteref a{text-decoration:none} |
| 330 | sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline} |
| 331 | #footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em} |
| 332 | #footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0} |
| 333 | #footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em} |
| 334 | #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em} |
| 335 | #footnotes .footnote:last-of-type{margin-bottom:0} |
| 336 | #content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0} |
| 337 | div.unbreakable{page-break-inside:avoid} |
| 338 | .big{font-size:larger} |
| 339 | .small{font-size:smaller} |
| 340 | .underline{text-decoration:underline} |
| 341 | .overline{text-decoration:overline} |
| 342 | .line-through{text-decoration:line-through} |
| 343 | .aqua{color:#00bfbf} |
| 344 | .aqua-background{background:#00fafa} |
| 345 | .black{color:#000} |
| 346 | .black-background{background:#000} |
| 347 | .blue{color:#0000bf} |
| 348 | .blue-background{background:#0000fa} |
| 349 | .fuchsia{color:#bf00bf} |
| 350 | .fuchsia-background{background:#fa00fa} |
| 351 | .gray{color:#606060} |
| 352 | .gray-background{background:#7d7d7d} |
| 353 | .green{color:#006000} |
| 354 | .green-background{background:#007d00} |
| 355 | .lime{color:#00bf00} |
| 356 | .lime-background{background:#00fa00} |
| 357 | .maroon{color:#600000} |
| 358 | .maroon-background{background:#7d0000} |
| 359 | .navy{color:#000060} |
| 360 | .navy-background{background:#00007d} |
| 361 | .olive{color:#606000} |
| 362 | .olive-background{background:#7d7d00} |
| 363 | .purple{color:#600060} |
| 364 | .purple-background{background:#7d007d} |
| 365 | .red{color:#bf0000} |
| 366 | .red-background{background:#fa0000} |
| 367 | .silver{color:#909090} |
| 368 | .silver-background{background:#bcbcbc} |
| 369 | .teal{color:#006060} |
| 370 | .teal-background{background:#007d7d} |
| 371 | .white{color:#bfbfbf} |
| 372 | .white-background{background:#fafafa} |
| 373 | .yellow{color:#bfbf00} |
| 374 | .yellow-background{background:#fafa00} |
| 375 | span.icon>.fa{cursor:default} |
| 376 | a span.icon>.fa{cursor:inherit} |
| 377 | .admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default} |
| 378 | .admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c} |
| 379 | .admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111} |
| 380 | .admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900} |
| 381 | .admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400} |
| 382 | .admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000} |
| 383 | .conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} |
| 384 | .conum[data-value] *{color:#fff!important} |
| 385 | .conum[data-value]+b{display:none} |
| 386 | .conum[data-value]::after{content:attr(data-value)} |
| 387 | pre .conum[data-value]{position:relative;top:-.125em} |
| 388 | b.conum *{color:inherit!important} |
| 389 | .conum:not([data-value]):empty{display:none} |
| 390 | dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility} |
| 391 | h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em} |
| 392 | p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} |
| 393 | p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem} |
| 394 | p{margin-bottom:1.25rem} |
| 395 | .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em} |
| 396 | .exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc} |
| 397 | .print-only{display:none!important} |
| 398 | @page{margin:1.25cm .75cm} |
| 399 | @media print{*{box-shadow:none!important;text-shadow:none!important} |
| 400 | html{font-size:80%} |
| 401 | a{color:inherit!important;text-decoration:underline!important} |
| 402 | a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important} |
| 403 | a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em} |
| 404 | abbr[title]{border-bottom:1px dotted} |
| 405 | abbr[title]::after{content:" (" attr(title) ")"} |
| 406 | pre,blockquote,tr,img,object,svg{page-break-inside:avoid} |
| 407 | thead{display:table-header-group} |
| 408 | svg{max-width:100%} |
| 409 | p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3} |
| 410 | h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid} |
| 411 | #header,#content,#footnotes,#footer{max-width:none} |
| 412 | #toc,.sidebarblock,.exampleblock>.content{background:none!important} |
| 413 | #toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important} |
| 414 | body.book #header{text-align:center} |
| 415 | body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em} |
| 416 | body.book #header .details{border:0!important;display:block;padding:0!important} |
| 417 | body.book #header .details span:first-child{margin-left:0!important} |
| 418 | body.book #header .details br{display:block} |
| 419 | body.book #header .details br+span::before{content:none!important} |
| 420 | body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important} |
| 421 | body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always} |
| 422 | .listingblock code[data-lang]::before{display:block} |
| 423 | #footer{padding:0 .9375em} |
| 424 | .hide-on-print{display:none!important} |
| 425 | .print-only{display:block!important} |
| 426 | .hide-for-print{display:none!important} |
| 427 | .show-for-print{display:inherit!important}} |
| 428 | @media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem} |
| 429 | .sect1{padding:0!important} |
| 430 | .sect1+.sect1{border:0} |
| 431 | #footer{background:none} |
| 432 | #footer-text{color:rgba(0,0,0,.6);font-size:.9em}} |
| 433 | @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} |
| 434 | </style> |
| 435 | <style> |
| 436 | pre>code { |
| 437 | display: inline; |
| 438 | } |
| 439 | </style> |
| 440 | </head> |
| 441 | <body class="manpage"> |
| 442 | <div id="header"> |
| 443 | <h1>git-diff-tree(1) Manual Page</h1> |
| 444 | <h2 id="_name">NAME</h2> |
| 445 | <div class="sectionbody"> |
| 446 | <p>git-diff-tree - Compares the content and mode of blobs found via two tree objects</p> |
| 447 | </div> |
| 448 | </div> |
| 449 | <div id="content"> |
| 450 | <div class="sect1"> |
| 451 | <h2 id="_synopsis">SYNOPSIS</h2> |
| 452 | <div class="sectionbody"> |
| 453 | <div class="verseblock"> |
| 454 | <pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] |
| 455 | [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base] |
| 456 | [<common-diff-options>] <tree-ish> [<tree-ish>] [<path>…​]</pre> |
| 457 | </div> |
| 458 | </div> |
| 459 | </div> |
| 460 | <div class="sect1"> |
| 461 | <h2 id="_description">DESCRIPTION</h2> |
| 462 | <div class="sectionbody"> |
| 463 | <div class="paragraph"> |
| 464 | <p>Compare the content and mode of blobs found via two tree objects.</p> |
| 465 | </div> |
| 466 | <div class="paragraph"> |
| 467 | <p>If there is only one <tree-ish> given, the commit is compared with its parents |
| 468 | (see --stdin below).</p> |
| 469 | </div> |
| 470 | <div class="paragraph"> |
| 471 | <p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p> |
| 472 | </div> |
| 473 | </div> |
| 474 | </div> |
| 475 | <div class="sect1"> |
| 476 | <h2 id="_options">OPTIONS</h2> |
| 477 | <div class="sectionbody"> |
| 478 | <div class="dlist"> |
| 479 | <dl> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 480 | <dt class="hdlist1"><code>-p</code></dt> |
| 481 | <dt class="hdlist1"><code>-u</code></dt> |
| 482 | <dt class="hdlist1"><code>--patch</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 483 | <dd> |
| 484 | <p>Generate patch (see <a href="#generate_patch_text_with_p">Generating patch text with -p</a>).</p> |
| 485 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 486 | <dt class="hdlist1"><code>-s</code></dt> |
| 487 | <dt class="hdlist1"><code>--no-patch</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 488 | <dd> |
| 489 | <p>Suppress all output from the diff machinery. Useful for |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 490 | commands like <code>git</code> <code>show</code> that show the patch by default to |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 491 | squelch their output, or to cancel the effect of options like |
| 492 | <code>--patch</code>, <code>--stat</code> earlier on the command line in an alias.</p> |
| 493 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 494 | <dt class="hdlist1"><code>-U</code><em><n></em></dt> |
| 495 | <dt class="hdlist1"><code>--unified=</code><em><n></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 496 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 497 | <p>Generate diffs with <em><n></em> lines of context instead of |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 498 | the usual three. |
| 499 | Implies <code>--patch</code>.</p> |
| 500 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 501 | <dt class="hdlist1"><code>--output=</code><em><file></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 502 | <dd> |
| 503 | <p>Output to a specific file instead of stdout.</p> |
| 504 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 505 | <dt class="hdlist1"><code>--output-indicator-new=</code><em><char></em></dt> |
| 506 | <dt class="hdlist1"><code>--output-indicator-old=</code><em><char></em></dt> |
| 507 | <dt class="hdlist1"><code>--output-indicator-context=</code><em><char></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 508 | <dd> |
| 509 | <p>Specify the character used to indicate new, old or context |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 510 | lines in the generated patch. Normally they are <code>+</code>, <code>-</code> and |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 511 | ' ' respectively.</p> |
| 512 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 513 | <dt class="hdlist1"><code>--raw</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 514 | <dd> |
| 515 | <p>Generate the diff in raw format. |
| 516 | This is the default.</p> |
| 517 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 518 | <dt class="hdlist1"><code>--patch-with-raw</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 519 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 520 | <p>Synonym for <code>-p</code> <code>--raw</code>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 521 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 522 | <dt class="hdlist1"><code>--indent-heuristic</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 523 | <dd> |
| 524 | <p>Enable the heuristic that shifts diff hunk boundaries to make patches |
| 525 | easier to read. This is the default.</p> |
| 526 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 527 | <dt class="hdlist1"><code>--no-indent-heuristic</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 528 | <dd> |
| 529 | <p>Disable the indent heuristic.</p> |
| 530 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 531 | <dt class="hdlist1"><code>--minimal</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 532 | <dd> |
| 533 | <p>Spend extra time to make sure the smallest possible |
| 534 | diff is produced.</p> |
| 535 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 536 | <dt class="hdlist1"><code>--patience</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 537 | <dd> |
| 538 | <p>Generate a diff using the "patience diff" algorithm.</p> |
| 539 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 540 | <dt class="hdlist1"><code>--histogram</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 541 | <dd> |
| 542 | <p>Generate a diff using the "histogram diff" algorithm.</p> |
| 543 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 544 | <dt class="hdlist1"><code>--anchored=</code><em><text></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 545 | <dd> |
| 546 | <p>Generate a diff using the "anchored diff" algorithm.</p> |
| 547 | <div class="paragraph"> |
| 548 | <p>This option may be specified more than once.</p> |
| 549 | </div> |
| 550 | <div class="paragraph"> |
| 551 | <p>If a line exists in both the source and destination, exists only once, |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 552 | and starts with <em><text></em>, this algorithm attempts to prevent it from |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 553 | appearing as a deletion or addition in the output. It uses the "patience |
| 554 | diff" algorithm internally.</p> |
| 555 | </div> |
| 556 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 557 | <dt class="hdlist1"><code>--diff-algorithm=</code>(<code>patience</code>|<code>minimal</code>|<code>histogram</code>|<code>myers</code>)</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 558 | <dd> |
| 559 | <p>Choose a diff algorithm. The variants are as follows:</p> |
| 560 | <div class="openblock"> |
| 561 | <div class="content"> |
| 562 | <div class="dlist"> |
| 563 | <dl> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 564 | <dt class="hdlist1"><code>default</code></dt> |
| 565 | <dt class="hdlist1"><code>myers</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 566 | <dd> |
| 567 | <p>The basic greedy diff algorithm. Currently, this is the default.</p> |
| 568 | </dd> |
| 569 | <dt class="hdlist1"><code>minimal</code></dt> |
| 570 | <dd> |
| 571 | <p>Spend extra time to make sure the smallest possible diff is |
| 572 | produced.</p> |
| 573 | </dd> |
| 574 | <dt class="hdlist1"><code>patience</code></dt> |
| 575 | <dd> |
| 576 | <p>Use "patience diff" algorithm when generating patches.</p> |
| 577 | </dd> |
| 578 | <dt class="hdlist1"><code>histogram</code></dt> |
| 579 | <dd> |
| 580 | <p>This algorithm extends the patience algorithm to "support |
| 581 | low-occurrence common elements".</p> |
| 582 | </dd> |
| 583 | </dl> |
| 584 | </div> |
| 585 | </div> |
| 586 | </div> |
| 587 | <div class="paragraph"> |
| 588 | <p>For instance, if you configured the <code>diff.algorithm</code> variable to a |
| 589 | non-default value and want to use the default one, then you |
| 590 | have to use <code>--diff-algorithm=default</code> option.</p> |
| 591 | </div> |
| 592 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 593 | <dt class="hdlist1"><code>--stat</code>[<code>=</code><em><width></em>[<code>,</code><em><name-width></em>[<code>,</code><em><count></em>]]]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 594 | <dd> |
| 595 | <p>Generate a diffstat. By default, as much space as necessary |
| 596 | will be used for the filename part, and the rest for the graph |
| 597 | part. Maximum width defaults to terminal width, or 80 columns |
| 598 | if not connected to a terminal, and can be overridden by |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 599 | <em><width></em>. The width of the filename part can be limited by |
| 600 | giving another width <em><name-width></em> after a comma or by setting |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 601 | <code>diff.statNameWidth=</code><em><name-width></em>. The width of the graph part can be |
| 602 | limited by using <code>--stat-graph-width=</code><em><graph-width></em> or by setting |
| 603 | <code>diff.statGraphWidth=</code><em><graph-width></em>. Using <code>--stat</code> or |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 604 | <code>--stat-graph-width</code> affects all commands generating a stat graph, |
| 605 | while setting <code>diff.statNameWidth</code> or <code>diff.statGraphWidth</code> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 606 | does not affect <code>git</code> <code>format-patch</code>. |
| 607 | By giving a third parameter <em><count></em>, you can limit the output to |
| 608 | the first <em><count></em> lines, followed by ... if there are more.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 609 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 610 | <p>These parameters can also be set individually with <code>--stat-width=</code><em><width></em>, |
| 611 | <code>--stat-name-width=</code><em><name-width></em> and <code>--stat-count=</code><em><count></em>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 612 | </div> |
| 613 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 614 | <dt class="hdlist1"><code>--compact-summary</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 615 | <dd> |
| 616 | <p>Output a condensed summary of extended header information such |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 617 | as file creations or deletions ("new" or "gone", optionally <code>+l</code> |
| 618 | if it’s a symlink) and mode changes (<code>+x</code> or <code>-x</code> for adding |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 619 | or removing executable bit respectively) in diffstat. The |
| 620 | information is put between the filename part and the graph |
| 621 | part. Implies <code>--stat</code>.</p> |
| 622 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 623 | <dt class="hdlist1"><code>--numstat</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 624 | <dd> |
| 625 | <p>Similar to <code>--stat</code>, but shows number of added and |
| 626 | deleted lines in decimal notation and pathname without |
| 627 | abbreviation, to make it more machine friendly. For |
| 628 | binary files, outputs two <code>-</code> instead of saying |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 629 | <code>0</code> <code>0</code>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 630 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 631 | <dt class="hdlist1"><code>--shortstat</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 632 | <dd> |
| 633 | <p>Output only the last line of the <code>--stat</code> format containing total |
| 634 | number of modified files, as well as number of added and deleted |
| 635 | lines.</p> |
| 636 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 637 | <dt class="hdlist1"><code>-X</code> [<em><param></em><code>,..</code>.]</dt> |
| 638 | <dt class="hdlist1"><code>--dirstat</code>[<code>=</code><em><param></em><code>,..</code>.]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 639 | <dd> |
| 640 | <p>Output the distribution of relative amount of changes for each |
| 641 | sub-directory. The behavior of <code>--dirstat</code> can be customized by |
| 642 | passing it a comma separated list of parameters. |
| 643 | The defaults are controlled by the <code>diff.dirstat</code> configuration |
| 644 | variable (see <a href="git-config.html">git-config(1)</a>). |
| 645 | The following parameters are available:</p> |
| 646 | <div class="openblock"> |
| 647 | <div class="content"> |
| 648 | <div class="dlist"> |
| 649 | <dl> |
| 650 | <dt class="hdlist1"><code>changes</code></dt> |
| 651 | <dd> |
| 652 | <p>Compute the dirstat numbers by counting the lines that have been |
| 653 | removed from the source, or added to the destination. This ignores |
| 654 | the amount of pure code movements within a file. In other words, |
| 655 | rearranging lines in a file is not counted as much as other changes. |
| 656 | This is the default behavior when no parameter is given.</p> |
| 657 | </dd> |
| 658 | <dt class="hdlist1"><code>lines</code></dt> |
| 659 | <dd> |
| 660 | <p>Compute the dirstat numbers by doing the regular line-based diff |
| 661 | analysis, and summing the removed/added line counts. (For binary |
| 662 | files, count 64-byte chunks instead, since binary files have no |
| 663 | natural concept of lines). This is a more expensive <code>--dirstat</code> |
| 664 | behavior than the <code>changes</code> behavior, but it does count rearranged |
| 665 | lines within a file as much as other changes. The resulting output |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 666 | is consistent with what you get from the other <code>--</code>*stat options.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 667 | </dd> |
| 668 | <dt class="hdlist1"><code>files</code></dt> |
| 669 | <dd> |
| 670 | <p>Compute the dirstat numbers by counting the number of files changed. |
| 671 | Each changed file counts equally in the dirstat analysis. This is |
| 672 | the computationally cheapest <code>--dirstat</code> behavior, since it does |
| 673 | not have to look at the file contents at all.</p> |
| 674 | </dd> |
| 675 | <dt class="hdlist1"><code>cumulative</code></dt> |
| 676 | <dd> |
| 677 | <p>Count changes in a child directory for the parent directory as well. |
| 678 | Note that when using <code>cumulative</code>, the sum of the percentages |
| 679 | reported may exceed 100%. The default (non-cumulative) behavior can |
| 680 | be specified with the <code>noncumulative</code> parameter.</p> |
| 681 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 682 | <dt class="hdlist1"><em><limit></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 683 | <dd> |
| 684 | <p>An integer parameter specifies a cut-off percent (3% by default). |
| 685 | Directories contributing less than this percentage of the changes |
| 686 | are not shown in the output.</p> |
| 687 | </dd> |
| 688 | </dl> |
| 689 | </div> |
| 690 | </div> |
| 691 | </div> |
| 692 | <div class="paragraph"> |
| 693 | <p>Example: The following will count changed files, while ignoring |
| 694 | directories with less than 10% of the total amount of changed files, |
| 695 | and accumulating child directory counts in the parent directories: |
| 696 | <code>--dirstat=files,10,cumulative</code>.</p> |
| 697 | </div> |
| 698 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 699 | <dt class="hdlist1"><code>--cumulative</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 700 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 701 | <p>Synonym for <code>--dirstat=cumulative</code>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 702 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 703 | <dt class="hdlist1"><code>--dirstat-by-file</code>[<code>=</code><em><param></em><code>,..</code>.]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 704 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 705 | <p>Synonym for <code>--dirstat=files,</code><em><param></em><code>,..</code>..</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 706 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 707 | <dt class="hdlist1"><code>--summary</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 708 | <dd> |
| 709 | <p>Output a condensed summary of extended header information |
| 710 | such as creations, renames and mode changes.</p> |
| 711 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 712 | <dt class="hdlist1"><code>--patch-with-stat</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 713 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 714 | <p>Synonym for <code>-p</code> <code>--stat</code>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 715 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 716 | <dt class="hdlist1"><code>-z</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 717 | <dd> |
| 718 | <p>When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been |
| 719 | given, do not munge pathnames and use NULs as output field terminators.</p> |
| 720 | <div class="paragraph"> |
| 721 | <p>Without this option, pathnames with "unusual" characters are quoted as |
| 722 | explained for the configuration variable <code>core.quotePath</code> (see |
| 723 | <a href="git-config.html">git-config(1)</a>).</p> |
| 724 | </div> |
| 725 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 726 | <dt class="hdlist1"><code>--name-only</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 727 | <dd> |
| 728 | <p>Show only the name of each changed file in the post-image tree. |
| 729 | The file names are often encoded in UTF-8. |
| 730 | For more information see the discussion about encoding in the <a href="git-log.html">git-log(1)</a> |
| 731 | manual page.</p> |
| 732 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 733 | <dt class="hdlist1"><code>--name-status</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 734 | <dd> |
| 735 | <p>Show only the name(s) and status of each changed file. See the description |
| 736 | of the <code>--diff-filter</code> option on what the status letters mean. |
| 737 | Just like <code>--name-only</code> the file names are often encoded in UTF-8.</p> |
| 738 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 739 | <dt class="hdlist1"><code>--submodule</code>[<code>=</code><em><format></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 740 | <dd> |
| 741 | <p>Specify how differences in submodules are shown. When specifying |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 742 | <code>--submodule=short</code> the <code>short</code> format is used. This format just |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 743 | shows the names of the commits at the beginning and end of the range. |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 744 | When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <code>log</code> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 745 | format is used. This format lists the commits in the range like |
| 746 | <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 747 | is specified, the <code>diff</code> format is used. This format shows an |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 748 | inline diff of the changes in the submodule contents between the |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 749 | commit range. Defaults to <code>diff.submodule</code> or the <code>short</code> format |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 750 | if the config option is unset.</p> |
| 751 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 752 | <dt class="hdlist1"><code>--color</code>[<code>=</code><em><when></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 753 | <dd> |
| 754 | <p>Show colored diff. |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 755 | <code>--color</code> (i.e. without <code>=</code><em><when></em>) is the same as <code>--color=always</code>. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 756 | <em><when></em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.</p> |
| 757 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 758 | <dt class="hdlist1"><code>--no-color</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 759 | <dd> |
| 760 | <p>Turn off colored diff. |
| 761 | It is the same as <code>--color=never</code>.</p> |
| 762 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 763 | <dt class="hdlist1"><code>--color-moved</code>[<code>=</code><em><mode></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 764 | <dd> |
| 765 | <p>Moved lines of code are colored differently. |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 766 | The <em><mode></em> defaults to <code>no</code> if the option is not given |
| 767 | and to <code>zebra</code> if the option with no mode is given. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 768 | The mode must be one of:</p> |
| 769 | <div class="openblock"> |
| 770 | <div class="content"> |
| 771 | <div class="dlist"> |
| 772 | <dl> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 773 | <dt class="hdlist1"><code>no</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 774 | <dd> |
| 775 | <p>Moved lines are not highlighted.</p> |
| 776 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 777 | <dt class="hdlist1"><code>default</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 778 | <dd> |
| 779 | <p>Is a synonym for <code>zebra</code>. This may change to a more sensible mode |
| 780 | in the future.</p> |
| 781 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 782 | <dt class="hdlist1"><code>plain</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 783 | <dd> |
| 784 | <p>Any line that is added in one location and was removed |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 785 | in another location will be colored with <code>color.diff.newMoved</code>. |
| 786 | Similarly <code>color.diff.oldMoved</code> will be used for removed lines |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 787 | that are added somewhere else in the diff. This mode picks up any |
| 788 | moved line, but it is not very useful in a review to determine |
| 789 | if a block of code was moved without permutation.</p> |
| 790 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 791 | <dt class="hdlist1"><code>blocks</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 792 | <dd> |
| 793 | <p>Blocks of moved text of at least 20 alphanumeric characters |
| 794 | are detected greedily. The detected blocks are |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 795 | painted using either the <code>color.diff.</code>(<code>old</code>|<code>new</code>)<code>Moved</code> color. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 796 | Adjacent blocks cannot be told apart.</p> |
| 797 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 798 | <dt class="hdlist1"><code>zebra</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 799 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 800 | <p>Blocks of moved text are detected as in <code>blocks</code> mode. The blocks |
| 801 | are painted using either the <code>color.diff.</code>(<code>old</code>|<code>new</code>)<code>Moved</code> color or |
| 802 | <code>color.diff.</code>(<code>old</code>|<code>new</code>)<code>MovedAlternative</code>. The change between |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 803 | the two colors indicates that a new block was detected.</p> |
| 804 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 805 | <dt class="hdlist1"><code>dimmed-zebra</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 806 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 807 | <p>Similar to <code>zebra</code>, but additional dimming of uninteresting parts |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 808 | of moved code is performed. The bordering lines of two adjacent |
| 809 | blocks are considered interesting, the rest is uninteresting. |
| 810 | <code>dimmed_zebra</code> is a deprecated synonym.</p> |
| 811 | </dd> |
| 812 | </dl> |
| 813 | </div> |
| 814 | </div> |
| 815 | </div> |
| 816 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 817 | <dt class="hdlist1"><code>--no-color-moved</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 818 | <dd> |
| 819 | <p>Turn off move detection. This can be used to override configuration |
| 820 | settings. It is the same as <code>--color-moved=no</code>.</p> |
| 821 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 822 | <dt class="hdlist1"><code>--color-moved-ws=</code><em><mode></em><code>,..</code>.</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 823 | <dd> |
| 824 | <p>This configures how whitespace is ignored when performing the |
| 825 | move detection for <code>--color-moved</code>. |
| 826 | These modes can be given as a comma separated list:</p> |
| 827 | <div class="openblock"> |
| 828 | <div class="content"> |
| 829 | <div class="dlist"> |
| 830 | <dl> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 831 | <dt class="hdlist1"><code>no</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 832 | <dd> |
| 833 | <p>Do not ignore whitespace when performing move detection.</p> |
| 834 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 835 | <dt class="hdlist1"><code>ignore-space-at-eol</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 836 | <dd> |
| 837 | <p>Ignore changes in whitespace at EOL.</p> |
| 838 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 839 | <dt class="hdlist1"><code>ignore-space-change</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 840 | <dd> |
| 841 | <p>Ignore changes in amount of whitespace. This ignores whitespace |
| 842 | at line end, and considers all other sequences of one or |
| 843 | more whitespace characters to be equivalent.</p> |
| 844 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 845 | <dt class="hdlist1"><code>ignore-all-space</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 846 | <dd> |
| 847 | <p>Ignore whitespace when comparing lines. This ignores differences |
| 848 | even if one line has whitespace where the other line has none.</p> |
| 849 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 850 | <dt class="hdlist1"><code>allow-indentation-change</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 851 | <dd> |
| 852 | <p>Initially ignore any whitespace in the move detection, then |
| 853 | group the moved code blocks only into a block if the change in |
| 854 | whitespace is the same per line. This is incompatible with the |
| 855 | other modes.</p> |
| 856 | </dd> |
| 857 | </dl> |
| 858 | </div> |
| 859 | </div> |
| 860 | </div> |
| 861 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 862 | <dt class="hdlist1"><code>--no-color-moved-ws</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 863 | <dd> |
| 864 | <p>Do not ignore whitespace when performing move detection. This can be |
| 865 | used to override configuration settings. It is the same as |
| 866 | <code>--color-moved-ws=no</code>.</p> |
| 867 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 868 | <dt class="hdlist1"><code>--word-diff</code>[<code>=</code><em><mode></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 869 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 870 | <p>By default, words are delimited by whitespace; see |
| 871 | <code>--word-diff-regex</code> below. The <em><mode></em> defaults to <code>plain</code>, and |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 872 | must be one of:</p> |
| 873 | <div class="openblock"> |
| 874 | <div class="content"> |
| 875 | <div class="dlist"> |
| 876 | <dl> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 877 | <dt class="hdlist1"><code>color</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 878 | <dd> |
| 879 | <p>Highlight changed words using only colors. Implies <code>--color</code>.</p> |
| 880 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 881 | <dt class="hdlist1"><code>plain</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 882 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 883 | <p>Show words as [<code>-removed-</code>] and {<code>added</code>}. Makes no |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 884 | attempts to escape the delimiters if they appear in the input, |
| 885 | so the output may be ambiguous.</p> |
| 886 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 887 | <dt class="hdlist1"><code>porcelain</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 888 | <dd> |
| 889 | <p>Use a special line-based format intended for script |
| 890 | consumption. Added/removed/unchanged runs are printed in the |
| 891 | usual unified diff format, starting with a <code>+</code>/<code>-</code>/` ` |
| 892 | character at the beginning of the line and extending to the |
| 893 | end of the line. Newlines in the input are represented by a |
| 894 | tilde <code>~</code> on a line of its own.</p> |
| 895 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 896 | <dt class="hdlist1"><code>none</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 897 | <dd> |
| 898 | <p>Disable word diff again.</p> |
| 899 | </dd> |
| 900 | </dl> |
| 901 | </div> |
| 902 | </div> |
| 903 | </div> |
| 904 | <div class="paragraph"> |
| 905 | <p>Note that despite the name of the first mode, color is used to |
| 906 | highlight the changed parts in all modes if enabled.</p> |
| 907 | </div> |
| 908 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 909 | <dt class="hdlist1"><code>--word-diff-regex=</code><em><regex></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 910 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 911 | <p>Use <em><regex></em> to decide what a word is, instead of considering |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 912 | runs of non-whitespace to be a word. Also implies |
| 913 | <code>--word-diff</code> unless it was already enabled.</p> |
| 914 | <div class="paragraph"> |
| 915 | <p>Every non-overlapping match of the |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 916 | <em><regex></em> is considered a word. Anything between these matches is |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 917 | considered whitespace and ignored(!) for the purposes of finding |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 918 | differences. You may want to append |[<code>^</code>[<code>:space:</code>]] to your regular |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 919 | expression to make sure that it matches all non-whitespace characters. |
| 920 | A match that contains a newline is silently truncated(!) at the |
| 921 | newline.</p> |
| 922 | </div> |
| 923 | <div class="paragraph"> |
| 924 | <p>For example, <code>--word-diff-regex=.</code> will treat each character as a word |
| 925 | and, correspondingly, show differences character by character.</p> |
| 926 | </div> |
| 927 | <div class="paragraph"> |
| 928 | <p>The regex can also be set via a diff driver or configuration option, see |
| 929 | <a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
| 930 | overrides any diff driver or configuration setting. Diff drivers |
| 931 | override configuration settings.</p> |
| 932 | </div> |
| 933 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 934 | <dt class="hdlist1"><code>--color-words</code>[<code>=</code><em><regex></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 935 | <dd> |
| 936 | <p>Equivalent to <code>--word-diff=color</code> plus (if a regex was |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 937 | specified) <code>--word-diff-regex=</code><em><regex></em>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 938 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 939 | <dt class="hdlist1"><code>--no-renames</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 940 | <dd> |
| 941 | <p>Turn off rename detection, even when the configuration |
| 942 | file gives the default to do so.</p> |
| 943 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 944 | <dt class="hdlist1"><code>--</code>[<code>no-</code>]<code>rename-empty</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 945 | <dd> |
| 946 | <p>Whether to use empty blobs as rename source.</p> |
| 947 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 948 | <dt class="hdlist1"><code>--check</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 949 | <dd> |
| 950 | <p>Warn if changes introduce conflict markers or whitespace errors. |
| 951 | What are considered whitespace errors is controlled by <code>core.whitespace</code> |
| 952 | configuration. By default, trailing whitespaces (including |
| 953 | lines that consist solely of whitespaces) and a space character |
| 954 | that is immediately followed by a tab character inside the |
| 955 | initial indent of the line are considered whitespace errors. |
| 956 | Exits with non-zero status if problems are found. Not compatible |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 957 | with <code>--exit-code</code>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 958 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 959 | <dt class="hdlist1"><code>--ws-error-highlight=</code><em><kind></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 960 | <dd> |
| 961 | <p>Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code> |
| 962 | lines of the diff. Multiple values are separated by comma, |
| 963 | <code>none</code> resets previous values, <code>default</code> reset the list to |
| 964 | <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When |
| 965 | this option is not given, and the configuration variable |
| 966 | <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in |
| 967 | <code>new</code> lines are highlighted. The whitespace errors are colored |
| 968 | with <code>color.diff.whitespace</code>.</p> |
| 969 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 970 | <dt class="hdlist1"><code>--full-index</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 971 | <dd> |
| 972 | <p>Instead of the first handful of characters, show the full |
| 973 | pre- and post-image blob object names on the "index" |
| 974 | line when generating patch format output.</p> |
| 975 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 976 | <dt class="hdlist1"><code>--binary</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 977 | <dd> |
| 978 | <p>In addition to <code>--full-index</code>, output a binary diff that |
| 979 | can be applied with <code>git-apply</code>. |
| 980 | Implies <code>--patch</code>.</p> |
| 981 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 982 | <dt class="hdlist1"><code>--abbrev</code>[<code>=</code><em><n></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 983 | <dd> |
| 984 | <p>Instead of showing the full 40-byte hexadecimal object |
| 985 | name in diff-raw format output and diff-tree header |
| 986 | lines, show the shortest prefix that is at least <em><n></em> |
| 987 | hexdigits long that uniquely refers the object. |
| 988 | In diff-patch output format, <code>--full-index</code> takes higher |
| 989 | precedence, i.e. if <code>--full-index</code> is specified, full blob |
| 990 | names will be shown regardless of <code>--abbrev</code>. |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 991 | Non default number of digits can be specified with <code>--abbrev=</code><em><n></em>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 992 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 993 | <dt class="hdlist1"><code>-B</code>[<em><n></em>][<code>/</code><em><m></em>]</dt> |
| 994 | <dt class="hdlist1"><code>--break-rewrites</code>[<code>=</code>[<em><n></em>][<code>/</code><em><m></em>]]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 995 | <dd> |
| 996 | <p>Break complete rewrite changes into pairs of delete and |
| 997 | create. This serves two purposes:</p> |
| 998 | <div class="paragraph"> |
| 999 | <p>It affects the way a change that amounts to a total rewrite of a file |
| 1000 | not as a series of deletion and insertion mixed together with a very |
| 1001 | few lines that happen to match textually as the context, but as a |
| 1002 | single deletion of everything old followed by a single insertion of |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1003 | everything new, and the number <em><m></em> controls this aspect of the <code>-B</code> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1004 | option (defaults to 60%). <code>-B/70</code>% specifies that less than 30% of the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1005 | original should remain in the result for Git to consider it a total |
| 1006 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 1007 | deletion and insertion mixed together with context lines).</p> |
| 1008 | </div> |
| 1009 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1010 | <p>When used with <code>-M</code>, a totally-rewritten file is also considered as the |
| 1011 | source of a rename (usually <code>-M</code> only considers a file that disappeared |
| 1012 | as the source of a rename), and the number <em><n></em> controls this aspect of |
| 1013 | the <code>-B</code> option (defaults to 50%). <code>-B20</code>% specifies that a change with |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1014 | addition and deletion compared to 20% or more of the file’s size are |
| 1015 | eligible for being picked up as a possible source of a rename to |
| 1016 | another file.</p> |
| 1017 | </div> |
| 1018 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1019 | <dt class="hdlist1"><code>-M</code>[<em><n></em>]</dt> |
| 1020 | <dt class="hdlist1"><code>--find-renames</code>[<code>=</code><em><n></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1021 | <dd> |
| 1022 | <p>Detect renames. |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1023 | If <em><n></em> is specified, it is a threshold on the similarity |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1024 | index (i.e. amount of addition/deletions compared to the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1025 | file’s size). For example, <code>-M90</code>% means Git should consider a |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1026 | delete/add pair to be a rename if more than 90% of the file |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1027 | hasn’t changed. Without a % sign, the number is to be read as |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1028 | a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1029 | 0.5, and is thus the same as <code>-M50</code>%. Similarly, <code>-M05</code> is |
| 1030 | the same as <code>-M5</code>%. To limit detection to exact renames, use |
| 1031 | <code>-M100</code>%. The default similarity index is 50%.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1032 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1033 | <dt class="hdlist1"><code>-C</code>[<em><n></em>]</dt> |
| 1034 | <dt class="hdlist1"><code>--find-copies</code>[<code>=</code><em><n></em>]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1035 | <dd> |
| 1036 | <p>Detect copies as well as renames. See also <code>--find-copies-harder</code>. |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1037 | If <em><n></em> is specified, it has the same meaning as for <code>-M</code><em><n></em>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1038 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1039 | <dt class="hdlist1"><code>--find-copies-harder</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1040 | <dd> |
| 1041 | <p>For performance reasons, by default, <code>-C</code> option finds copies only |
| 1042 | if the original file of the copy was modified in the same |
| 1043 | changeset. This flag makes the command |
| 1044 | inspect unmodified files as candidates for the source of |
| 1045 | copy. This is a very expensive operation for large |
| 1046 | projects, so use it with caution. Giving more than one |
| 1047 | <code>-C</code> option has the same effect.</p> |
| 1048 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1049 | <dt class="hdlist1"><code>-D</code></dt> |
| 1050 | <dt class="hdlist1"><code>--irreversible-delete</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1051 | <dd> |
| 1052 | <p>Omit the preimage for deletes, i.e. print only the header but not |
| 1053 | the diff between the preimage and <code>/dev/null</code>. The resulting patch |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1054 | is not meant to be applied with <code>patch</code> or <code>git</code> <code>apply</code>; this is |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1055 | solely for people who want to just concentrate on reviewing the |
| 1056 | text after the change. In addition, the output obviously lacks |
| 1057 | enough information to apply such a patch in reverse, even manually, |
| 1058 | hence the name of the option.</p> |
| 1059 | <div class="paragraph"> |
| 1060 | <p>When used together with <code>-B</code>, omit also the preimage in the deletion part |
| 1061 | of a delete/create pair.</p> |
| 1062 | </div> |
| 1063 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1064 | <dt class="hdlist1"><code>-l</code><em><num></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1065 | <dd> |
| 1066 | <p>The <code>-M</code> and <code>-C</code> options involve some preliminary steps that |
| 1067 | can detect subsets of renames/copies cheaply, followed by an |
| 1068 | exhaustive fallback portion that compares all remaining |
| 1069 | unpaired destinations to all relevant sources. (For renames, |
| 1070 | only remaining unpaired sources are relevant; for copies, all |
| 1071 | original sources are relevant.) For N sources and |
| 1072 | destinations, this exhaustive check is O(N^2). This option |
| 1073 | prevents the exhaustive portion of rename/copy detection from |
| 1074 | running if the number of source/destination files involved |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1075 | exceeds the specified number. Defaults to <code>diff.renameLimit</code>. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1076 | Note that a value of 0 is treated as unlimited.</p> |
| 1077 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1078 | <dt class="hdlist1"><code>--diff-filter=</code>[(<code>A</code>|<code>C</code>|<code>D</code>|<code>M</code>|<code>R</code>|<code>T</code>|<code>U</code>|<code>X</code>|<code>B</code>)<code>...</code>[*]]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1079 | <dd> |
| 1080 | <p>Select only files that are Added (<code>A</code>), Copied (<code>C</code>), |
| 1081 | Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their |
| 1082 | type (i.e. regular file, symlink, submodule, …​) changed (<code>T</code>), |
| 1083 | are Unmerged (<code>U</code>), are |
| 1084 | Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>). |
| 1085 | Any combination of the filter characters (including none) can be used. |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1086 | When * (All-or-none) is added to the combination, all |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1087 | paths are selected if there is any file that matches |
| 1088 | other criteria in the comparison; if there is no file |
| 1089 | that matches other criteria, nothing is selected.</p> |
| 1090 | <div class="paragraph"> |
| 1091 | <p>Also, these upper-case letters can be downcased to exclude. E.g. |
| 1092 | <code>--diff-filter=ad</code> excludes added and deleted paths.</p> |
| 1093 | </div> |
| 1094 | <div class="paragraph"> |
| 1095 | <p>Note that not all diffs can feature all types. For instance, copied and |
| 1096 | renamed entries cannot appear if detection for those types is disabled.</p> |
| 1097 | </div> |
| 1098 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1099 | <dt class="hdlist1"><code>-S</code><em><string></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1100 | <dd> |
| 1101 | <p>Look for differences that change the number of occurrences of |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1102 | the specified <em><string></em> (i.e. addition/deletion) in a file. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1103 | Intended for the scripter’s use.</p> |
| 1104 | <div class="paragraph"> |
| 1105 | <p>It is useful when you’re looking for an exact block of code (like a |
| 1106 | struct), and want to know the history of that block since it first |
| 1107 | came into being: use the feature iteratively to feed the interesting |
| 1108 | block in the preimage back into <code>-S</code>, and keep going until you get the |
| 1109 | very first version of the block.</p> |
| 1110 | </div> |
| 1111 | <div class="paragraph"> |
| 1112 | <p>Binary files are searched as well.</p> |
| 1113 | </div> |
| 1114 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1115 | <dt class="hdlist1"><code>-G</code><em><regex></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1116 | <dd> |
| 1117 | <p>Look for differences whose patch text contains added/removed |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1118 | lines that match <em><regex></em>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1119 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1120 | <p>To illustrate the difference between <code>-S</code><em><regex></em> <code>--pickaxe-regex</code> and |
| 1121 | <code>-G</code><em><regex></em>, consider a commit with the following diff in the same |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1122 | file:</p> |
| 1123 | </div> |
| 1124 | <div class="listingblock"> |
| 1125 | <div class="content"> |
| 1126 | <pre>+ return frotz(nitfol, two->ptr, 1, 0); |
| 1127 | ... |
| 1128 | - hit = frotz(nitfol, mf2.ptr, 1, 0);</pre> |
| 1129 | </div> |
| 1130 | </div> |
| 1131 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1132 | <p>While <code>git</code> <code>log</code> <code>-G</code>"frotz\(<code>nitfol</code>" will show this commit, <code>git</code> <code>log</code> |
| 1133 | <code>-S</code>"frotz\(<code>nitfol</code>" <code>--pickaxe-regex</code> will not (because the number of |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1134 | occurrences of that string did not change).</p> |
| 1135 | </div> |
| 1136 | <div class="paragraph"> |
| 1137 | <p>Unless <code>--text</code> is supplied patches of binary files without a textconv |
| 1138 | filter will be ignored.</p> |
| 1139 | </div> |
| 1140 | <div class="paragraph"> |
| 1141 | <p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more |
| 1142 | information.</p> |
| 1143 | </div> |
| 1144 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1145 | <dt class="hdlist1"><code>--find-object=</code><em><object-id></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1146 | <dd> |
| 1147 | <p>Look for differences that change the number of occurrences of |
| 1148 | the specified object. Similar to <code>-S</code>, just the argument is different |
| 1149 | in that it doesn’t search for a specific string but for a specific |
| 1150 | object id.</p> |
| 1151 | <div class="paragraph"> |
| 1152 | <p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in |
| 1153 | <code>git-log</code> to also find trees.</p> |
| 1154 | </div> |
| 1155 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1156 | <dt class="hdlist1"><code>--pickaxe-all</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1157 | <dd> |
| 1158 | <p>When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that |
| 1159 | changeset, not just the files that contain the change |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1160 | in <em><string></em>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1161 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1162 | <dt class="hdlist1"><code>--pickaxe-regex</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1163 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1164 | <p>Treat the <em><string></em> given to <code>-S</code> as an extended POSIX regular |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1165 | expression to match.</p> |
| 1166 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1167 | <dt class="hdlist1"><code>-O</code><em><orderfile></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1168 | <dd> |
| 1169 | <p>Control the order in which files appear in the output. |
| 1170 | This overrides the <code>diff.orderFile</code> configuration variable |
| 1171 | (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>, |
| 1172 | use <code>-O/dev/null</code>.</p> |
| 1173 | <div class="paragraph"> |
| 1174 | <p>The output order is determined by the order of glob patterns in |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1175 | <em><orderfile></em>. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1176 | All files with pathnames that match the first pattern are output |
| 1177 | first, all files with pathnames that match the second pattern (but not |
| 1178 | the first) are output next, and so on. |
| 1179 | All files with pathnames that do not match any pattern are output |
| 1180 | last, as if there was an implicit match-all pattern at the end of the |
| 1181 | file. |
| 1182 | If multiple pathnames have the same rank (they match the same pattern |
| 1183 | but no earlier patterns), their output order relative to each other is |
| 1184 | the normal order.</p> |
| 1185 | </div> |
| 1186 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1187 | <p><em><orderfile></em> is parsed as follows:</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1188 | </div> |
| 1189 | <div class="openblock"> |
| 1190 | <div class="content"> |
| 1191 | <div class="ulist"> |
| 1192 | <ul> |
| 1193 | <li> |
| 1194 | <p>Blank lines are ignored, so they can be used as separators for |
| 1195 | readability.</p> |
| 1196 | </li> |
| 1197 | <li> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1198 | <p>Lines starting with a hash ("#") are ignored, so they can be used |
| 1199 | for comments. Add a backslash ("\") to the beginning of the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1200 | pattern if it starts with a hash.</p> |
| 1201 | </li> |
| 1202 | <li> |
| 1203 | <p>Each other line contains a single pattern.</p> |
| 1204 | </li> |
| 1205 | </ul> |
| 1206 | </div> |
| 1207 | </div> |
| 1208 | </div> |
| 1209 | <div class="paragraph"> |
| 1210 | <p>Patterns have the same syntax and semantics as patterns used for |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1211 | <code>fnmatch</code>(3) without the <code>FNM_PATHNAME</code> flag, except a pathname also |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1212 | matches a pattern if removing any number of the final pathname |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1213 | components matches the pattern. For example, the pattern "<code>foo</code>*bar" |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1214 | matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p> |
| 1215 | </div> |
| 1216 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1217 | <dt class="hdlist1"><code>--skip-to=</code><em><file></em></dt> |
| 1218 | <dt class="hdlist1"><code>--rotate-to=</code><em><file></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1219 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1220 | <p>Discard the files before the named <em><file></em> from the output |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1221 | (i.e. <em>skip to</em>), or move them to the end of the output |
| 1222 | (i.e. <em>rotate to</em>). These options were invented primarily for the use |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1223 | of the <code>git</code> <code>difftool</code> command, and may not be very useful |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1224 | otherwise.</p> |
| 1225 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1226 | <dt class="hdlist1"><code>-R</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1227 | <dd> |
| 1228 | <p>Swap two inputs; that is, show differences from index or |
| 1229 | on-disk file to tree contents.</p> |
| 1230 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1231 | <dt class="hdlist1"><code>--relative</code>[<code>=</code><em><path></em>]</dt> |
| 1232 | <dt class="hdlist1"><code>--no-relative</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1233 | <dd> |
| 1234 | <p>When run from a subdirectory of the project, it can be |
| 1235 | told to exclude changes outside the directory and show |
| 1236 | pathnames relative to it with this option. When you are |
| 1237 | not in a subdirectory (e.g. in a bare repository), you |
| 1238 | can name which subdirectory to make the output relative |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1239 | to by giving a <em><path></em> as an argument. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1240 | <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config |
| 1241 | option and previous <code>--relative</code>.</p> |
| 1242 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1243 | <dt class="hdlist1"><code>-a</code></dt> |
| 1244 | <dt class="hdlist1"><code>--text</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1245 | <dd> |
| 1246 | <p>Treat all files as text.</p> |
| 1247 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1248 | <dt class="hdlist1"><code>--ignore-cr-at-eol</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1249 | <dd> |
| 1250 | <p>Ignore carriage-return at the end of line when doing a comparison.</p> |
| 1251 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1252 | <dt class="hdlist1"><code>--ignore-space-at-eol</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1253 | <dd> |
| 1254 | <p>Ignore changes in whitespace at EOL.</p> |
| 1255 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1256 | <dt class="hdlist1"><code>-b</code></dt> |
| 1257 | <dt class="hdlist1"><code>--ignore-space-change</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1258 | <dd> |
| 1259 | <p>Ignore changes in amount of whitespace. This ignores whitespace |
| 1260 | at line end, and considers all other sequences of one or |
| 1261 | more whitespace characters to be equivalent.</p> |
| 1262 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1263 | <dt class="hdlist1"><code>-w</code></dt> |
| 1264 | <dt class="hdlist1"><code>--ignore-all-space</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1265 | <dd> |
| 1266 | <p>Ignore whitespace when comparing lines. This ignores |
| 1267 | differences even if one line has whitespace where the other |
| 1268 | line has none.</p> |
| 1269 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1270 | <dt class="hdlist1"><code>--ignore-blank-lines</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1271 | <dd> |
| 1272 | <p>Ignore changes whose lines are all blank.</p> |
| 1273 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1274 | <dt class="hdlist1"><code>-I</code><em><regex></em></dt> |
| 1275 | <dt class="hdlist1"><code>--ignore-matching-lines=</code><em><regex></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1276 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1277 | <p>Ignore changes whose all lines match <em><regex></em>. This option may |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1278 | be specified more than once.</p> |
| 1279 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1280 | <dt class="hdlist1"><code>--inter-hunk-context=</code><em><number></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1281 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1282 | <p>Show the context between diff hunks, up to the specified <em><number></em> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1283 | of lines, thereby fusing hunks that are close to each other. |
| 1284 | Defaults to <code>diff.interHunkContext</code> or 0 if the config option |
| 1285 | is unset.</p> |
| 1286 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1287 | <dt class="hdlist1"><code>-W</code></dt> |
| 1288 | <dt class="hdlist1"><code>--function-context</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1289 | <dd> |
| 1290 | <p>Show whole function as context lines for each change. |
| 1291 | The function names are determined in the same way as |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1292 | <code>git</code> <code>diff</code> works out patch hunk headers (see "Defining a |
| 1293 | custom hunk-header" in <a href="gitattributes.html">gitattributes(5)</a>).</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1294 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1295 | <dt class="hdlist1"><code>--exit-code</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1296 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1297 | <p>Make the program exit with codes similar to <code>diff</code>(1). |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1298 | That is, it exits with 1 if there were differences and |
| 1299 | 0 means no differences.</p> |
| 1300 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1301 | <dt class="hdlist1"><code>--quiet</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1302 | <dd> |
| 1303 | <p>Disable all output of the program. Implies <code>--exit-code</code>. |
| 1304 | Disables execution of external diff helpers whose exit code |
| 1305 | is not trusted, i.e. their respective configuration option |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1306 | <code>diff.trustExitCode</code> or <code>diff.</code><em><driver></em>.<code>trustExitCode</code> or |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1307 | environment variable <code>GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE</code> is |
| 1308 | false.</p> |
| 1309 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1310 | <dt class="hdlist1"><code>--ext-diff</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1311 | <dd> |
| 1312 | <p>Allow an external diff helper to be executed. If you set an |
| 1313 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 1314 | to use this option with <a href="git-log.html">git-log(1)</a> and friends.</p> |
| 1315 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1316 | <dt class="hdlist1"><code>--no-ext-diff</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1317 | <dd> |
| 1318 | <p>Disallow external diff drivers.</p> |
| 1319 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1320 | <dt class="hdlist1"><code>--textconv</code></dt> |
| 1321 | <dt class="hdlist1"><code>--no-textconv</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1322 | <dd> |
| 1323 | <p>Allow (or disallow) external text conversion filters to be run |
| 1324 | when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for |
| 1325 | details. Because textconv filters are typically a one-way |
| 1326 | conversion, the resulting diff is suitable for human |
| 1327 | consumption, but cannot be applied. For this reason, textconv |
| 1328 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 1329 | <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or |
| 1330 | diff plumbing commands.</p> |
| 1331 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1332 | <dt class="hdlist1"><code>--ignore-submodules</code>[<code>=</code>(<code>none</code>|<code>untracked</code>|<code>dirty</code>|<code>all</code>)]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1333 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1334 | <p>Ignore changes to submodules in the diff generation. <code>all</code> is the default. |
| 1335 | Using <code>none</code> will consider the submodule modified when it either contains |
| 1336 | untracked or modified files or its <code>HEAD</code> differs from the commit recorded |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1337 | in the superproject and can be used to override any settings of the |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1338 | <code>ignore</code> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When |
| 1339 | <code>untracked</code> is used submodules are not considered dirty when they only |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1340 | contain untracked content (but they are still scanned for modified |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1341 | content). Using <code>dirty</code> ignores all changes to the work tree of submodules, |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1342 | only changes to the commits stored in the superproject are shown (this was |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1343 | the behavior until 1.7.0). Using <code>all</code> hides all changes to submodules.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1344 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1345 | <dt class="hdlist1"><code>--src-prefix=</code><em><prefix></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1346 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1347 | <p>Show the given source <em><prefix></em> instead of "a/".</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1348 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1349 | <dt class="hdlist1"><code>--dst-prefix=</code><em><prefix></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1350 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1351 | <p>Show the given destination <em><prefix></em> instead of "b/".</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1352 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1353 | <dt class="hdlist1"><code>--no-prefix</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1354 | <dd> |
| 1355 | <p>Do not show any source or destination prefix.</p> |
| 1356 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1357 | <dt class="hdlist1"><code>--default-prefix</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1358 | <dd> |
| 1359 | <p>Use the default source and destination prefixes ("a/" and "b/"). |
| 1360 | This overrides configuration variables such as <code>diff.noprefix</code>, |
| 1361 | <code>diff.srcPrefix</code>, <code>diff.dstPrefix</code>, and <code>diff.mnemonicPrefix</code> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1362 | (see <a href="git-config.html">git-config(1)</a>).</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1363 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1364 | <dt class="hdlist1"><code>--line-prefix=</code><em><prefix></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1365 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1366 | <p>Prepend an additional <em><prefix></em> to every line of output.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1367 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1368 | <dt class="hdlist1"><code>--ita-invisible-in-index</code></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1369 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 1370 | <p>By default entries added by <code>git</code> <code>add</code> <code>-N</code> appear as an existing |
| 1371 | empty file in <code>git</code> <code>diff</code> and a new file in <code>git</code> <code>diff</code> <code>--cached</code>. |
| 1372 | This option makes the entry appear as a new file in <code>git</code> <code>diff</code> |
| 1373 | and non-existent in <code>git</code> <code>diff</code> <code>--cached</code>. This option could be |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1374 | reverted with <code>--ita-visible-in-index</code>. Both options are |
| 1375 | experimental and could be removed in future.</p> |
| 1376 | </dd> |
| 1377 | </dl> |
| 1378 | </div> |
| 1379 | <div class="paragraph"> |
| 1380 | <p>For more detailed explanation on these common options, see also |
| 1381 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p> |
| 1382 | </div> |
| 1383 | <div class="dlist"> |
| 1384 | <dl> |
| 1385 | <dt class="hdlist1"><tree-ish></dt> |
| 1386 | <dd> |
| 1387 | <p>The id of a tree object.</p> |
| 1388 | </dd> |
| 1389 | <dt class="hdlist1"><path>…​</dt> |
| 1390 | <dd> |
| 1391 | <p>If provided, the results are limited to a subset of files |
| 1392 | matching one of the provided pathspecs.</p> |
| 1393 | </dd> |
| 1394 | <dt class="hdlist1">-r</dt> |
| 1395 | <dd> |
| 1396 | <p>Recurse into sub-trees.</p> |
| 1397 | </dd> |
| 1398 | <dt class="hdlist1">-t</dt> |
| 1399 | <dd> |
| 1400 | <p>Show tree entry itself as well as subtrees. Implies -r.</p> |
| 1401 | </dd> |
| 1402 | <dt class="hdlist1">--root</dt> |
| 1403 | <dd> |
| 1404 | <p>When <code>--root</code> is specified the initial commit will be shown as a big |
| 1405 | creation event. This is equivalent to a diff against the NULL tree.</p> |
| 1406 | </dd> |
| 1407 | <dt class="hdlist1">--merge-base</dt> |
| 1408 | <dd> |
| 1409 | <p>Instead of comparing the <tree-ish>s directly, use the merge |
| 1410 | base between the two <tree-ish>s as the "before" side. There |
| 1411 | must be two <tree-ish>s given and they must both be commits.</p> |
| 1412 | </dd> |
| 1413 | <dt class="hdlist1">--stdin</dt> |
| 1414 | <dd> |
| 1415 | <p>When <code>--stdin</code> is specified, the command does not take |
| 1416 | <tree-ish> arguments from the command line. Instead, it |
| 1417 | reads lines containing either two <tree>, one <commit>, or a |
| 1418 | list of <commit> from its standard input. (Use a single space |
| 1419 | as separator.)</p> |
| 1420 | <div class="paragraph"> |
| 1421 | <p>When two trees are given, it compares the first tree with the second. |
| 1422 | When a single commit is given, it compares the commit with its |
| 1423 | parents. The remaining commits, when given, are used as if they are |
| 1424 | parents of the first commit.</p> |
| 1425 | </div> |
| 1426 | <div class="paragraph"> |
| 1427 | <p>When comparing two trees, the ID of both trees (separated by a space |
| 1428 | and terminated by a newline) is printed before the difference. When |
| 1429 | comparing commits, the ID of the first (or only) commit, followed by a |
| 1430 | newline, is printed.</p> |
| 1431 | </div> |
| 1432 | <div class="paragraph"> |
| 1433 | <p>The following flags further affect the behavior when comparing |
| 1434 | commits (but not trees).</p> |
| 1435 | </div> |
| 1436 | </dd> |
| 1437 | <dt class="hdlist1">-m</dt> |
| 1438 | <dd> |
| 1439 | <p>By default, <em>git diff-tree --stdin</em> does not show |
| 1440 | differences for merge commits. With this flag, it shows |
| 1441 | differences to that commit from all of its parents. See |
| 1442 | also <code>-c</code>.</p> |
| 1443 | </dd> |
| 1444 | <dt class="hdlist1">-s</dt> |
| 1445 | <dd> |
| 1446 | <p>By default, <em>git diff-tree --stdin</em> shows differences, |
| 1447 | either in machine-readable form (without <code>-p</code>) or in patch |
| 1448 | form (with <code>-p</code>). This output can be suppressed. It is |
| 1449 | only useful with the <code>-v</code> flag.</p> |
| 1450 | </dd> |
| 1451 | <dt class="hdlist1">-v</dt> |
| 1452 | <dd> |
| 1453 | <p>This flag causes <em>git diff-tree --stdin</em> to also show |
| 1454 | the commit message before the differences.</p> |
| 1455 | </dd> |
| 1456 | <dt class="hdlist1">--pretty[=<format>]</dt> |
| 1457 | <dt class="hdlist1">--format=<format></dt> |
| 1458 | <dd> |
| 1459 | <p>Pretty-print the contents of the commit logs in a given format, |
| 1460 | where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>, |
| 1461 | <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:<string></em> |
| 1462 | and <em>tformat:<string></em>. When <em><format></em> is none of the above, |
| 1463 | and has <em>%placeholder</em> in it, it acts as if |
| 1464 | <em>--pretty=tformat:<format></em> were given.</p> |
| 1465 | <div class="paragraph"> |
| 1466 | <p>See the "PRETTY FORMATS" section for some additional details for each |
| 1467 | format. When <em>=<format></em> part is omitted, it defaults to <em>medium</em>.</p> |
| 1468 | </div> |
| 1469 | <div class="paragraph"> |
| 1470 | <p>Note: you can specify the default pretty format in the repository |
| 1471 | configuration (see <a href="git-config.html">git-config(1)</a>).</p> |
| 1472 | </div> |
| 1473 | </dd> |
| 1474 | <dt class="hdlist1">--abbrev-commit</dt> |
| 1475 | <dd> |
| 1476 | <p>Instead of showing the full 40-byte hexadecimal commit object |
| 1477 | name, show a prefix that names the object uniquely. |
| 1478 | "--abbrev=<n>" (which also modifies diff output, if it is displayed) |
| 1479 | option can be used to specify the minimum length of the prefix.</p> |
| 1480 | <div class="paragraph"> |
| 1481 | <p>This should make "--pretty=oneline" a whole lot more readable for |
| 1482 | people using 80-column terminals.</p> |
| 1483 | </div> |
| 1484 | </dd> |
| 1485 | <dt class="hdlist1">--no-abbrev-commit</dt> |
| 1486 | <dd> |
| 1487 | <p>Show the full 40-byte hexadecimal commit object name. This negates |
| 1488 | <code>--abbrev-commit</code>, either explicit or implied by other options such |
| 1489 | as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.</p> |
| 1490 | </dd> |
| 1491 | <dt class="hdlist1">--oneline</dt> |
| 1492 | <dd> |
| 1493 | <p>This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 1494 | used together.</p> |
| 1495 | </dd> |
| 1496 | <dt class="hdlist1">--encoding=<encoding></dt> |
| 1497 | <dd> |
| 1498 | <p>Commit objects record the character encoding used for the log message |
| 1499 | in their encoding header; this option can be used to tell the |
| 1500 | command to re-code the commit log message in the encoding |
| 1501 | preferred by the user. For non plumbing commands this |
| 1502 | defaults to UTF-8. Note that if an object claims to be encoded |
| 1503 | in <code>X</code> and we are outputting in <code>X</code>, we will output the object |
| 1504 | verbatim; this means that invalid sequences in the original |
| 1505 | commit may be copied to the output. Likewise, if iconv(3) fails |
| 1506 | to convert the commit, we will quietly output the original |
| 1507 | object verbatim.</p> |
| 1508 | </dd> |
| 1509 | <dt class="hdlist1">--expand-tabs=<n></dt> |
| 1510 | <dt class="hdlist1">--expand-tabs</dt> |
| 1511 | <dt class="hdlist1">--no-expand-tabs</dt> |
| 1512 | <dd> |
| 1513 | <p>Perform a tab expansion (replace each tab with enough spaces |
| 1514 | to fill to the next display column that is a multiple of <em><n></em>) |
| 1515 | in the log message before showing it in the output. |
| 1516 | <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and |
| 1517 | <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>, |
| 1518 | which disables tab expansion.</p> |
| 1519 | <div class="paragraph"> |
| 1520 | <p>By default, tabs are expanded in pretty formats that indent the log |
| 1521 | message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>, |
| 1522 | and <em>fuller</em>).</p> |
| 1523 | </div> |
| 1524 | </dd> |
| 1525 | <dt class="hdlist1">--notes[=<ref>]</dt> |
| 1526 | <dd> |
| 1527 | <p>Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the |
| 1528 | commit, when showing the commit log message. This is the default |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1529 | for <code>git</code> <code>log</code>, <code>git</code> <code>show</code> and <code>git</code> <code>whatchanged</code> commands when |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1530 | there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given |
| 1531 | on the command line.</p> |
| 1532 | <div class="paragraph"> |
| 1533 | <p>By default, the notes shown are from the notes refs listed in the |
| 1534 | <code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding |
| 1535 | environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p> |
| 1536 | </div> |
| 1537 | <div class="paragraph"> |
| 1538 | <p>With an optional <em><ref></em> argument, use the ref to find the notes |
| 1539 | to display. The ref can specify the full refname when it begins |
| 1540 | with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise |
| 1541 | <code>refs/notes/</code> is prefixed to form the full name of the ref.</p> |
| 1542 | </div> |
| 1543 | <div class="paragraph"> |
| 1544 | <p>Multiple --notes options can be combined to control which notes are |
| 1545 | being displayed. Examples: "--notes=foo" will show only notes from |
| 1546 | "refs/notes/foo"; "--notes=foo --notes" will show both notes from |
| 1547 | "refs/notes/foo" and from the default notes ref(s).</p> |
| 1548 | </div> |
| 1549 | </dd> |
| 1550 | <dt class="hdlist1">--no-notes</dt> |
| 1551 | <dd> |
| 1552 | <p>Do not show notes. This negates the above <code>--notes</code> option, by |
| 1553 | resetting the list of notes refs from which notes are shown. |
| 1554 | Options are parsed in the order given on the command line, so e.g. |
| 1555 | "--notes --notes=foo --no-notes --notes=bar" will only show notes |
| 1556 | from "refs/notes/bar".</p> |
| 1557 | </dd> |
| 1558 | <dt class="hdlist1">--show-notes-by-default</dt> |
| 1559 | <dd> |
| 1560 | <p>Show the default notes unless options for displaying specific |
| 1561 | notes are given.</p> |
| 1562 | </dd> |
| 1563 | <dt class="hdlist1">--show-notes[=<ref>]</dt> |
| 1564 | <dt class="hdlist1">--[no-]standard-notes</dt> |
| 1565 | <dd> |
| 1566 | <p>These options are deprecated. Use the above --notes/--no-notes |
| 1567 | options instead.</p> |
| 1568 | </dd> |
| 1569 | <dt class="hdlist1">--show-signature</dt> |
| 1570 | <dd> |
| 1571 | <p>Check the validity of a signed commit object by passing the signature |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1572 | to <code>gpg</code> <code>--verify</code> and show the output.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1573 | </dd> |
| 1574 | <dt class="hdlist1">--no-commit-id</dt> |
| 1575 | <dd> |
| 1576 | <p><em>git diff-tree</em> outputs a line with the commit ID when |
Junio C Hamano | 902ce17 | 2024-08-21 21:02:37 | [diff] [blame] | 1577 | applicable. This flag suppresses the commit ID output.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1578 | </dd> |
| 1579 | <dt class="hdlist1">-c</dt> |
| 1580 | <dd> |
| 1581 | <p>This flag changes the way a merge commit is displayed |
| 1582 | (which means it is useful only when the command is given |
| 1583 | one <tree-ish>, or <code>--stdin</code>). It shows the differences |
| 1584 | from each of the parents to the merge result simultaneously |
| 1585 | instead of showing pairwise diff between a parent and the |
| 1586 | result one at a time (which is what the <code>-m</code> option does). |
| 1587 | Furthermore, it lists only files which were modified |
| 1588 | from all parents.</p> |
| 1589 | </dd> |
| 1590 | <dt class="hdlist1">--cc</dt> |
| 1591 | <dd> |
| 1592 | <p>This flag changes the way a merge commit patch is displayed, |
| 1593 | in a similar way to the <code>-c</code> option. It implies the <code>-c</code> |
| 1594 | and <code>-p</code> options and further compresses the patch output |
| 1595 | by omitting uninteresting hunks whose contents in the parents |
| 1596 | have only two variants and the merge result picks one of them |
| 1597 | without modification. When all hunks are uninteresting, the commit |
| 1598 | itself and the commit log message are not shown, just like in any other |
| 1599 | "empty diff" case.</p> |
| 1600 | </dd> |
| 1601 | <dt class="hdlist1">--combined-all-paths</dt> |
| 1602 | <dd> |
| 1603 | <p>This flag causes combined diffs (used for merge commits) to |
| 1604 | list the name of the file from all parents. It thus only has |
| 1605 | effect when -c or --cc are specified, and is likely only |
| 1606 | useful if filename changes are detected (i.e. when either |
| 1607 | rename or copy detection have been requested).</p> |
| 1608 | </dd> |
| 1609 | <dt class="hdlist1">--always</dt> |
| 1610 | <dd> |
| 1611 | <p>Show the commit itself and the commit log message even |
| 1612 | if the diff itself is empty.</p> |
| 1613 | </dd> |
| 1614 | </dl> |
| 1615 | </div> |
| 1616 | </div> |
| 1617 | </div> |
| 1618 | <div class="sect1"> |
| 1619 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
| 1620 | <div class="sectionbody"> |
| 1621 | <div class="paragraph"> |
| 1622 | <p>If the commit is a merge, and if the pretty-format |
| 1623 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 1624 | inserted before the <em>Author:</em> line. This line begins with |
| 1625 | "Merge: " and the hashes of ancestral commits are printed, |
| 1626 | separated by spaces. Note that the listed commits may not |
| 1627 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 1628 | have limited your view of history: for example, if you are |
| 1629 | only interested in changes related to a certain directory or |
| 1630 | file.</p> |
| 1631 | </div> |
| 1632 | <div class="paragraph"> |
| 1633 | <p>There are several built-in formats, and you can define |
| 1634 | additional formats by setting a pretty.<name> |
| 1635 | config option to either another format name, or a |
| 1636 | <em>format:</em> string, as described below (see |
| 1637 | <a href="git-config.html">git-config(1)</a>). Here are the details of the |
| 1638 | built-in formats:</p> |
| 1639 | </div> |
| 1640 | <div class="ulist"> |
| 1641 | <ul> |
| 1642 | <li> |
| 1643 | <p><em>oneline</em></p> |
| 1644 | <div class="literalblock"> |
| 1645 | <div class="content"> |
| 1646 | <pre><hash> <title-line></pre> |
| 1647 | </div> |
| 1648 | </div> |
| 1649 | <div class="paragraph"> |
| 1650 | <p>This is designed to be as compact as possible.</p> |
| 1651 | </div> |
| 1652 | </li> |
| 1653 | <li> |
| 1654 | <p><em>short</em></p> |
| 1655 | <div class="literalblock"> |
| 1656 | <div class="content"> |
| 1657 | <pre>commit <hash> |
| 1658 | Author: <author></pre> |
| 1659 | </div> |
| 1660 | </div> |
| 1661 | <div class="literalblock"> |
| 1662 | <div class="content"> |
| 1663 | <pre><title-line></pre> |
| 1664 | </div> |
| 1665 | </div> |
| 1666 | </li> |
| 1667 | <li> |
| 1668 | <p><em>medium</em></p> |
| 1669 | <div class="literalblock"> |
| 1670 | <div class="content"> |
| 1671 | <pre>commit <hash> |
| 1672 | Author: <author> |
| 1673 | Date: <author-date></pre> |
| 1674 | </div> |
| 1675 | </div> |
| 1676 | <div class="literalblock"> |
| 1677 | <div class="content"> |
| 1678 | <pre><title-line></pre> |
| 1679 | </div> |
| 1680 | </div> |
| 1681 | <div class="literalblock"> |
| 1682 | <div class="content"> |
| 1683 | <pre><full-commit-message></pre> |
| 1684 | </div> |
| 1685 | </div> |
| 1686 | </li> |
| 1687 | <li> |
| 1688 | <p><em>full</em></p> |
| 1689 | <div class="literalblock"> |
| 1690 | <div class="content"> |
| 1691 | <pre>commit <hash> |
| 1692 | Author: <author> |
| 1693 | Commit: <committer></pre> |
| 1694 | </div> |
| 1695 | </div> |
| 1696 | <div class="literalblock"> |
| 1697 | <div class="content"> |
| 1698 | <pre><title-line></pre> |
| 1699 | </div> |
| 1700 | </div> |
| 1701 | <div class="literalblock"> |
| 1702 | <div class="content"> |
| 1703 | <pre><full-commit-message></pre> |
| 1704 | </div> |
| 1705 | </div> |
| 1706 | </li> |
| 1707 | <li> |
| 1708 | <p><em>fuller</em></p> |
| 1709 | <div class="literalblock"> |
| 1710 | <div class="content"> |
| 1711 | <pre>commit <hash> |
| 1712 | Author: <author> |
| 1713 | AuthorDate: <author-date> |
| 1714 | Commit: <committer> |
| 1715 | CommitDate: <committer-date></pre> |
| 1716 | </div> |
| 1717 | </div> |
| 1718 | <div class="literalblock"> |
| 1719 | <div class="content"> |
| 1720 | <pre><title-line></pre> |
| 1721 | </div> |
| 1722 | </div> |
| 1723 | <div class="literalblock"> |
| 1724 | <div class="content"> |
| 1725 | <pre><full-commit-message></pre> |
| 1726 | </div> |
| 1727 | </div> |
| 1728 | </li> |
| 1729 | <li> |
| 1730 | <p><em>reference</em></p> |
| 1731 | <div class="literalblock"> |
| 1732 | <div class="content"> |
| 1733 | <pre><abbrev-hash> (<title-line>, <short-author-date>)</pre> |
| 1734 | </div> |
| 1735 | </div> |
| 1736 | <div class="paragraph"> |
| 1737 | <p>This format is used to refer to another commit in a commit message and |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1738 | is the same as <code>--pretty=</code>'format:%C(<code>auto</code>)%h (%s, %ad)'. By default, |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1739 | the date is formatted with <code>--date=short</code> unless another <code>--date</code> option |
| 1740 | is explicitly specified. As with any <code>format:</code> with format |
| 1741 | placeholders, its output is not affected by other options like |
| 1742 | <code>--decorate</code> and <code>--walk-reflogs</code>.</p> |
| 1743 | </div> |
| 1744 | </li> |
| 1745 | <li> |
| 1746 | <p><em>email</em></p> |
| 1747 | <div class="literalblock"> |
| 1748 | <div class="content"> |
| 1749 | <pre>From <hash> <date> |
| 1750 | From: <author> |
| 1751 | Date: <author-date> |
| 1752 | Subject: [PATCH] <title-line></pre> |
| 1753 | </div> |
| 1754 | </div> |
| 1755 | <div class="literalblock"> |
| 1756 | <div class="content"> |
| 1757 | <pre><full-commit-message></pre> |
| 1758 | </div> |
| 1759 | </div> |
| 1760 | </li> |
| 1761 | <li> |
| 1762 | <p><em>mboxrd</em></p> |
| 1763 | <div class="paragraph"> |
| 1764 | <p>Like <em>email</em>, but lines in the commit message starting with "From " |
| 1765 | (preceded by zero or more ">") are quoted with ">" so they aren’t |
| 1766 | confused as starting a new commit.</p> |
| 1767 | </div> |
| 1768 | </li> |
| 1769 | <li> |
| 1770 | <p><em>raw</em></p> |
| 1771 | <div class="paragraph"> |
| 1772 | <p>The <em>raw</em> format shows the entire commit exactly as |
| 1773 | stored in the commit object. Notably, the hashes are |
| 1774 | displayed in full, regardless of whether --abbrev or |
| 1775 | --no-abbrev are used, and <em>parents</em> information show the |
| 1776 | true parent commits, without taking grafts or history |
| 1777 | simplification into account. Note that this format affects the way |
| 1778 | commits are displayed, but not the way the diff is shown e.g. with |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1779 | <code>git</code> <code>log</code> <code>--raw</code>. To get full object names in a raw diff format, |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1780 | use <code>--no-abbrev</code>.</p> |
| 1781 | </div> |
| 1782 | </li> |
| 1783 | <li> |
| 1784 | <p><em>format:<format-string></em></p> |
| 1785 | <div class="paragraph"> |
| 1786 | <p>The <em>format:<format-string></em> format allows you to specify which information |
| 1787 | you want to show. It works a little bit like printf format, |
| 1788 | with the notable exception that you get a newline with <em>%n</em> |
| 1789 | instead of <em>\n</em>.</p> |
| 1790 | </div> |
| 1791 | <div class="paragraph"> |
| 1792 | <p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em> |
| 1793 | would show something like this:</p> |
| 1794 | </div> |
| 1795 | <div class="listingblock"> |
| 1796 | <div class="content"> |
| 1797 | <pre>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 1798 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</pre> |
| 1799 | </div> |
| 1800 | </div> |
| 1801 | <div class="paragraph"> |
| 1802 | <p>The placeholders are:</p> |
| 1803 | </div> |
| 1804 | <div class="ulist"> |
| 1805 | <ul> |
| 1806 | <li> |
| 1807 | <p>Placeholders that expand to a single literal character:</p> |
| 1808 | <div class="dlist"> |
| 1809 | <dl> |
| 1810 | <dt class="hdlist1"><em>%n</em></dt> |
| 1811 | <dd> |
| 1812 | <p>newline</p> |
| 1813 | </dd> |
| 1814 | <dt class="hdlist1"><em>%%</em></dt> |
| 1815 | <dd> |
| 1816 | <p>a raw <em>%</em></p> |
| 1817 | </dd> |
| 1818 | <dt class="hdlist1"><em>%x00</em></dt> |
| 1819 | <dd> |
| 1820 | <p><em>%x</em> followed by two hexadecimal digits is replaced with a |
| 1821 | byte with the hexadecimal digits' value (we will call this |
| 1822 | "literal formatting code" in the rest of this document).</p> |
| 1823 | </dd> |
| 1824 | </dl> |
| 1825 | </div> |
| 1826 | </li> |
| 1827 | <li> |
| 1828 | <p>Placeholders that affect formatting of later placeholders:</p> |
| 1829 | <div class="dlist"> |
| 1830 | <dl> |
| 1831 | <dt class="hdlist1"><em>%Cred</em></dt> |
| 1832 | <dd> |
| 1833 | <p>switch color to red</p> |
| 1834 | </dd> |
| 1835 | <dt class="hdlist1"><em>%Cgreen</em></dt> |
| 1836 | <dd> |
| 1837 | <p>switch color to green</p> |
| 1838 | </dd> |
| 1839 | <dt class="hdlist1"><em>%Cblue</em></dt> |
| 1840 | <dd> |
| 1841 | <p>switch color to blue</p> |
| 1842 | </dd> |
| 1843 | <dt class="hdlist1"><em>%Creset</em></dt> |
| 1844 | <dd> |
| 1845 | <p>reset color</p> |
| 1846 | </dd> |
| 1847 | <dt class="hdlist1"><em>%C(…​)</em></dt> |
| 1848 | <dd> |
| 1849 | <p>color specification, as described under Values in the |
| 1850 | "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By |
| 1851 | default, colors are shown only when enabled for log output |
| 1852 | (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting |
| 1853 | the <code>auto</code> settings of the former if we are going to a |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1854 | terminal). %C(<code>auto,</code><code>...</code>) is accepted as a historical |
| 1855 | synonym for the default (e.g., %C(<code>auto,red</code>)). Specifying |
| 1856 | %C(<code>always,</code><code>...</code>) will show the colors even when color is |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1857 | not otherwise enabled (though consider just using |
| 1858 | <code>--color=always</code> to enable color for the whole output, |
| 1859 | including this format and anything else git might color). |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1860 | <code>auto</code> alone (i.e. %C(<code>auto</code>)) will turn on auto coloring |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1861 | on the next placeholders until the color is switched |
| 1862 | again.</p> |
| 1863 | </dd> |
| 1864 | <dt class="hdlist1"><em>%m</em></dt> |
| 1865 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1866 | <p>left (<), right (>) or boundary (<code>-</code>) mark</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1867 | </dd> |
| 1868 | <dt class="hdlist1"><em>%w([<w>[,<i1>[,<i2>]]])</em></dt> |
| 1869 | <dd> |
| 1870 | <p>switch line wrapping, like the -w option of |
| 1871 | <a href="git-shortlog.html">git-shortlog(1)</a>.</p> |
| 1872 | </dd> |
| 1873 | <dt class="hdlist1"><em>%<( <N> [,trunc|ltrunc|mtrunc])</em></dt> |
| 1874 | <dd> |
| 1875 | <p>make the next placeholder take at |
| 1876 | least N column widths, padding spaces on |
| 1877 | the right if necessary. Optionally |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1878 | truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..</code><code>ft</code>, |
| 1879 | the middle (mtrunc) <code>mi</code><code>..</code><code>le</code>, or the end |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1880 | (trunc) <code>rig..</code>, if the output is longer than |
| 1881 | N columns. |
| 1882 | Note 1: that truncating |
| 1883 | only works correctly with N >= 2. |
| 1884 | Note 2: spaces around the N and M (see below) |
| 1885 | values are optional. |
| 1886 | Note 3: Emojis and other wide characters |
| 1887 | will take two display columns, which may |
| 1888 | over-run column boundaries. |
| 1889 | Note 4: decomposed character combining marks |
| 1890 | may be misplaced at padding boundaries.</p> |
| 1891 | </dd> |
| 1892 | <dt class="hdlist1"><em>%<|( <M> )</em></dt> |
| 1893 | <dd> |
| 1894 | <p>make the next placeholder take at least until Mth |
| 1895 | display column, padding spaces on the right if necessary. |
| 1896 | Use negative M values for column positions measured |
| 1897 | from the right hand edge of the terminal window.</p> |
| 1898 | </dd> |
| 1899 | <dt class="hdlist1"><em>%>( <N> )</em>, <em>%>|( <M> )</em></dt> |
| 1900 | <dd> |
| 1901 | <p>similar to <em>%<( <N> )</em>, <em>%<|( <M> )</em> respectively, |
| 1902 | but padding spaces on the left</p> |
| 1903 | </dd> |
| 1904 | <dt class="hdlist1"><em>%>>( <N> )</em>, <em>%>>|( <M> )</em></dt> |
| 1905 | <dd> |
| 1906 | <p>similar to <em>%>( <N> )</em>, <em>%>|( <M> )</em> |
| 1907 | respectively, except that if the next |
| 1908 | placeholder takes more spaces than given and |
| 1909 | there are spaces on its left, use those |
| 1910 | spaces</p> |
| 1911 | </dd> |
| 1912 | <dt class="hdlist1"><em>%><( <N> )</em>, <em>%><|( <M> )</em></dt> |
| 1913 | <dd> |
| 1914 | <p>similar to <em>%<( <N> )</em>, <em>%<|( <M> )</em> |
| 1915 | respectively, but padding both sides |
| 1916 | (i.e. the text is centered)</p> |
| 1917 | </dd> |
| 1918 | </dl> |
| 1919 | </div> |
| 1920 | </li> |
| 1921 | <li> |
| 1922 | <p>Placeholders that expand to information extracted from the commit:</p> |
| 1923 | <div class="dlist"> |
| 1924 | <dl> |
| 1925 | <dt class="hdlist1"><em>%H</em></dt> |
| 1926 | <dd> |
| 1927 | <p>commit hash</p> |
| 1928 | </dd> |
| 1929 | <dt class="hdlist1"><em>%h</em></dt> |
| 1930 | <dd> |
| 1931 | <p>abbreviated commit hash</p> |
| 1932 | </dd> |
| 1933 | <dt class="hdlist1"><em>%T</em></dt> |
| 1934 | <dd> |
| 1935 | <p>tree hash</p> |
| 1936 | </dd> |
| 1937 | <dt class="hdlist1"><em>%t</em></dt> |
| 1938 | <dd> |
| 1939 | <p>abbreviated tree hash</p> |
| 1940 | </dd> |
| 1941 | <dt class="hdlist1"><em>%P</em></dt> |
| 1942 | <dd> |
| 1943 | <p>parent hashes</p> |
| 1944 | </dd> |
| 1945 | <dt class="hdlist1"><em>%p</em></dt> |
| 1946 | <dd> |
| 1947 | <p>abbreviated parent hashes</p> |
| 1948 | </dd> |
| 1949 | <dt class="hdlist1"><em>%an</em></dt> |
| 1950 | <dd> |
| 1951 | <p>author name</p> |
| 1952 | </dd> |
| 1953 | <dt class="hdlist1"><em>%aN</em></dt> |
| 1954 | <dd> |
| 1955 | <p>author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 1956 | or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 1957 | </dd> |
| 1958 | <dt class="hdlist1"><em>%ae</em></dt> |
| 1959 | <dd> |
| 1960 | <p>author email</p> |
| 1961 | </dd> |
| 1962 | <dt class="hdlist1"><em>%aE</em></dt> |
| 1963 | <dd> |
| 1964 | <p>author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 1965 | or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 1966 | </dd> |
| 1967 | <dt class="hdlist1"><em>%al</em></dt> |
| 1968 | <dd> |
| 1969 | <p>author email local-part (the part before the <em>@</em> sign)</p> |
| 1970 | </dd> |
| 1971 | <dt class="hdlist1"><em>%aL</em></dt> |
| 1972 | <dd> |
| 1973 | <p>author local-part (see <em>%al</em>) respecting .mailmap, see |
| 1974 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 1975 | </dd> |
| 1976 | <dt class="hdlist1"><em>%ad</em></dt> |
| 1977 | <dd> |
| 1978 | <p>author date (format respects --date= option)</p> |
| 1979 | </dd> |
| 1980 | <dt class="hdlist1"><em>%aD</em></dt> |
| 1981 | <dd> |
| 1982 | <p>author date, RFC2822 style</p> |
| 1983 | </dd> |
| 1984 | <dt class="hdlist1"><em>%ar</em></dt> |
| 1985 | <dd> |
| 1986 | <p>author date, relative</p> |
| 1987 | </dd> |
| 1988 | <dt class="hdlist1"><em>%at</em></dt> |
| 1989 | <dd> |
| 1990 | <p>author date, UNIX timestamp</p> |
| 1991 | </dd> |
| 1992 | <dt class="hdlist1"><em>%ai</em></dt> |
| 1993 | <dd> |
| 1994 | <p>author date, ISO 8601-like format</p> |
| 1995 | </dd> |
| 1996 | <dt class="hdlist1"><em>%aI</em></dt> |
| 1997 | <dd> |
| 1998 | <p>author date, strict ISO 8601 format</p> |
| 1999 | </dd> |
| 2000 | <dt class="hdlist1"><em>%as</em></dt> |
| 2001 | <dd> |
| 2002 | <p>author date, short format (<code>YYYY-MM-DD</code>)</p> |
| 2003 | </dd> |
| 2004 | <dt class="hdlist1"><em>%ah</em></dt> |
| 2005 | <dd> |
| 2006 | <p>author date, human style (like the <code>--date=human</code> option of |
| 2007 | <a href="git-rev-list.html">git-rev-list(1)</a>)</p> |
| 2008 | </dd> |
| 2009 | <dt class="hdlist1"><em>%cn</em></dt> |
| 2010 | <dd> |
| 2011 | <p>committer name</p> |
| 2012 | </dd> |
| 2013 | <dt class="hdlist1"><em>%cN</em></dt> |
| 2014 | <dd> |
| 2015 | <p>committer name (respecting .mailmap, see |
| 2016 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 2017 | </dd> |
| 2018 | <dt class="hdlist1"><em>%ce</em></dt> |
| 2019 | <dd> |
| 2020 | <p>committer email</p> |
| 2021 | </dd> |
| 2022 | <dt class="hdlist1"><em>%cE</em></dt> |
| 2023 | <dd> |
| 2024 | <p>committer email (respecting .mailmap, see |
| 2025 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 2026 | </dd> |
| 2027 | <dt class="hdlist1"><em>%cl</em></dt> |
| 2028 | <dd> |
| 2029 | <p>committer email local-part (the part before the <em>@</em> sign)</p> |
| 2030 | </dd> |
| 2031 | <dt class="hdlist1"><em>%cL</em></dt> |
| 2032 | <dd> |
| 2033 | <p>committer local-part (see <em>%cl</em>) respecting .mailmap, see |
| 2034 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 2035 | </dd> |
| 2036 | <dt class="hdlist1"><em>%cd</em></dt> |
| 2037 | <dd> |
| 2038 | <p>committer date (format respects --date= option)</p> |
| 2039 | </dd> |
| 2040 | <dt class="hdlist1"><em>%cD</em></dt> |
| 2041 | <dd> |
| 2042 | <p>committer date, RFC2822 style</p> |
| 2043 | </dd> |
| 2044 | <dt class="hdlist1"><em>%cr</em></dt> |
| 2045 | <dd> |
| 2046 | <p>committer date, relative</p> |
| 2047 | </dd> |
| 2048 | <dt class="hdlist1"><em>%ct</em></dt> |
| 2049 | <dd> |
| 2050 | <p>committer date, UNIX timestamp</p> |
| 2051 | </dd> |
| 2052 | <dt class="hdlist1"><em>%ci</em></dt> |
| 2053 | <dd> |
| 2054 | <p>committer date, ISO 8601-like format</p> |
| 2055 | </dd> |
| 2056 | <dt class="hdlist1"><em>%cI</em></dt> |
| 2057 | <dd> |
| 2058 | <p>committer date, strict ISO 8601 format</p> |
| 2059 | </dd> |
| 2060 | <dt class="hdlist1"><em>%cs</em></dt> |
| 2061 | <dd> |
| 2062 | <p>committer date, short format (<code>YYYY-MM-DD</code>)</p> |
| 2063 | </dd> |
| 2064 | <dt class="hdlist1"><em>%ch</em></dt> |
| 2065 | <dd> |
| 2066 | <p>committer date, human style (like the <code>--date=human</code> option of |
| 2067 | <a href="git-rev-list.html">git-rev-list(1)</a>)</p> |
| 2068 | </dd> |
| 2069 | <dt class="hdlist1"><em>%d</em></dt> |
| 2070 | <dd> |
| 2071 | <p>ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a></p> |
| 2072 | </dd> |
| 2073 | <dt class="hdlist1"><em>%D</em></dt> |
| 2074 | <dd> |
| 2075 | <p>ref names without the " (", ")" wrapping.</p> |
| 2076 | </dd> |
| 2077 | <dt class="hdlist1"><em>%(decorate[:<options>])</em></dt> |
| 2078 | <dd> |
| 2079 | <p>ref names with custom decorations. The <code>decorate</code> string may be followed by a |
| 2080 | colon and zero or more comma-separated options. Option values may contain |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2081 | literal formatting codes. These must be used for commas (%x2C) and closing |
| 2082 | parentheses (%x29), due to their role in the option syntax.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2083 | <div class="ulist"> |
| 2084 | <ul> |
| 2085 | <li> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2086 | <p><em>prefix=<value></em>: Shown before the list of ref names. Defaults to " (".</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2087 | </li> |
| 2088 | <li> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2089 | <p><em>suffix=<value></em>: Shown after the list of ref names. Defaults to ")".</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2090 | </li> |
| 2091 | <li> |
| 2092 | <p><em>separator=<value></em>: Shown between ref names. Defaults to "<code>,</code> ".</p> |
| 2093 | </li> |
| 2094 | <li> |
| 2095 | <p><em>pointer=<value></em>: Shown between HEAD and the branch it points to, if any. |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2096 | Defaults to " <code>-</code>> ".</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2097 | </li> |
| 2098 | <li> |
| 2099 | <p><em>tag=<value></em>: Shown before tag names. Defaults to "<code>tag:</code> ".</p> |
| 2100 | </li> |
| 2101 | </ul> |
| 2102 | </div> |
| 2103 | </dd> |
| 2104 | </dl> |
| 2105 | </div> |
| 2106 | </li> |
| 2107 | </ul> |
| 2108 | </div> |
| 2109 | <div class="paragraph"> |
| 2110 | <p>For example, to produce decorations with no wrapping |
| 2111 | or tag annotations, and spaces as separators:</p> |
| 2112 | </div> |
| 2113 | <div class="paragraph"> |
| 2114 | <p>+ |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2115 | %(<code>decorate:prefix=,suffix=,tag=,separator=</code> )</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2116 | </div> |
| 2117 | <div class="dlist"> |
| 2118 | <dl> |
| 2119 | <dt class="hdlist1"><em>%(describe[:<options>])</em></dt> |
| 2120 | <dd> |
| 2121 | <p>human-readable name, like <a href="git-describe.html">git-describe(1)</a>; empty string for |
| 2122 | undescribable commits. The <code>describe</code> string may be followed by a colon and |
| 2123 | zero or more comma-separated options. Descriptions can be inconsistent when |
| 2124 | tags are added or removed at the same time.</p> |
| 2125 | <div class="ulist"> |
| 2126 | <ul> |
| 2127 | <li> |
| 2128 | <p><em>tags[=<bool-value>]</em>: Instead of only considering annotated tags, |
| 2129 | consider lightweight tags as well.</p> |
| 2130 | </li> |
| 2131 | <li> |
| 2132 | <p><em>abbrev=<number></em>: Instead of using the default number of hexadecimal digits |
| 2133 | (which will vary according to the number of objects in the repository with a |
| 2134 | default of 7) of the abbreviated object name, use <number> digits, or as many |
| 2135 | digits as needed to form a unique object name.</p> |
| 2136 | </li> |
| 2137 | <li> |
| 2138 | <p><em>match=<pattern></em>: Only consider tags matching the given |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2139 | <code>glob</code>(<code>7</code>) pattern, excluding the "refs/tags/" prefix.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2140 | </li> |
| 2141 | <li> |
| 2142 | <p><em>exclude=<pattern></em>: Do not consider tags matching the given |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2143 | <code>glob</code>(<code>7</code>) pattern, excluding the "refs/tags/" prefix.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2144 | </li> |
| 2145 | </ul> |
| 2146 | </div> |
| 2147 | </dd> |
| 2148 | <dt class="hdlist1"><em>%S</em></dt> |
| 2149 | <dd> |
| 2150 | <p>ref name given on the command line by which the commit was reached |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2151 | (like <code>git</code> <code>log</code> <code>--source</code>), only works with <code>git</code> <code>log</code></p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2152 | </dd> |
| 2153 | <dt class="hdlist1"><em>%e</em></dt> |
| 2154 | <dd> |
| 2155 | <p>encoding</p> |
| 2156 | </dd> |
| 2157 | <dt class="hdlist1"><em>%s</em></dt> |
| 2158 | <dd> |
| 2159 | <p>subject</p> |
| 2160 | </dd> |
| 2161 | <dt class="hdlist1"><em>%f</em></dt> |
| 2162 | <dd> |
| 2163 | <p>sanitized subject line, suitable for a filename</p> |
| 2164 | </dd> |
| 2165 | <dt class="hdlist1"><em>%b</em></dt> |
| 2166 | <dd> |
| 2167 | <p>body</p> |
| 2168 | </dd> |
| 2169 | <dt class="hdlist1"><em>%B</em></dt> |
| 2170 | <dd> |
| 2171 | <p>raw body (unwrapped subject and body)</p> |
| 2172 | </dd> |
| 2173 | <dt class="hdlist1"><em>%N</em></dt> |
| 2174 | <dd> |
| 2175 | <p>commit notes</p> |
| 2176 | </dd> |
| 2177 | <dt class="hdlist1"><em>%GG</em></dt> |
| 2178 | <dd> |
| 2179 | <p>raw verification message from GPG for a signed commit</p> |
| 2180 | </dd> |
| 2181 | <dt class="hdlist1"><em>%G?</em></dt> |
| 2182 | <dd> |
| 2183 | <p>show "G" for a good (valid) signature, |
| 2184 | "B" for a bad signature, |
| 2185 | "U" for a good signature with unknown validity, |
| 2186 | "X" for a good signature that has expired, |
| 2187 | "Y" for a good signature made by an expired key, |
| 2188 | "R" for a good signature made by a revoked key, |
| 2189 | "E" if the signature cannot be checked (e.g. missing key) |
| 2190 | and "N" for no signature</p> |
| 2191 | </dd> |
| 2192 | <dt class="hdlist1"><em>%GS</em></dt> |
| 2193 | <dd> |
| 2194 | <p>show the name of the signer for a signed commit</p> |
| 2195 | </dd> |
| 2196 | <dt class="hdlist1"><em>%GK</em></dt> |
| 2197 | <dd> |
| 2198 | <p>show the key used to sign a signed commit</p> |
| 2199 | </dd> |
| 2200 | <dt class="hdlist1"><em>%GF</em></dt> |
| 2201 | <dd> |
| 2202 | <p>show the fingerprint of the key used to sign a signed commit</p> |
| 2203 | </dd> |
| 2204 | <dt class="hdlist1"><em>%GP</em></dt> |
| 2205 | <dd> |
| 2206 | <p>show the fingerprint of the primary key whose subkey was used |
| 2207 | to sign a signed commit</p> |
| 2208 | </dd> |
| 2209 | <dt class="hdlist1"><em>%GT</em></dt> |
| 2210 | <dd> |
| 2211 | <p>show the trust level for the key used to sign a signed commit</p> |
| 2212 | </dd> |
| 2213 | <dt class="hdlist1"><em>%gD</em></dt> |
| 2214 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2215 | <p>reflog selector, e.g., <code>refs/stash@</code>{1} or <code>refs/stash@</code>{2 |
| 2216 | <code>minutes</code> <code>ago</code>}; the format follows the rules described for the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2217 | <code>-g</code> option. The portion before the <code>@</code> is the refname as |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2218 | given on the command line (so <code>git</code> <code>log</code> <code>-g</code> <code>refs/heads/master</code> |
| 2219 | would yield <code>refs/heads/master@</code>{0}).</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2220 | </dd> |
| 2221 | <dt class="hdlist1"><em>%gd</em></dt> |
| 2222 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2223 | <p>shortened reflog selector; same as %gD, but the refname |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2224 | portion is shortened for human readability (so |
| 2225 | <code>refs/heads/master</code> becomes just <code>master</code>).</p> |
| 2226 | </dd> |
| 2227 | <dt class="hdlist1"><em>%gn</em></dt> |
| 2228 | <dd> |
| 2229 | <p>reflog identity name</p> |
| 2230 | </dd> |
| 2231 | <dt class="hdlist1"><em>%gN</em></dt> |
| 2232 | <dd> |
| 2233 | <p>reflog identity name (respecting .mailmap, see |
| 2234 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 2235 | </dd> |
| 2236 | <dt class="hdlist1"><em>%ge</em></dt> |
| 2237 | <dd> |
| 2238 | <p>reflog identity email</p> |
| 2239 | </dd> |
| 2240 | <dt class="hdlist1"><em>%gE</em></dt> |
| 2241 | <dd> |
| 2242 | <p>reflog identity email (respecting .mailmap, see |
| 2243 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p> |
| 2244 | </dd> |
| 2245 | <dt class="hdlist1"><em>%gs</em></dt> |
| 2246 | <dd> |
| 2247 | <p>reflog subject</p> |
| 2248 | </dd> |
| 2249 | <dt class="hdlist1"><em>%(trailers[:<options>])</em></dt> |
| 2250 | <dd> |
| 2251 | <p>display the trailers of the body as interpreted by |
| 2252 | <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be followed by |
| 2253 | a colon and zero or more comma-separated options. If any option is provided |
| 2254 | multiple times, the last occurrence wins.</p> |
| 2255 | <div class="ulist"> |
| 2256 | <ul> |
| 2257 | <li> |
| 2258 | <p><em>key=<key></em>: only show trailers with specified <key>. Matching is done |
| 2259 | case-insensitively and trailing colon is optional. If option is |
| 2260 | given multiple times trailer lines matching any of the keys are |
| 2261 | shown. This option automatically enables the <code>only</code> option so that |
| 2262 | non-trailer lines in the trailer block are hidden. If that is not |
| 2263 | desired it can be disabled with <code>only=false</code>. E.g., |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2264 | %(<code>trailers:key=Reviewed-by</code>) shows trailer lines with key |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2265 | <code>Reviewed-by</code>.</p> |
| 2266 | </li> |
| 2267 | <li> |
| 2268 | <p><em>only[=<bool>]</em>: select whether non-trailer lines from the trailer |
| 2269 | block should be included.</p> |
| 2270 | </li> |
| 2271 | <li> |
| 2272 | <p><em>separator=<sep></em>: specify the separator inserted between trailer |
| 2273 | lines. Defaults to a line feed character. The string <sep> may contain |
| 2274 | the literal formatting codes described above. To use comma as |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2275 | separator one must use %x2C as it would otherwise be parsed as |
| 2276 | next option. E.g., %(<code>trailers:key=Ticket,separator=</code>%x2C ) |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2277 | shows all trailer lines whose key is "Ticket" separated by a comma |
| 2278 | and a space.</p> |
| 2279 | </li> |
| 2280 | <li> |
| 2281 | <p><em>unfold[=<bool>]</em>: make it behave as if interpret-trailer’s <code>--unfold</code> |
| 2282 | option was given. E.g., |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2283 | %(<code>trailers:only,unfold=true</code>) unfolds and shows all trailer lines.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2284 | </li> |
| 2285 | <li> |
| 2286 | <p><em>keyonly[=<bool>]</em>: only show the key part of the trailer.</p> |
| 2287 | </li> |
| 2288 | <li> |
| 2289 | <p><em>valueonly[=<bool>]</em>: only show the value part of the trailer.</p> |
| 2290 | </li> |
| 2291 | <li> |
| 2292 | <p><em>key_value_separator=<sep></em>: specify the separator inserted between |
| 2293 | the key and value of each trailer. Defaults to ": ". Otherwise it |
| 2294 | shares the same semantics as <em>separator=<sep></em> above.</p> |
| 2295 | </li> |
| 2296 | </ul> |
| 2297 | </div> |
| 2298 | </dd> |
| 2299 | </dl> |
| 2300 | </div> |
| 2301 | </li> |
| 2302 | </ul> |
| 2303 | </div> |
| 2304 | <div class="admonitionblock note"> |
| 2305 | <table> |
| 2306 | <tr> |
| 2307 | <td class="icon"> |
| 2308 | <div class="title">Note</div> |
| 2309 | </td> |
| 2310 | <td class="content"> |
| 2311 | Some placeholders may depend on other options given to the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2312 | revision traversal engine. For example, the %g* reflog options will |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2313 | insert an empty string unless we are traversing reflog entries (e.g., by |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2314 | <code>git</code> <code>log</code> <code>-g</code>). The %d and %D placeholders will use the "short" |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2315 | decoration format if <code>--decorate</code> was not already provided on the command |
| 2316 | line. |
| 2317 | </td> |
| 2318 | </tr> |
| 2319 | </table> |
| 2320 | </div> |
| 2321 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2322 | <p>The boolean options accept an optional value [<code>=</code><em><bool-value></em>]. The values |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2323 | <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean" |
| 2324 | sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean |
| 2325 | option is given with no value, it’s enabled.</p> |
| 2326 | </div> |
| 2327 | <div class="paragraph"> |
| 2328 | <p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed |
| 2329 | is inserted immediately before the expansion if and only if the |
| 2330 | placeholder expands to a non-empty string.</p> |
| 2331 | </div> |
| 2332 | <div class="paragraph"> |
| 2333 | <p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive |
| 2334 | line-feeds immediately preceding the expansion are deleted if and only if the |
| 2335 | placeholder expands to an empty string.</p> |
| 2336 | </div> |
| 2337 | <div class="paragraph"> |
| 2338 | <p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space |
| 2339 | is inserted immediately before the expansion if and only if the |
| 2340 | placeholder expands to a non-empty string.</p> |
| 2341 | </div> |
| 2342 | <div class="ulist"> |
| 2343 | <ul> |
| 2344 | <li> |
| 2345 | <p><em>tformat:</em></p> |
| 2346 | <div class="paragraph"> |
| 2347 | <p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it |
| 2348 | provides "terminator" semantics instead of "separator" semantics. In |
| 2349 | other words, each commit has the message terminator character (usually a |
| 2350 | newline) appended, rather than a separator placed between entries. |
| 2351 | This means that the final entry of a single-line format will be properly |
| 2352 | terminated with a new line, just as the "oneline" format does. |
| 2353 | For example:</p> |
| 2354 | </div> |
| 2355 | <div class="listingblock"> |
| 2356 | <div class="content"> |
| 2357 | <pre>$ git log -2 --pretty=format:%h 4da45bef \ |
| 2358 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2359 | 4da45be |
| 2360 | 7134973 -- NO NEWLINE |
| 2361 | |
| 2362 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 2363 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2364 | 4da45be |
| 2365 | 7134973</pre> |
| 2366 | </div> |
| 2367 | </div> |
| 2368 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2369 | <p>In addition, any unrecognized string that has a % in it is interpreted |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2370 | as if it has <code>tformat:</code> in front of it. For example, these two are |
| 2371 | equivalent:</p> |
| 2372 | </div> |
| 2373 | <div class="listingblock"> |
| 2374 | <div class="content"> |
| 2375 | <pre>$ git log -2 --pretty=tformat:%h 4da45bef |
| 2376 | $ git log -2 --pretty=%h 4da45bef</pre> |
| 2377 | </div> |
| 2378 | </div> |
| 2379 | </li> |
| 2380 | </ul> |
| 2381 | </div> |
| 2382 | </div> |
| 2383 | </div> |
| 2384 | <div class="sect1"> |
| 2385 | <h2 id="_raw_output_format">Raw output format</h2> |
| 2386 | <div class="sectionbody"> |
| 2387 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2388 | <p>The raw output format from <code>git-diff-index</code>, <code>git-diff-tree</code>, |
| 2389 | <code>git-diff-files</code> and <code>git</code> <code>diff</code> <code>--raw</code> are very similar.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2390 | </div> |
| 2391 | <div class="paragraph"> |
| 2392 | <p>These commands all compare two sets of things; what is |
| 2393 | compared differs:</p> |
| 2394 | </div> |
| 2395 | <div class="dlist"> |
| 2396 | <dl> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2397 | <dt class="hdlist1"><code>git-diff-index</code> <em><tree-ish></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2398 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2399 | <p>compares the <em><tree-ish></em> and the files on the filesystem.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2400 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2401 | <dt class="hdlist1"><code>git-diff-index</code> <code>--cached</code> <em><tree-ish></em></dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2402 | <dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2403 | <p>compares the <em><tree-ish></em> and the index.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2404 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2405 | <dt class="hdlist1"><code>git-diff-tree</code> [<code>-r</code>] <em><tree-ish-1></em> <em><tree-ish-2></em> [<em><pattern></em>...]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2406 | <dd> |
| 2407 | <p>compares the trees named by the two arguments.</p> |
| 2408 | </dd> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2409 | <dt class="hdlist1"><code>git-diff-files</code> [<em><pattern></em>...]</dt> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2410 | <dd> |
| 2411 | <p>compares the index and the files on the filesystem.</p> |
| 2412 | </dd> |
| 2413 | </dl> |
| 2414 | </div> |
| 2415 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2416 | <p>The <code>git-diff-tree</code> command begins its output by printing the hash of |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2417 | what is being compared. After that, all the commands print one output |
| 2418 | line per changed file.</p> |
| 2419 | </div> |
| 2420 | <div class="paragraph"> |
| 2421 | <p>An output line is formatted this way:</p> |
| 2422 | </div> |
| 2423 | <div class="listingblock"> |
| 2424 | <div class="content"> |
| 2425 | <pre>in-place edit :100644 100644 bcd1234 0123456 M file0 |
| 2426 | copy-edit :100644 100644 abcd123 1234567 C68 file1 file2 |
| 2427 | rename-edit :100644 100644 abcd123 1234567 R86 file1 file3 |
| 2428 | create :000000 100644 0000000 1234567 A file4 |
| 2429 | delete :100644 000000 1234567 0000000 D file5 |
| 2430 | unmerged :000000 000000 0000000 0000000 U file6</pre> |
| 2431 | </div> |
| 2432 | </div> |
| 2433 | <div class="paragraph"> |
| 2434 | <p>That is, from the left to the right:</p> |
| 2435 | </div> |
| 2436 | <div class="olist arabic"> |
| 2437 | <ol class="arabic"> |
| 2438 | <li> |
| 2439 | <p>a colon.</p> |
| 2440 | </li> |
| 2441 | <li> |
| 2442 | <p>mode for "src"; 000000 if creation or unmerged.</p> |
| 2443 | </li> |
| 2444 | <li> |
| 2445 | <p>a space.</p> |
| 2446 | </li> |
| 2447 | <li> |
| 2448 | <p>mode for "dst"; 000000 if deletion or unmerged.</p> |
| 2449 | </li> |
| 2450 | <li> |
| 2451 | <p>a space.</p> |
| 2452 | </li> |
| 2453 | <li> |
| 2454 | <p>sha1 for "src"; 0{40} if creation or unmerged.</p> |
| 2455 | </li> |
| 2456 | <li> |
| 2457 | <p>a space.</p> |
| 2458 | </li> |
| 2459 | <li> |
| 2460 | <p>sha1 for "dst"; 0{40} if deletion, unmerged or "work tree out of sync with the index".</p> |
| 2461 | </li> |
| 2462 | <li> |
| 2463 | <p>a space.</p> |
| 2464 | </li> |
| 2465 | <li> |
| 2466 | <p>status, followed by optional "score" number.</p> |
| 2467 | </li> |
| 2468 | <li> |
| 2469 | <p>a tab or a NUL when <code>-z</code> option is used.</p> |
| 2470 | </li> |
| 2471 | <li> |
| 2472 | <p>path for "src"</p> |
| 2473 | </li> |
| 2474 | <li> |
| 2475 | <p>a tab or a NUL when <code>-z</code> option is used; only exists for C or R.</p> |
| 2476 | </li> |
| 2477 | <li> |
| 2478 | <p>path for "dst"; only exists for C or R.</p> |
| 2479 | </li> |
| 2480 | <li> |
| 2481 | <p>an LF or a NUL when <code>-z</code> option is used, to terminate the record.</p> |
| 2482 | </li> |
| 2483 | </ol> |
| 2484 | </div> |
| 2485 | <div class="paragraph"> |
| 2486 | <p>Possible status letters are:</p> |
| 2487 | </div> |
| 2488 | <div class="ulist"> |
| 2489 | <ul> |
| 2490 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2491 | <p><code>A</code>: addition of a file</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2492 | </li> |
| 2493 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2494 | <p><code>C</code>: copy of a file into a new one</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2495 | </li> |
| 2496 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2497 | <p><code>D</code>: deletion of a file</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2498 | </li> |
| 2499 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2500 | <p><code>M</code>: modification of the contents or mode of a file</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2501 | </li> |
| 2502 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2503 | <p><code>R</code>: renaming of a file</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2504 | </li> |
| 2505 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2506 | <p><code>T</code>: change in the type of the file (regular file, symbolic link or submodule)</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2507 | </li> |
| 2508 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2509 | <p><code>U</code>: file is unmerged (you must complete the merge before it can |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2510 | be committed)</p> |
| 2511 | </li> |
| 2512 | <li> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2513 | <p><code>X</code>: "unknown" change type (most probably a bug, please report it)</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2514 | </li> |
| 2515 | </ul> |
| 2516 | </div> |
| 2517 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2518 | <p>Status letters <code>C</code> and <code>R</code> are always followed by a score (denoting the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2519 | percentage of similarity between the source and target of the move or |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2520 | copy). Status letter <code>M</code> may be followed by a score (denoting the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2521 | percentage of dissimilarity) for file rewrites.</p> |
| 2522 | </div> |
| 2523 | <div class="paragraph"> |
| 2524 | <p>The sha1 for "dst" is shown as all 0’s if a file on the filesystem |
| 2525 | is out of sync with the index.</p> |
| 2526 | </div> |
| 2527 | <div class="paragraph"> |
| 2528 | <p>Example:</p> |
| 2529 | </div> |
| 2530 | <div class="listingblock"> |
| 2531 | <div class="content"> |
| 2532 | <pre>:100644 100644 5be4a4a 0000000 M file.c</pre> |
| 2533 | </div> |
| 2534 | </div> |
| 2535 | <div class="paragraph"> |
| 2536 | <p>Without the <code>-z</code> option, pathnames with "unusual" characters are |
| 2537 | quoted as explained for the configuration variable <code>core.quotePath</code> |
| 2538 | (see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output |
| 2539 | verbatim and the line is terminated by a NUL byte.</p> |
| 2540 | </div> |
| 2541 | </div> |
| 2542 | </div> |
| 2543 | <div class="sect1"> |
| 2544 | <h2 id="_diff_format_for_merges">diff format for merges</h2> |
| 2545 | <div class="sectionbody"> |
| 2546 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2547 | <p><code>git-diff-tree</code>, <code>git-diff-files</code> and <code>git-diff</code> <code>--raw</code> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2548 | can take <code>-c</code> or <code>--cc</code> option |
| 2549 | to generate diff output also for merge commits. The output differs |
| 2550 | from the format described above in the following way:</p> |
| 2551 | </div> |
| 2552 | <div class="olist arabic"> |
| 2553 | <ol class="arabic"> |
| 2554 | <li> |
| 2555 | <p>there is a colon for each parent</p> |
| 2556 | </li> |
| 2557 | <li> |
| 2558 | <p>there are more "src" modes and "src" sha1</p> |
| 2559 | </li> |
| 2560 | <li> |
| 2561 | <p>status is concatenated status characters for each parent</p> |
| 2562 | </li> |
| 2563 | <li> |
| 2564 | <p>no optional "score" number</p> |
| 2565 | </li> |
| 2566 | <li> |
| 2567 | <p>tab-separated pathname(s) of the file</p> |
| 2568 | </li> |
| 2569 | </ol> |
| 2570 | </div> |
| 2571 | <div class="paragraph"> |
| 2572 | <p>For <code>-c</code> and <code>--cc</code>, only the destination or final path is shown even |
| 2573 | if the file was renamed on any side of history. With |
| 2574 | <code>--combined-all-paths</code>, the name of the path in each parent is shown |
| 2575 | followed by the name of the path in the merge commit.</p> |
| 2576 | </div> |
| 2577 | <div class="paragraph"> |
| 2578 | <p>Examples for <code>-c</code> and <code>--cc</code> without <code>--combined-all-paths</code>:</p> |
| 2579 | </div> |
| 2580 | <div class="listingblock"> |
| 2581 | <div class="content"> |
| 2582 | <pre>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c |
| 2583 | ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh |
| 2584 | ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR phooey.c</pre> |
| 2585 | </div> |
| 2586 | </div> |
| 2587 | <div class="paragraph"> |
| 2588 | <p>Examples when <code>--combined-all-paths</code> added to either <code>-c</code> or <code>--cc</code>:</p> |
| 2589 | </div> |
| 2590 | <div class="listingblock"> |
| 2591 | <div class="content"> |
| 2592 | <pre>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c desc.c desc.c |
| 2593 | ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM foo.sh bar.sh bar.sh |
| 2594 | ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR fooey.c fuey.c phooey.c</pre> |
| 2595 | </div> |
| 2596 | </div> |
| 2597 | <div class="paragraph"> |
| 2598 | <p>Note that <em>combined diff</em> lists only files which were modified from |
| 2599 | all parents.</p> |
| 2600 | </div> |
| 2601 | </div> |
| 2602 | </div> |
| 2603 | <div class="sect1"> |
| 2604 | <h2 id="generate_patch_text_with_p">Generating patch text with -p</h2> |
| 2605 | <div class="sectionbody"> |
| 2606 | <div class="paragraph"> |
| 2607 | <p>Running |
| 2608 | <a href="git-diff.html">git-diff(1)</a>, |
| 2609 | <a href="git-log.html">git-log(1)</a>, |
| 2610 | <a href="git-show.html">git-show(1)</a>, |
| 2611 | <a href="git-diff-index.html">git-diff-index(1)</a>, |
| 2612 | <a href="git-diff-tree.html">git-diff-tree(1)</a>, or |
| 2613 | <a href="git-diff-files.html">git-diff-files(1)</a> |
| 2614 | with the <code>-p</code> option produces patch text. |
| 2615 | You can customize the creation of patch text via the |
| 2616 | <code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables |
| 2617 | (see <a href="git.html">git(1)</a>), and the <code>diff</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).</p> |
| 2618 | </div> |
| 2619 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2620 | <p>What the <code>-p</code> option produces is slightly different from the traditional |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2621 | diff format:</p> |
| 2622 | </div> |
| 2623 | <div class="olist arabic"> |
| 2624 | <ol class="arabic"> |
| 2625 | <li> |
| 2626 | <p>It is preceded by a "git diff" header that looks like this:</p> |
| 2627 | <div class="literalblock"> |
| 2628 | <div class="content"> |
| 2629 | <pre>diff --git a/file1 b/file2</pre> |
| 2630 | </div> |
| 2631 | </div> |
| 2632 | <div class="paragraph"> |
| 2633 | <p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is |
| 2634 | involved. Especially, even for a creation or a deletion, |
| 2635 | <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p> |
| 2636 | </div> |
| 2637 | <div class="paragraph"> |
| 2638 | <p>When a rename/copy is involved, <code>file1</code> and <code>file2</code> show the |
| 2639 | name of the source file of the rename/copy and the name of |
| 2640 | the file that the rename/copy produces, respectively.</p> |
| 2641 | </div> |
| 2642 | </li> |
| 2643 | <li> |
| 2644 | <p>It is followed by one or more extended header lines:</p> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2645 | <div class="verseblock"> |
| 2646 | <pre class="content"><code>old</code> <code>mode</code> <em><mode></em> |
| 2647 | <code>new</code> <code>mode</code> <em><mode></em> |
| 2648 | <code>deleted</code> <code>file</code> <code>mode</code> <em><mode></em> |
| 2649 | <code>new</code> <code>file</code> <code>mode</code> <em><mode></em> |
| 2650 | <code>copy</code> <code>from</code> <em><path></em> |
| 2651 | <code>copy</code> <code>to</code> <em><path></em> |
| 2652 | <code>rename</code> <code>from</code> <em><path></em> |
| 2653 | <code>rename</code> <code>to</code> <em><path></em> |
| 2654 | <code>similarity</code> <code>index</code> <em><number></em> |
| 2655 | <code>dissimilarity</code> <code>index</code> <em><number></em> |
| 2656 | <code>index</code> <em><hash></em>`..`<em><hash></em> <em><mode></em></pre> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2657 | </div> |
| 2658 | <div class="paragraph"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2659 | <p>File modes <em><mode></em> are printed as 6-digit octal numbers including the file type |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2660 | and file permission bits.</p> |
| 2661 | </div> |
| 2662 | <div class="paragraph"> |
| 2663 | <p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p> |
| 2664 | </div> |
| 2665 | <div class="paragraph"> |
| 2666 | <p>The similarity index is the percentage of unchanged lines, and |
| 2667 | the dissimilarity index is the percentage of changed lines. It |
| 2668 | is a rounded down integer, followed by a percent sign. The |
| 2669 | similarity index value of 100% is thus reserved for two equal |
| 2670 | files, while 100% dissimilarity means that no line from the old |
| 2671 | file made it into the new one.</p> |
| 2672 | </div> |
| 2673 | <div class="paragraph"> |
| 2674 | <p>The index line includes the blob object names before and after the change. |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2675 | The <em><mode></em> is included if the file mode does not change; otherwise, |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2676 | separate lines indicate the old and the new mode.</p> |
| 2677 | </div> |
| 2678 | </li> |
| 2679 | <li> |
| 2680 | <p>Pathnames with "unusual" characters are quoted as explained for |
| 2681 | the configuration variable <code>core.quotePath</code> (see |
| 2682 | <a href="git-config.html">git-config(1)</a>).</p> |
| 2683 | </li> |
| 2684 | <li> |
| 2685 | <p>All the <code>file1</code> files in the output refer to files before the |
| 2686 | commit, and all the <code>file2</code> files refer to files after the commit. |
| 2687 | It is incorrect to apply each change to each file sequentially. For |
| 2688 | example, this patch will swap a and b:</p> |
| 2689 | <div class="literalblock"> |
| 2690 | <div class="content"> |
| 2691 | <pre>diff --git a/a b/b |
| 2692 | rename from a |
| 2693 | rename to b |
| 2694 | diff --git a/b b/a |
| 2695 | rename from b |
| 2696 | rename to a</pre> |
| 2697 | </div> |
| 2698 | </div> |
| 2699 | </li> |
| 2700 | <li> |
| 2701 | <p>Hunk headers mention the name of the function to which the hunk |
| 2702 | applies. See "Defining a custom hunk-header" in |
| 2703 | <a href="gitattributes.html">gitattributes(5)</a> for details of how to tailor this to |
| 2704 | specific languages.</p> |
| 2705 | </li> |
| 2706 | </ol> |
| 2707 | </div> |
| 2708 | </div> |
| 2709 | </div> |
| 2710 | <div class="sect1"> |
| 2711 | <h2 id="_combined_diff_format">Combined diff format</h2> |
| 2712 | <div class="sectionbody"> |
| 2713 | <div class="paragraph"> |
| 2714 | <p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to |
| 2715 | produce a <em>combined diff</em> when showing a merge. This is the default |
| 2716 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| 2717 | <a href="git-show.html">git-show(1)</a>. Note also that you can give suitable |
| 2718 | <code>--diff-merges</code> option to any of these commands to force generation of |
| 2719 | diffs in a specific format.</p> |
| 2720 | </div> |
| 2721 | <div class="paragraph"> |
| 2722 | <p>A "combined diff" format looks like this:</p> |
| 2723 | </div> |
| 2724 | <div class="listingblock"> |
| 2725 | <div class="content"> |
| 2726 | <pre>diff --combined describe.c |
| 2727 | index fabadb8,cc95eb0..4866510 |
| 2728 | --- a/describe.c |
| 2729 | +++ b/describe.c |
| 2730 | @@@ -98,20 -98,12 +98,20 @@@ |
| 2731 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
| 2732 | } |
| 2733 | |
| 2734 | - static void describe(char *arg) |
| 2735 | -static void describe(struct commit *cmit, int last_one) |
| 2736 | ++static void describe(char *arg, int last_one) |
| 2737 | { |
| 2738 | + unsigned char sha1[20]; |
| 2739 | + struct commit *cmit; |
| 2740 | struct commit_list *list; |
| 2741 | static int initialized = 0; |
| 2742 | struct commit_name *n; |
| 2743 | |
| 2744 | + if (get_sha1(arg, sha1) < 0) |
| 2745 | + usage(describe_usage); |
| 2746 | + cmit = lookup_commit_reference(sha1); |
| 2747 | + if (!cmit) |
| 2748 | + usage(describe_usage); |
| 2749 | + |
| 2750 | if (!initialized) { |
| 2751 | initialized = 1; |
| 2752 | for_each_ref(get_name);</pre> |
| 2753 | </div> |
| 2754 | </div> |
| 2755 | <div class="olist arabic"> |
| 2756 | <ol class="arabic"> |
| 2757 | <li> |
| 2758 | <p>It is preceded by a "git diff" header, that looks like |
| 2759 | this (when the <code>-c</code> option is used):</p> |
| 2760 | <div class="literalblock"> |
| 2761 | <div class="content"> |
| 2762 | <pre>diff --combined file</pre> |
| 2763 | </div> |
| 2764 | </div> |
| 2765 | <div class="paragraph"> |
| 2766 | <p>or like this (when the <code>--cc</code> option is used):</p> |
| 2767 | </div> |
| 2768 | <div class="literalblock"> |
| 2769 | <div class="content"> |
| 2770 | <pre>diff --cc file</pre> |
| 2771 | </div> |
| 2772 | </div> |
| 2773 | </li> |
| 2774 | <li> |
| 2775 | <p>It is followed by one or more extended header lines |
| 2776 | (this example shows a merge with two parents):</p> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2777 | <div class="verseblock"> |
| 2778 | <pre class="content"><code>index</code> <em><hash></em><code>,</code><em><hash></em>`..<code>__</code><em><hash></em><code>__</code> |
| 2779 | {empty}`mode <em><mode></em><code>,</code><em><mode></em>``..``<em><mode></em> |
| 2780 | <code>new</code> <code>file</code> <code>mode</code> <em><mode></em> |
| 2781 | <code>deleted</code> <code>file</code> <code>mode</code> <em><mode></em><code>,</code><em><mode></em></pre> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2782 | </div> |
| 2783 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2784 | <p>The <code>mode</code> <em><mode></em><code>,</code><em><mode></em><code>..</code><em><mode></em> line appears only if at least one of |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2785 | the <mode> is different from the rest. Extended headers with |
| 2786 | information about detected content movement (renames and |
| 2787 | copying detection) are designed to work with the diff of two |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2788 | <em><tree-ish></em> and are not used by combined diff format.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2789 | </div> |
| 2790 | </li> |
| 2791 | <li> |
| 2792 | <p>It is followed by a two-line from-file/to-file header:</p> |
| 2793 | <div class="literalblock"> |
| 2794 | <div class="content"> |
| 2795 | <pre>--- a/file |
| 2796 | +++ b/file</pre> |
| 2797 | </div> |
| 2798 | </div> |
| 2799 | <div class="paragraph"> |
| 2800 | <p>Similar to the two-line header for the traditional <em>unified</em> diff |
| 2801 | format, <code>/dev/null</code> is used to signal created or deleted |
| 2802 | files.</p> |
| 2803 | </div> |
| 2804 | <div class="paragraph"> |
| 2805 | <p>However, if the --combined-all-paths option is provided, instead of a |
| 2806 | two-line from-file/to-file, you get an N+1 line from-file/to-file header, |
| 2807 | where N is the number of parents in the merge commit:</p> |
| 2808 | </div> |
| 2809 | <div class="literalblock"> |
| 2810 | <div class="content"> |
| 2811 | <pre>--- a/file |
| 2812 | --- a/file |
| 2813 | --- a/file |
| 2814 | +++ b/file</pre> |
| 2815 | </div> |
| 2816 | </div> |
| 2817 | <div class="paragraph"> |
| 2818 | <p>This extended format can be useful if rename or copy detection is |
| 2819 | active, to allow you to see the original name of the file in different |
| 2820 | parents.</p> |
| 2821 | </div> |
| 2822 | </li> |
| 2823 | <li> |
| 2824 | <p>Chunk header format is modified to prevent people from |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2825 | accidentally feeding it to <code>patch</code> <code>-p1</code>. Combined diff format |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2826 | was created for review of merge commit changes, and was not |
| 2827 | meant to be applied. The change is similar to the change in the |
| 2828 | extended <em>index</em> header:</p> |
| 2829 | <div class="literalblock"> |
| 2830 | <div class="content"> |
| 2831 | <pre>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</pre> |
| 2832 | </div> |
| 2833 | </div> |
| 2834 | <div class="paragraph"> |
| 2835 | <p>There are (number of parents + 1) <code>@</code> characters in the chunk |
| 2836 | header for combined diff format.</p> |
| 2837 | </div> |
| 2838 | </li> |
| 2839 | </ol> |
| 2840 | </div> |
| 2841 | <div class="paragraph"> |
| 2842 | <p>Unlike the traditional <em>unified</em> diff format, which shows two |
| 2843 | files A and B with a single column that has <code>-</code> (minus — appears in A but removed in B), <code>+</code> (plus — missing in A but |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2844 | added to B), or " " (space — unchanged) prefix, this format |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2845 | compares two or more files file1, file2,…​ with one file X, and |
| 2846 | shows how X differs from each of fileN. One column for each of |
| 2847 | fileN is prepended to the output line to note how X’s line is |
| 2848 | different from it.</p> |
| 2849 | </div> |
| 2850 | <div class="paragraph"> |
| 2851 | <p>A <code>-</code> character in the column N means that the line appears in |
| 2852 | fileN but it does not appear in the result. A <code>+</code> character |
| 2853 | in the column N means that the line appears in the result, |
| 2854 | and fileN does not have that line (in other words, the line was |
| 2855 | added, from the point of view of that parent).</p> |
| 2856 | </div> |
| 2857 | <div class="paragraph"> |
| 2858 | <p>In the above example output, the function signature was changed |
| 2859 | from both files (hence two <code>-</code> removals from both file1 and |
| 2860 | file2, plus <code>++</code> to mean one line that was added does not appear |
| 2861 | in either file1 or file2). Also, eight other lines are the same |
| 2862 | from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p> |
| 2863 | </div> |
| 2864 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2865 | <p>When shown by <code>git</code> <code>diff-tree</code> <code>-c</code>, it compares the parents of a |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2866 | merge commit with the merge result (i.e. file1..fileN are the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 2867 | parents). When shown by <code>git</code> <code>diff-files</code> <code>-c</code>, it compares the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2868 | two unresolved merge parents with the working tree file |
| 2869 | (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka |
| 2870 | "their version").</p> |
| 2871 | </div> |
| 2872 | </div> |
| 2873 | </div> |
| 2874 | <div class="sect1"> |
| 2875 | <h2 id="_other_diff_formats">other diff formats</h2> |
| 2876 | <div class="sectionbody"> |
| 2877 | <div class="paragraph"> |
| 2878 | <p>The <code>--summary</code> option describes newly added, deleted, renamed and |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2879 | copied files. The <code>--stat</code> option adds <code>diffstat</code>(1) graph to the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2880 | output. These options can be combined with other options, such as |
| 2881 | <code>-p</code>, and are meant for human consumption.</p> |
| 2882 | </div> |
| 2883 | <div class="paragraph"> |
| 2884 | <p>When showing a change that involves a rename or a copy, <code>--stat</code> output |
| 2885 | formats the pathnames compactly by combining common prefix and suffix of |
| 2886 | the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to |
| 2887 | <code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p> |
| 2888 | </div> |
| 2889 | <div class="listingblock"> |
| 2890 | <div class="content"> |
| 2891 | <pre>arch/{i386 => x86}/Makefile | 4 +--</pre> |
| 2892 | </div> |
| 2893 | </div> |
| 2894 | <div class="paragraph"> |
| 2895 | <p>The <code>--numstat</code> option gives the diffstat(1) information but is designed |
| 2896 | for easier machine consumption. An entry in <code>--numstat</code> output looks |
| 2897 | like this:</p> |
| 2898 | </div> |
| 2899 | <div class="listingblock"> |
| 2900 | <div class="content"> |
| 2901 | <pre>1 2 README |
| 2902 | 3 1 arch/{i386 => x86}/Makefile</pre> |
| 2903 | </div> |
| 2904 | </div> |
| 2905 | <div class="paragraph"> |
| 2906 | <p>That is, from left to right:</p> |
| 2907 | </div> |
| 2908 | <div class="olist arabic"> |
| 2909 | <ol class="arabic"> |
| 2910 | <li> |
| 2911 | <p>the number of added lines;</p> |
| 2912 | </li> |
| 2913 | <li> |
| 2914 | <p>a tab;</p> |
| 2915 | </li> |
| 2916 | <li> |
| 2917 | <p>the number of deleted lines;</p> |
| 2918 | </li> |
| 2919 | <li> |
| 2920 | <p>a tab;</p> |
| 2921 | </li> |
| 2922 | <li> |
| 2923 | <p>pathname (possibly with rename/copy information);</p> |
| 2924 | </li> |
| 2925 | <li> |
| 2926 | <p>a newline.</p> |
| 2927 | </li> |
| 2928 | </ol> |
| 2929 | </div> |
| 2930 | <div class="paragraph"> |
| 2931 | <p>When <code>-z</code> output option is in effect, the output is formatted this way:</p> |
| 2932 | </div> |
| 2933 | <div class="listingblock"> |
| 2934 | <div class="content"> |
| 2935 | <pre>1 2 README NUL |
| 2936 | 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</pre> |
| 2937 | </div> |
| 2938 | </div> |
| 2939 | <div class="paragraph"> |
| 2940 | <p>That is:</p> |
| 2941 | </div> |
| 2942 | <div class="olist arabic"> |
| 2943 | <ol class="arabic"> |
| 2944 | <li> |
| 2945 | <p>the number of added lines;</p> |
| 2946 | </li> |
| 2947 | <li> |
| 2948 | <p>a tab;</p> |
| 2949 | </li> |
| 2950 | <li> |
| 2951 | <p>the number of deleted lines;</p> |
| 2952 | </li> |
| 2953 | <li> |
| 2954 | <p>a tab;</p> |
| 2955 | </li> |
| 2956 | <li> |
| 2957 | <p>a NUL (only exists if renamed/copied);</p> |
| 2958 | </li> |
| 2959 | <li> |
| 2960 | <p>pathname in preimage;</p> |
| 2961 | </li> |
| 2962 | <li> |
| 2963 | <p>a NUL (only exists if renamed/copied);</p> |
| 2964 | </li> |
| 2965 | <li> |
| 2966 | <p>pathname in postimage (only exists if renamed/copied);</p> |
| 2967 | </li> |
| 2968 | <li> |
| 2969 | <p>a NUL.</p> |
| 2970 | </li> |
| 2971 | </ol> |
| 2972 | </div> |
| 2973 | <div class="paragraph"> |
| 2974 | <p>The extra <code>NUL</code> before the preimage path in renamed case is to allow |
| 2975 | scripts that read the output to tell if the current record being read is |
| 2976 | a single-path record or a rename/copy record without reading ahead. |
| 2977 | After reading added and deleted lines, reading up to <code>NUL</code> would yield |
| 2978 | the pathname, but if that is <code>NUL</code>, the record will show two paths.</p> |
| 2979 | </div> |
| 2980 | </div> |
| 2981 | </div> |
| 2982 | <div class="sect1"> |
| 2983 | <h2 id="_git">GIT</h2> |
| 2984 | <div class="sectionbody"> |
| 2985 | <div class="paragraph"> |
| 2986 | <p>Part of the <a href="git.html">git(1)</a> suite</p> |
| 2987 | </div> |
| 2988 | </div> |
| 2989 | </div> |
| 2990 | </div> |
| 2991 | <div id="footer"> |
| 2992 | <div id="footer-text"> |
Junio C Hamano | 7f7e6a4 | 2024-12-04 04:45:58 | [diff] [blame^] | 2993 | Last updated 2024-08-22 06:01:26 +0900 |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 2994 | </div> |
| 2995 | </div> |
| 2996 | </body> |
| 2997 | </html> |