diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt index dc7d725ea1..8890754740 100644 --- a/Documentation/git-mailinfo.txt +++ b/Documentation/git-mailinfo.txt @@ -8,7 +8,7 @@ git-mailinfo - Extracts patch from a single e-mail message. SYNOPSIS -------- -'git-mailinfo' [-k] [-u] +'git-mailinfo' [-k] [-u | --encoding=] DESCRIPTION @@ -37,10 +37,17 @@ OPTIONS 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 utf-8 by transliterating them. + 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. +--encoding=:: + Similar to -u but if the local convention is different + from what is specified by i18n.commitencoding, this flag + can be used to override it. + :: The commit log message extracted from e-mail, usually except the title line which comes from e-mail Subject. diff --git a/mailinfo.c b/mailinfo.c index de105acaa8..890e3487ad 100644 --- a/mailinfo.c +++ b/mailinfo.c @@ -717,7 +717,7 @@ static void handle_body(void) } static const char mailinfo_usage[] = - "git-mailinfo [-k] [-u] msg patch info"; + "git-mailinfo [-k] [-u | --encoding=] msg patch info"; int main(int argc, char **argv) { @@ -731,8 +731,8 @@ int main(int argc, char **argv) keep_subject = 1; else if (!strcmp(argv[1], "-u")) metainfo_charset = git_commit_encoding; - else if (!strncmp(argv[1], "-u=", 3)) - metainfo_charset = argv[1] + 3; + else if (!strncmp(argv[1], "--encoding=", 11)) + metainfo_charset = argv[1] + 11; else usage(mailinfo_usage); argc--; argv++;