@@ -417,6 +417,18 @@ <h2>OPTIONS</h2>
417417</ ul >
418418</ dd >
419419< dt >
420+ --encoding[=<encoding>]
421+ </ dt >
422+ < dd >
423+ < p >
424+ The commit objects record the encoding used for the log message
425+ in their encoding header; this option can be used to tell the
426+ command to re-code the commit log message in the encoding
427+ preferred by the user. For non plumbing commands this
428+ defaults to UTF-8.
429+ </ p >
430+ </ dd >
431+ < dt >
420432--max-count=<n>
421433</ dt >
422434< dd >
@@ -429,7 +441,9 @@ <h2>OPTIONS</h2>
429441</ dt >
430442< dd >
431443< p >
432- Show only commits between the named two commits.
444+ Show only commits between the named two commits. When
445+ either <since> or <until> is omitted, it defaults to
446+ < tt > HEAD</ tt > , i.e. the tip of the current branch.
433447</ p >
434448</ dd >
435449< dt >
@@ -492,6 +506,81 @@ <h2>Examples</h2>
492506</ dd >
493507</ dl >
494508</ div >
509+ < h2 > Discussion</ h2 >
510+ < div class ="sectionbody ">
511+ < p > At the core level, git is character encoding agnostic.</ p >
512+ < ul >
513+ < li >
514+ < p >
515+ The pathnames recorded in the index and in the tree objects
516+ are treated as uninterpreted sequences of non-NUL bytes.
517+ What readdir(2) returns are what are recorded and compared
518+ with the data git keeps track of, which in turn are expected
519+ to be what lstat(2) and creat(2) accepts. There is no such
520+ thing as pathname encoding translation.
521+ </ p >
522+ </ li >
523+ < li >
524+ < p >
525+ The contents of the blob objects are uninterpreted sequence
526+ of bytes. There is no encoding translation at the core
527+ level.
528+ </ p >
529+ </ li >
530+ < li >
531+ < p >
532+ The commit log messages are uninterpreted sequence of non-NUL
533+ bytes.
534+ </ p >
535+ </ li >
536+ </ ul >
537+ < p > Although we encourage that the commit log messages are encoded
538+ in UTF-8, both the core and git Porcelain are designed not to
539+ force UTF-8 on projects. If all participants of a particular
540+ project find it more convenient to use legacy encodings, git
541+ does not forbid it. However, there are a few things to keep in
542+ mind.</ p >
543+ < ol >
544+ < li >
545+ < p >
546+ < tt > git-commit-tree</ tt > (hence, < tt > git-commit</ tt > which uses it) issues
547+ an warning if the commit log message given to it does not look
548+ like a valid UTF-8 string, unless you explicitly say your
549+ project uses a legacy encoding. The way to say this is to
550+ have core.commitencoding in < tt > .git/config</ tt > file, like this:
551+ </ p >
552+ < div class ="listingblock ">
553+ < div class ="content ">
554+ < pre > < tt > [core]
555+ commitencoding = ISO-8859-1</ tt > </ pre >
556+ </ div > </ div >
557+ < p > Commit objects created with the above setting record the value
558+ of < tt > core.commitencoding</ tt > in its < tt > encoding</ tt > header. This is to
559+ help other people who look at them later. Lack of this header
560+ implies that the commit log message is encoded in UTF-8.</ p >
561+ </ li >
562+ < li >
563+ < p >
564+ < tt > git-log</ tt > , < tt > git-show</ tt > and friends looks at the < tt > encoding</ tt >
565+ header of a commit object, and tries to re-code the log
566+ message into UTF-8 unless otherwise specified. You can
567+ specify the desired output encoding with
568+ < tt > core.logoutputencoding</ tt > in < tt > .git/config</ tt > file, like this:
569+ </ p >
570+ < div class ="listingblock ">
571+ < div class ="content ">
572+ < pre > < tt > [core]
573+ logoutputencoding = ISO-8859-1</ tt > </ pre >
574+ </ div > </ div >
575+ < p > If you do not have this configuration variable, the value of
576+ < tt > core.commitencoding</ tt > is used instead.</ p >
577+ </ li >
578+ </ ol >
579+ < p > Note that we deliberately chose not to re-code the commit log
580+ message when a commit is made to force UTF-8 at the commit
581+ object level, because re-coding to UTF-8 is not necessarily a
582+ reversible operation.</ p >
583+ </ div >
495584< h2 > Author</ h2 >
496585< div class ="sectionbody ">
497586< p > Written by Linus Torvalds <torvalds@osdl.org></ p >
@@ -506,7 +595,7 @@ <h2>GIT</h2>
506595</ div >
507596< div id ="footer ">
508597< div id ="footer-text ">
509- Last updated 23-Nov -2006 02:47:21 UTC
598+ Last updated 31-Dec -2006 01:19:04 UTC
510599</ div >
511600</ div >
512601</ body >
0 commit comments