summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 62c89c6)
raw | patch | inline | side by side (parent: 62c89c6)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 10 Jan 2007 05:31:36 +0000 (21:31 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 10 Jan 2007 05:32:49 +0000 (21:32 -0800) |
Originally from David Woodhouse, but also adjusts the callers of
mailinfo to the new default.
Signed-off-by: Junio C Hamano <junkio@cox.net>
mailinfo to the new default.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-mailinfo.txt | patch | blob | history | |
builtin-mailinfo.c | patch | blob | history | |
git-am.sh | patch | blob | history | |
git-applymbox.sh | patch | blob | history |
index ea0a06557f933ce48374ddbb751a64945ff65955..5088bbea84c0e6b681641b78b816755fa12f6b6d 100644 (file)
format-patch --mbox' output.
-u::
- By default, the commit log message, author name and
- author email are taken from the e-mail without any
- charset conversion, after minimally decoding MIME
- transfer encoding. This flag causes the resulting
- commit to be encoded in the encoding specified by
- i18n.commitencoding configuration (defaults to utf-8) by
- transliterating them.
- Note that the patch is always used as is without charset
- conversion, even with this flag.
+ The commit log message, author name and author email are
+ taken from the e-mail, and after minimally decoding MIME
+ transfer encoding, re-coded in UTF-8 by transliterating
+ them. This used to be optional but now it is the default.
++
+Note that the patch is always used as-is without charset
+conversion, even with this flag.
--encoding=<encoding>::
Similar to -u but if the local convention is different
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index a67f3eb90b6f715714c6fa7bb931044630c74111..583da38b6750185eb38f04d91555aa75ee4a77b0 100644 (file)
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
char *input_charset = *charset ? charset : latin_one;
char *out = reencode_string(line, metainfo_charset, input_charset);
- if (!out) {
- fprintf(stderr, "cannot convert from %s to %s\n",
- input_charset, metainfo_charset);
- *charset = 0;
- return;
- }
+ if (!out)
+ die("cannot convert from %s to %s\n",
+ input_charset, metainfo_charset);
strcpy(line, out);
free(out);
}
int cmd_mailinfo(int argc, const char **argv, const char *prefix)
{
+ const char *def_charset;
+
/* NEEDSWORK: might want to do the optional .git/ directory
* discovery
*/
git_config(git_default_config);
+ def_charset = (git_commit_encoding ? git_commit_encoding : "utf-8");
+ metainfo_charset = def_charset;
+
while (1 < argc && argv[1][0] == '-') {
if (!strcmp(argv[1], "-k"))
keep_subject = 1;
else if (!strcmp(argv[1], "-u"))
- metainfo_charset = (git_commit_encoding
- ? git_commit_encoding : "utf-8");
+ metainfo_charset = def_charset;
+ else if (!strcmp(argv[1], "-n"))
+ metainfo_charset = NULL;
else if (!strncmp(argv[1], "--encoding=", 11))
metainfo_charset = argv[1] + 11;
else
diff --git a/git-am.sh b/git-am.sh
index abd32a8b1cc27ae26a89b6e6aa9561e862e3e688..59d663ba9e0c3828d11b442c6fd9536a87d937cb 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
if test "$(cat "$dotest/utf8")" = t
then
utf8=-u
+else
+ utf8=-n
fi
if test "$(cat "$dotest/keep")" = t
then
diff --git a/git-applymbox.sh b/git-applymbox.sh
index 7e690a16ee40c957b83770cf115190c53edd3013..1f68599ae51a671f8c7a3a01c6aa9c6b205dd217 100755 (executable)
--- a/git-applymbox.sh
+++ b/git-applymbox.sh
do
case "$1" in
-u) utf8=-u ;;
- -n) utf8= ;;
+ -n) utf8=-n ;;
-k) keep_subject=-k ;;
-q) query_apply=t ;;
-c) continue="$2"; resume=f; shift ;;