summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-30 02:22:38 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-30 02:36:08 -0800
commit5dc7bcc2453ce854dc1192cfffcc8aee1cc3b69d (patch)
treef57dbd947565b299a87a2b29f78151f5ca43b284 /Documentation
parent000792830b8ca96e6d973545192cba8d5df48279 (diff)
downloadgit-5dc7bcc2453ce854dc1192cfffcc8aee1cc3b69d.tar.gz
Documentation: i18n commit log message notes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-commit-tree.txt5
-rw-r--r--Documentation/git-commit.txt5
-rw-r--r--Documentation/git-log.txt6
-rw-r--r--Documentation/git-show.txt5
-rw-r--r--Documentation/i18n.txt57
5 files changed, 78 insertions, 0 deletions
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index 41d1a1c4b3..77ba96ed8a 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -81,6 +81,11 @@ Your parents must have hated you!::
Your sysadmin must hate you!::
The password(5) name field is longer than a giant static buffer.
+Discussion
+----------
+
+include::i18n.txt[]
+
See Also
--------
gitlink:git-write-tree[1]
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 0b74cd708e..a7adf24fa5 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -223,6 +223,11 @@ should be recorded as a single commit. In fact, the command
refuses to run when given pathnames (but see `-i` option).
+DISCUSSION
+----------
+
+include::i18n.txt[]
+
ENVIRONMENT VARIABLES
---------------------
The command specified by either the VISUAL or EDITOR environment
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 79643ac928..c87133542a 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -63,6 +63,12 @@ git log -r --name-status release..test::
in the "release" branch, along with the list of paths
each commit modifies.
+Discussion
+----------
+
+include::i18n.txt[]
+
+
Author
------
Written by Linus Torvalds <torvalds@osdl.org>
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 98dea6125d..160abb5b24 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -54,6 +54,11 @@ git show master:Makefile master:t/Makefile
Concatenates the contents of said Makefiles in the head
of the branch `master`.
+Discussion
+----------
+
+include::i18n.txt[]
+
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and
diff --git a/Documentation/i18n.txt b/Documentation/i18n.txt
new file mode 100644
index 0000000000..b4cbb3830e
--- /dev/null
+++ b/Documentation/i18n.txt
@@ -0,0 +1,57 @@
+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 sequence
+ of bytes. There is no encoding translation at the core
+ level.
+
+ - The commit log messages are uninterpreted sequence 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-tree` (hence, `git-commit` which uses it) issues
+ an 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 core.commitencoding in `.git/config` file, like this:
++
+------------
+[core]
+ commitencoding = ISO-8859-1
+------------
++
+Commit objects created with the above setting record the value
+of `core.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` and friends looks at the `encoding`
+ header of a commit object, and tries to re-code the log
+ message into UTF-8 unless otherwise specified. You can
+ specify the desired output encoding with
+ `core.logoutputencoding` in `.git/config` file, like this:
++
+------------
+[core]
+ logoutputencoding = ISO-8859-1
+------------
++
+If you do not have this configuration variable, the value of
+`core.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.