@matheusbsbs / matheus-bagliano / commits / 9f63892b38
Fork 0

mailinfo: Do not use -u=<encoding>; say --encoding=<encoding>

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>

Junio C Hamano committed Nov 28, 2005 at 01:29 UTC 9f63892b3803701c97259d51143e199fe9603d3f
2 files changed +12 -5
Documentation/git-mailinfo.txt
+9 -2
@@ -8,7 +8,7 @@ git-mailinfo - Extracts patch from a single e-mail message.
8
9 SYNOPSIS
10 --------
11 -'git-mailinfo' [-k] [-u] <msg> <patch>
11 +'git-mailinfo' [-k] [-u | --encoding=<encoding>] <msg> <patch>
12
13
14 DESCRIPTION
@@ -37,10 +37,17 @@ OPTIONS
37 author email are taken from the e-mail without any
38 charset conversion, after minimally decoding MIME
39 transfer encoding. This flag causes the resulting
40 - commit to be encoded in utf-8 by transliterating them.
40 + commit to be encoded in the encoding specified by
41 + i18n.commitencoding configuration (defaults to utf-8) by
42 + transliterating them.
43 Note that the patch is always used as is without charset
44 conversion, even with this flag.
45
46 +--encoding=<encoding>::
47 + Similar to -u but if the local convention is different
48 + from what is specified by i18n.commitencoding, this flag
49 + can be used to override it.
50 +
51 <msg>::
52 The commit log message extracted from e-mail, usually
53 except the title line which comes from e-mail Subject.
mailinfo.c
+3 -3
@@ -717,7 +717,7 @@ static void handle_body(void)
717 }
718
719 static const char mailinfo_usage[] =
720 - "git-mailinfo [-k] [-u] msg patch <mail >info";
720 + "git-mailinfo [-k] [-u | --encoding=<encoding>] msg patch <mail >info";
721
722 int main(int argc, char **argv)
723 {
@@ -731,8 +731,8 @@ int main(int argc, char **argv)
731 keep_subject = 1;
732 else if (!strcmp(argv[1], "-u"))
733 metainfo_charset = git_commit_encoding;
734 - else if (!strncmp(argv[1], "-u=", 3))
735 - metainfo_charset = argv[1] + 3;
734 + else if (!strncmp(argv[1], "--encoding=", 11))
735 + metainfo_charset = argv[1] + 11;
736 else
737 usage(mailinfo_usage);
738 argc--; argv++;