Move commit reencoding parameter parsing to revision.c
This way, git-rev-list and git-diff-tree with --pretty can use it. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Dec 30, 2006 at 11:59 UTC
7cbcf4d5579bdc5d9f8a4bf3f37d3390fc6e2572
3 files changed
+16
Documentation/git-rev-list.txt
+1
@@ -21,6 +21,7 @@ SYNOPSIS
21
[ \--stdin ]
22
[ \--topo-order ]
23
[ \--parents ]
24
+ [ \--encoding[=<encoding>] ]
25
[ \--(author|committer|grep)=<pattern> ]
26
[ [\--objects | \--objects-edge] [ \--unpacked ] ]
27
[ \--pretty | \--header ]
Documentation/pretty-formats.txt
+7
@@ -76,3 +76,10 @@ displayed in full, regardless of whether --abbrev or
76
--no-abbrev are used, and 'parents' information show the
77
true parent commits, without taking grafts nor history
78
simplification into account.
79
+
80
+--encoding[=<encoding>]::
81
+ The commit objects record the encoding used for the log message
82
+ in their encoding header; this option can be used to tell the
83
+ command to re-code the commit log message in the encoding
84
+ preferred by the user. For non plumbing commands this
85
+ defaults to UTF-8.
revision.c
+8
@@ -1039,6 +1039,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
1039
all_match = 1;
1040
continue;
1041
}
1042
+ if (!strncmp(arg, "--encoding=", 11)) {
1043
+ arg += 11;
1044
+ if (strcmp(arg, "none"))
1045
+ git_log_output_encoding = strdup(arg);
1046
+ else
1047
+ git_log_output_encoding = "";
1048
+ continue;
1049
+ }
1050
1051
opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);
1052
if (opts > 0) {