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