@matheusbsbs / matheus-bagliano / commits / 5dc7bcc245
Fork 0

Documentation: i18n commit log message notes.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 30, 2006 at 02:22 UTC 5dc7bcc2453ce854dc1192cfffcc8aee1cc3b69d
5 files changed +78
Documentation/git-commit-tree.txt
+5
@@ -81,6 +81,11 @@ Your parents must have hated you!::
81 Your sysadmin must hate you!::
82 The password(5) name field is longer than a giant static buffer.
83
84 +Discussion
85 +----------
86 +
87 +include::i18n.txt[]
88 +
89 See Also
90 --------
91 gitlink:git-write-tree[1]
Documentation/git-commit.txt
+5
@@ -223,6 +223,11 @@ should be recorded as a single commit. In fact, the command
223 refuses to run when given pathnames (but see `-i` option).
224
225
226 +DISCUSSION
227 +----------
228 +
229 +include::i18n.txt[]
230 +
231 ENVIRONMENT VARIABLES
232 ---------------------
233 The command specified by either the VISUAL or EDITOR environment
Documentation/git-log.txt
+6
@@ -63,6 +63,12 @@ git log -r --name-status release..test::
63 in the "release" branch, along with the list of paths
64 each commit modifies.
65
66 +Discussion
67 +----------
68 +
69 +include::i18n.txt[]
70 +
71 +
72 Author
73 ------
74 Written by Linus Torvalds <torvalds@osdl.org>
Documentation/git-show.txt
+5
@@ -54,6 +54,11 @@ git show master:Makefile master:t/Makefile
54 Concatenates the contents of said Makefiles in the head
55 of the branch `master`.
56
57 +Discussion
58 +----------
59 +
60 +include::i18n.txt[]
61 +
62 Author
63 ------
64 Written by Linus Torvalds <torvalds@osdl.org> and
Documentation/i18n.txt new
+57
@@ -0,0 +1,57 @@
1 +At the core level, git is character encoding agnostic.
2 +
3 + - The pathnames recorded in the index and in the tree objects
4 + are treated as uninterpreted sequences of non-NUL bytes.
5 + What readdir(2) returns are what are recorded and compared
6 + with the data git keeps track of, which in turn are expected
7 + to be what lstat(2) and creat(2) accepts. There is no such
8 + thing as pathname encoding translation.
9 +
10 + - The contents of the blob objects are uninterpreted sequence
11 + of bytes. There is no encoding translation at the core
12 + level.
13 +
14 + - The commit log messages are uninterpreted sequence of non-NUL
15 + bytes.
16 +
17 +Although we encourage that the commit log messages are encoded
18 +in UTF-8, both the core and git Porcelain are designed not to
19 +force UTF-8 on projects. If all participants of a particular
20 +project find it more convenient to use legacy encodings, git
21 +does not forbid it. However, there are a few things to keep in
22 +mind.
23 +
24 +. `git-commit-tree` (hence, `git-commit` which uses it) issues
25 + an warning if the commit log message given to it does not look
26 + like a valid UTF-8 string, unless you explicitly say your
27 + project uses a legacy encoding. The way to say this is to
28 + have core.commitencoding in `.git/config` file, like this:
29 ++
30 +------------
31 +[core]
32 + commitencoding = ISO-8859-1
33 +------------
34 ++
35 +Commit objects created with the above setting record the value
36 +of `core.commitencoding` in its `encoding` header. This is to
37 +help other people who look at them later. Lack of this header
38 +implies that the commit log message is encoded in UTF-8.
39 +
40 +. `git-log`, `git-show` and friends looks at the `encoding`
41 + header of a commit object, and tries to re-code the log
42 + message into UTF-8 unless otherwise specified. You can
43 + specify the desired output encoding with
44 + `core.logoutputencoding` in `.git/config` file, like this:
45 ++
46 +------------
47 +[core]
48 + logoutputencoding = ISO-8859-1
49 +------------
50 ++
51 +If you do not have this configuration variable, the value of
52 +`core.commitencoding` is used instead.
53 +
54 +Note that we deliberately chose not to re-code the commit log
55 +message when a commit is made to force UTF-8 at the commit
56 +object level, because re-coding to UTF-8 is not necessarily a
57 +reversible operation.