mailinfo: Do not use -u=<encoding>; say --encoding=<encoding>
authorJunio C Hamano <junkio@cox.net>
Mon, 28 Nov 2005 09:29:52 +0000 (01:29 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 28 Nov 2005 09:29:52 +0000 (01:29 -0800)
Specifying the value for a single letter, single dash option
parameter with equal sign looked funny, and more importantly
calling the flag to override encoding from utf-8 to something
else "-u" (obviously abbreviated from "utf-8") did not make any
sense. So spell it out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-mailinfo.txt
mailinfo.c
index dc7d725ea155f9eccb7ebab7df6335ae7589d483..8890754740e796bf5ffb815cb8ff0ec1d4b62d97 100644 (file)
@@ -8,7 +8,7 @@ git-mailinfo - Extracts patch from a single e-mail message.
 
 SYNOPSIS
 --------
 
 SYNOPSIS
 --------
-'git-mailinfo' [-k] [-u] <msg> <patch>
+'git-mailinfo' [-k] [-u | --encoding=<encoding>] <msg> <patch>
 
 
 DESCRIPTION
 
 
 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
        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.
 
        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
+       from what is specified by i18n.commitencoding, this flag
+       can be used to override it.
+
 <msg>::
        The commit log message extracted from e-mail, usually
        except the title line which comes from e-mail Subject.
 <msg>::
        The commit log message extracted from e-mail, usually
        except the title line which comes from e-mail Subject.
index de105acaa8898b637e53b9a38ca695ec9514d817..890e3487adf65b937f9a9d1ec82d59c746bf62de 100644 (file)
@@ -717,7 +717,7 @@ static void handle_body(void)
 }
 
 static const char mailinfo_usage[] =
 }
 
 static const char mailinfo_usage[] =
-       "git-mailinfo [-k] [-u] msg patch <mail >info";
+       "git-mailinfo [-k] [-u | --encoding=<encoding>] msg patch <mail >info";
 
 int main(int argc, char **argv)
 {
 
 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;
                        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++;
                else
                        usage(mailinfo_usage);
                argc--; argv++;