mirror of
https://github.com/git/git.git
synced 2024-11-14 21:23:03 +01:00
0b444cdb19
The documentation was quite inconsistent when spelling 'git cmd' if it
only refers to the program, not to some specific invocation syntax:
both 'git-cmd' and 'git cmd' spellings exist.
The current trend goes towards dashless forms, and there is precedent
in 647ac70
(git-svn.txt: stop using dash-form of commands.,
2009-07-07) to actively eliminate the dashed variants.
Replace 'git-cmd' with 'git cmd' throughout, except where git-shell,
git-cvsserver, git-upload-pack, git-receive-pack, and
git-upload-archive are concerned, because those really live in the
$PATH.
57 lines
2.2 KiB
Text
57 lines
2.2 KiB
Text
At the core level, git is character encoding agnostic.
|
|
|
|
- The pathnames recorded in the index and in the tree objects
|
|
are treated as uninterpreted sequences of non-NUL bytes.
|
|
What readdir(2) returns are what are recorded and compared
|
|
with the data git keeps track of, which in turn are expected
|
|
to be what lstat(2) and creat(2) accepts. There is no such
|
|
thing as pathname encoding translation.
|
|
|
|
- The contents of the blob objects are uninterpreted sequences
|
|
of bytes. There is no encoding translation at the core
|
|
level.
|
|
|
|
- The commit log messages are uninterpreted sequences of non-NUL
|
|
bytes.
|
|
|
|
Although we encourage that the commit log messages are encoded
|
|
in UTF-8, both the core and git Porcelain are designed not to
|
|
force UTF-8 on projects. If all participants of a particular
|
|
project find it more convenient to use legacy encodings, git
|
|
does not forbid it. However, there are a few things to keep in
|
|
mind.
|
|
|
|
. 'git commit' and 'git commit-tree' issues
|
|
a warning if the commit log message given to it does not look
|
|
like a valid UTF-8 string, unless you explicitly say your
|
|
project uses a legacy encoding. The way to say this is to
|
|
have i18n.commitencoding in `.git/config` file, like this:
|
|
+
|
|
------------
|
|
[i18n]
|
|
commitencoding = ISO-8859-1
|
|
------------
|
|
+
|
|
Commit objects created with the above setting record the value
|
|
of `i18n.commitencoding` in its `encoding` header. This is to
|
|
help other people who look at them later. Lack of this header
|
|
implies that the commit log message is encoded in UTF-8.
|
|
|
|
. 'git log', 'git show', 'git blame' and friends look at the
|
|
`encoding` header of a commit object, and try to re-code the
|
|
log message into UTF-8 unless otherwise specified. You can
|
|
specify the desired output encoding with
|
|
`i18n.logoutputencoding` in `.git/config` file, like this:
|
|
+
|
|
------------
|
|
[i18n]
|
|
logoutputencoding = ISO-8859-1
|
|
------------
|
|
+
|
|
If you do not have this configuration variable, the value of
|
|
`i18n.commitencoding` is used instead.
|
|
|
|
Note that we deliberately chose not to re-code the commit log
|
|
message when a commit is made to force UTF-8 at the commit
|
|
object level, because re-coding to UTF-8 is not necessarily a
|
|
reversible operation.
|