Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 7.0.2" /> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
| 19 | a { color: blue; } |
| 20 | a:visited { color: fuchsia; } |
| 21 | |
| 22 | em { |
| 23 | font-style: italic; |
| 24 | } |
| 25 | |
| 26 | strong { |
| 27 | font-weight: bold; |
| 28 | } |
| 29 | |
| 30 | tt { |
| 31 | color: navy; |
| 32 | } |
| 33 | |
| 34 | h1, h2, h3, h4, h5, h6 { |
| 35 | color: #527bbd; |
| 36 | font-family: sans-serif; |
| 37 | margin-top: 1.2em; |
| 38 | margin-bottom: 0.5em; |
| 39 | line-height: 1.3; |
| 40 | } |
| 41 | |
| 42 | h1 { |
| 43 | border-bottom: 2px solid silver; |
| 44 | } |
| 45 | h2 { |
| 46 | border-bottom: 2px solid silver; |
| 47 | padding-top: 0.5em; |
| 48 | } |
| 49 | |
| 50 | div.sectionbody { |
| 51 | font-family: serif; |
| 52 | margin-left: 0; |
| 53 | } |
| 54 | |
| 55 | hr { |
| 56 | border: 1px solid silver; |
| 57 | } |
| 58 | |
| 59 | p { |
| 60 | margin-top: 0.5em; |
| 61 | margin-bottom: 0.5em; |
| 62 | } |
| 63 | |
| 64 | pre { |
| 65 | padding: 0; |
| 66 | margin: 0; |
| 67 | } |
| 68 | |
| 69 | span#author { |
| 70 | color: #527bbd; |
| 71 | font-family: sans-serif; |
| 72 | font-weight: bold; |
| 73 | font-size: 1.2em; |
| 74 | } |
| 75 | span#email { |
| 76 | } |
| 77 | span#revision { |
| 78 | font-family: sans-serif; |
| 79 | } |
| 80 | |
| 81 | div#footer { |
| 82 | font-family: sans-serif; |
| 83 | font-size: small; |
| 84 | border-top: 2px solid silver; |
| 85 | padding-top: 0.5em; |
| 86 | margin-top: 4.0em; |
| 87 | } |
| 88 | div#footer-text { |
| 89 | float: left; |
| 90 | padding-bottom: 0.5em; |
| 91 | } |
| 92 | div#footer-badges { |
| 93 | float: right; |
| 94 | padding-bottom: 0.5em; |
| 95 | } |
| 96 | |
| 97 | div#preamble, |
| 98 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 99 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 100 | div.admonitionblock { |
| 101 | margin-right: 10%; |
| 102 | margin-top: 1.5em; |
| 103 | margin-bottom: 1.5em; |
| 104 | } |
| 105 | div.admonitionblock { |
| 106 | margin-top: 2.5em; |
| 107 | margin-bottom: 2.5em; |
| 108 | } |
| 109 | |
| 110 | div.content { /* Block element content. */ |
| 111 | padding: 0; |
| 112 | } |
| 113 | |
| 114 | /* Block element titles. */ |
| 115 | div.title, caption.title { |
| 116 | font-family: sans-serif; |
| 117 | font-weight: bold; |
| 118 | text-align: left; |
| 119 | margin-top: 1.0em; |
| 120 | margin-bottom: 0.5em; |
| 121 | } |
| 122 | div.title + * { |
| 123 | margin-top: 0; |
| 124 | } |
| 125 | |
| 126 | td div.title:first-child { |
| 127 | margin-top: 0.0em; |
| 128 | } |
| 129 | div.content div.title:first-child { |
| 130 | margin-top: 0.0em; |
| 131 | } |
| 132 | div.content + div.title { |
| 133 | margin-top: 0.0em; |
| 134 | } |
| 135 | |
| 136 | div.sidebarblock > div.content { |
| 137 | background: #ffffee; |
| 138 | border: 1px solid silver; |
| 139 | padding: 0.5em; |
| 140 | } |
| 141 | |
| 142 | div.listingblock > div.content { |
| 143 | border: 1px solid silver; |
| 144 | background: #f4f4f4; |
| 145 | padding: 0.5em; |
| 146 | } |
| 147 | |
| 148 | div.quoteblock > div.content { |
| 149 | padding-left: 2.0em; |
| 150 | } |
| 151 | div.quoteblock .attribution { |
| 152 | text-align: right; |
| 153 | } |
| 154 | |
| 155 | div.admonitionblock .icon { |
| 156 | vertical-align: top; |
| 157 | font-size: 1.1em; |
| 158 | font-weight: bold; |
| 159 | text-decoration: underline; |
| 160 | color: #527bbd; |
| 161 | padding-right: 0.5em; |
| 162 | } |
| 163 | div.admonitionblock td.content { |
| 164 | padding-left: 0.5em; |
| 165 | border-left: 2px solid silver; |
| 166 | } |
| 167 | |
| 168 | div.exampleblock > div.content { |
| 169 | border-left: 2px solid silver; |
| 170 | padding: 0.5em; |
| 171 | } |
| 172 | |
| 173 | div.verseblock div.content { |
| 174 | white-space: pre; |
| 175 | } |
| 176 | |
| 177 | div.imageblock div.content { padding-left: 0; } |
| 178 | div.imageblock img { border: 1px solid silver; } |
| 179 | span.image img { border-style: none; } |
| 180 | |
| 181 | dl { |
| 182 | margin-top: 0.8em; |
| 183 | margin-bottom: 0.8em; |
| 184 | } |
| 185 | dt { |
| 186 | margin-top: 0.5em; |
| 187 | margin-bottom: 0; |
| 188 | font-style: italic; |
| 189 | } |
| 190 | dd > *:first-child { |
| 191 | margin-top: 0; |
| 192 | } |
| 193 | |
| 194 | ul, ol { |
| 195 | list-style-position: outside; |
| 196 | } |
| 197 | ol.olist2 { |
| 198 | list-style-type: lower-alpha; |
| 199 | } |
| 200 | |
| 201 | div.tableblock > table { |
| 202 | border-color: #527bbd; |
| 203 | border-width: 3px; |
| 204 | } |
| 205 | thead { |
| 206 | font-family: sans-serif; |
| 207 | font-weight: bold; |
| 208 | } |
| 209 | tfoot { |
| 210 | font-weight: bold; |
| 211 | } |
| 212 | |
| 213 | div.hlist { |
| 214 | margin-top: 0.8em; |
| 215 | margin-bottom: 0.8em; |
| 216 | } |
| 217 | td.hlist1 { |
| 218 | vertical-align: top; |
| 219 | font-style: italic; |
| 220 | padding-right: 0.8em; |
| 221 | } |
| 222 | td.hlist2 { |
| 223 | vertical-align: top; |
| 224 | } |
| 225 | |
| 226 | @media print { |
| 227 | div#footer-badges { display: none; } |
| 228 | } |
| 229 | include::./stylesheets/xhtml11-manpage.css[] |
| 230 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 231 | |
| 232 | div.sidebar-content { |
| 233 | background: #ffffee; |
| 234 | border: 1px solid silver; |
| 235 | padding: 0.5em; |
| 236 | } |
| 237 | div.sidebar-title, div.image-title { |
| 238 | font-family: sans-serif; |
| 239 | font-weight: bold; |
| 240 | margin-top: 0.0em; |
| 241 | margin-bottom: 0.5em; |
| 242 | } |
| 243 | |
| 244 | div.listingblock div.content { |
| 245 | border: 1px solid silver; |
| 246 | background: #f4f4f4; |
| 247 | padding: 0.5em; |
| 248 | } |
| 249 | |
| 250 | div.quoteblock-content { |
| 251 | padding-left: 2.0em; |
| 252 | } |
| 253 | |
| 254 | div.exampleblock-content { |
| 255 | border-left: 2px solid silver; |
| 256 | padding-left: 0.5em; |
| 257 | } |
| 258 | </style> |
| 259 | <title>git-commit-tree(1)</title> |
| 260 | </head> |
| 261 | <body> |
| 262 | <div id="header"> |
| 263 | <h1> |
| 264 | git-commit-tree(1) Manual Page |
| 265 | </h1> |
| 266 | <h2>NAME</h2> |
| 267 | <div class="sectionbody"> |
| 268 | <p>git-commit-tree - |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 269 | Create a new commit object |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 270 | </p> |
| 271 | </div> |
| 272 | </div> |
| 273 | <h2>SYNOPSIS</h2> |
| 274 | <div class="sectionbody"> |
| 275 | <p><em>git-commit-tree</em> <tree> [-p <parent commit>]* < changelog</p> |
| 276 | </div> |
| 277 | <h2>DESCRIPTION</h2> |
| 278 | <div class="sectionbody"> |
Junio C Hamano | e58607f | 2007-01-17 23:27:45 | [diff] [blame] | 279 | <p>This is usually not what an end user wants to run directly. See |
| 280 | <a href="git-commit.html">git-commit(1)</a> instead.</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 281 | <p>Creates a new commit object based on the provided tree object and |
| 282 | emits the new commit object id on stdout. If no parent is given then |
| 283 | it is considered to be an initial tree.</p> |
| 284 | <p>A commit object usually has 1 parent (a commit after a change) or up |
| 285 | to 16 parents. More than one parent represents a merge of branches |
| 286 | that led to them.</p> |
| 287 | <p>While a tree represents a particular directory state of a working |
| 288 | directory, a commit represents that state in "time", and explains how |
| 289 | to get there.</p> |
| 290 | <p>Normally a commit would identify a new "HEAD" state, and while git |
| 291 | doesn't care where you save the note about that state, in practice we |
| 292 | tend to just write the result to the file that is pointed at by |
| 293 | <tt>.git/HEAD</tt>, so that we can always see what the last committed |
| 294 | state was.</p> |
| 295 | </div> |
| 296 | <h2>OPTIONS</h2> |
| 297 | <div class="sectionbody"> |
| 298 | <dl> |
| 299 | <dt> |
| 300 | <tree> |
| 301 | </dt> |
| 302 | <dd> |
| 303 | <p> |
| 304 | An existing tree object |
| 305 | </p> |
| 306 | </dd> |
| 307 | <dt> |
| 308 | -p <parent commit> |
| 309 | </dt> |
| 310 | <dd> |
| 311 | <p> |
| 312 | Each <em>-p</em> indicates the id of a parent commit object. |
| 313 | </p> |
| 314 | </dd> |
| 315 | </dl> |
| 316 | </div> |
| 317 | <h2>Commit Information</h2> |
| 318 | <div class="sectionbody"> |
| 319 | <p>A commit encapsulates:</p> |
| 320 | <ul> |
| 321 | <li> |
| 322 | <p> |
| 323 | all parent object ids |
| 324 | </p> |
| 325 | </li> |
| 326 | <li> |
| 327 | <p> |
| 328 | author name, email and date |
| 329 | </p> |
| 330 | </li> |
| 331 | <li> |
| 332 | <p> |
| 333 | committer name and email and the commit time. |
| 334 | </p> |
| 335 | </li> |
| 336 | </ul> |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 337 | <p>While parent object ids are provided on the command line, author and |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 338 | committer information is taken from the following environment variables, |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 339 | if set:</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 340 | <div class="literalblock"> |
| 341 | <div class="content"> |
| 342 | <pre><tt>GIT_AUTHOR_NAME |
| 343 | GIT_AUTHOR_EMAIL |
| 344 | GIT_AUTHOR_DATE |
| 345 | GIT_COMMITTER_NAME |
Junio C Hamano | 469d60e | 2007-04-29 18:30:34 | [diff] [blame] | 346 | GIT_COMMITTER_EMAIL |
| 347 | GIT_COMMITTER_DATE |
| 348 | EMAIL</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 349 | </div></div> |
| 350 | <p>(nb "<", ">" and "\n"s are stripped)</p> |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 351 | <p>In case (some of) these environment variables are not set, the information |
| 352 | is taken from the configuration items user.name and user.email, or, if not |
| 353 | present, system user name and fully qualified hostname.</p> |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 354 | <p>A commit comment is read from stdin. If a changelog |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 355 | entry is not provided via "<" redirection, "git-commit-tree" will just wait |
| 356 | for one to be entered and terminated with ^D.</p> |
| 357 | </div> |
| 358 | <h2>Diagnostics</h2> |
| 359 | <div class="sectionbody"> |
| 360 | <dl> |
| 361 | <dt> |
| 362 | You don't exist. Go away! |
| 363 | </dt> |
| 364 | <dd> |
| 365 | <p> |
| 366 | The passwd(5) gecos field couldn't be read |
| 367 | </p> |
| 368 | </dd> |
| 369 | <dt> |
| 370 | Your parents must have hated you! |
| 371 | </dt> |
| 372 | <dd> |
| 373 | <p> |
| 374 | The password(5) gecos field is longer than a giant static buffer. |
| 375 | </p> |
| 376 | </dd> |
| 377 | <dt> |
| 378 | Your sysadmin must hate you! |
| 379 | </dt> |
| 380 | <dd> |
| 381 | <p> |
| 382 | The password(5) name field is longer than a giant static buffer. |
| 383 | </p> |
| 384 | </dd> |
| 385 | </dl> |
| 386 | </div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 387 | <h2>Discussion</h2> |
| 388 | <div class="sectionbody"> |
| 389 | <p>At the core level, git is character encoding agnostic.</p> |
| 390 | <ul> |
| 391 | <li> |
| 392 | <p> |
| 393 | The pathnames recorded in the index and in the tree objects |
| 394 | are treated as uninterpreted sequences of non-NUL bytes. |
| 395 | What readdir(2) returns are what are recorded and compared |
| 396 | with the data git keeps track of, which in turn are expected |
| 397 | to be what lstat(2) and creat(2) accepts. There is no such |
| 398 | thing as pathname encoding translation. |
| 399 | </p> |
| 400 | </li> |
| 401 | <li> |
| 402 | <p> |
| 403 | The contents of the blob objects are uninterpreted sequence |
| 404 | of bytes. There is no encoding translation at the core |
| 405 | level. |
| 406 | </p> |
| 407 | </li> |
| 408 | <li> |
| 409 | <p> |
| 410 | The commit log messages are uninterpreted sequence of non-NUL |
| 411 | bytes. |
| 412 | </p> |
| 413 | </li> |
| 414 | </ul> |
| 415 | <p>Although we encourage that the commit log messages are encoded |
| 416 | in UTF-8, both the core and git Porcelain are designed not to |
| 417 | force UTF-8 on projects. If all participants of a particular |
| 418 | project find it more convenient to use legacy encodings, git |
| 419 | does not forbid it. However, there are a few things to keep in |
| 420 | mind.</p> |
| 421 | <ol> |
| 422 | <li> |
| 423 | <p> |
| 424 | <tt>git-commit-tree</tt> (hence, <tt>git-commit</tt> which uses it) issues |
Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 425 | a warning if the commit log message given to it does not look |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 426 | like a valid UTF-8 string, unless you explicitly say your |
| 427 | project uses a legacy encoding. The way to say this is to |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 428 | have i18n.commitencoding in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 429 | </p> |
| 430 | <div class="listingblock"> |
| 431 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 432 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 433 | commitencoding = ISO-8859-1</tt></pre> |
| 434 | </div></div> |
| 435 | <p>Commit objects created with the above setting record the value |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 436 | of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 437 | help other people who look at them later. Lack of this header |
| 438 | implies that the commit log message is encoded in UTF-8.</p> |
| 439 | </li> |
| 440 | <li> |
| 441 | <p> |
| 442 | <tt>git-log</tt>, <tt>git-show</tt> and friends looks at the <tt>encoding</tt> |
| 443 | header of a commit object, and tries to re-code the log |
| 444 | message into UTF-8 unless otherwise specified. You can |
| 445 | specify the desired output encoding with |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 446 | <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 447 | </p> |
| 448 | <div class="listingblock"> |
| 449 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 450 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 451 | logoutputencoding = ISO-8859-1</tt></pre> |
| 452 | </div></div> |
| 453 | <p>If you do not have this configuration variable, the value of |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 454 | <tt>i18n.commitencoding</tt> is used instead.</p> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 455 | </li> |
| 456 | </ol> |
| 457 | <p>Note that we deliberately chose not to re-code the commit log |
| 458 | message when a commit is made to force UTF-8 at the commit |
| 459 | object level, because re-coding to UTF-8 is not necessarily a |
| 460 | reversible operation.</p> |
| 461 | </div> |
Junio C Hamano | 9049d91 | 2008-05-29 02:09:50 | [diff] [blame] | 462 | <h2>SEE ALSO</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 463 | <div class="sectionbody"> |
| 464 | <p><a href="git-write-tree.html">git-write-tree(1)</a></p> |
| 465 | </div> |
| 466 | <h2>Author</h2> |
| 467 | <div class="sectionbody"> |
| 468 | <p>Written by Linus Torvalds <torvalds@osdl.org></p> |
| 469 | </div> |
| 470 | <h2>Documentation</h2> |
| 471 | <div class="sectionbody"> |
| 472 | <p>Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.</p> |
| 473 | </div> |
| 474 | <h2>GIT</h2> |
| 475 | <div class="sectionbody"> |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 476 | <p>Part of the <a href="git.html">git(1)</a> suite</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 477 | </div> |
| 478 | <div id="footer"> |
| 479 | <div id="footer-text"> |
Junio C Hamano | e2b205c | 2008-06-08 01:43:44 | [diff] [blame] | 480 | Last updated 08-Jun-2008 01:33:27 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 481 | </div> |
| 482 | </div> |
| 483 | </body> |
| 484 | </html> |