Code

Move commit reencoding parameter parsing to revision.c
authorJunio C Hamano <junkio@cox.net>
Sat, 30 Dec 2006 19:59:08 +0000 (11:59 -0800)
committerJunio C Hamano <junkio@cox.net>
Sat, 30 Dec 2006 23:58:32 +0000 (15:58 -0800)
This way, git-rev-list and git-diff-tree with --pretty can use
it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-rev-list.txt
Documentation/pretty-formats.txt
revision.c

index 9e0dcf8d3fef2495da4940ce662a46cc8a2bf621..86c94e7dfd257f5a7eff5c9d5aa4540a41128864 100644 (file)
@@ -21,6 +21,7 @@ SYNOPSIS
             [ \--stdin ]
             [ \--topo-order ]
             [ \--parents ]
+            [ \--encoding[=<encoding>] ]
             [ \--(author|committer|grep)=<pattern> ]
             [ [\--objects | \--objects-edge] [ \--unpacked ] ]
             [ \--pretty | \--header ]
index 996f6289031a4535a29579f3111998856eb31bfd..fb0b0b95829e0fc1aa98019554ce12e9b45d1f63 100644 (file)
@@ -76,3 +76,10 @@ displayed in full, regardless of whether --abbrev or
 --no-abbrev are used, and 'parents' information show the
 true parent commits, without taking grafts nor history
 simplification into account.
+
+--encoding[=<encoding>]::
+       The commit objects record the encoding used for the log message
+       in their encoding header; this option can be used to tell the
+       command to re-code the commit log message in the encoding
+       preferred by the user.  For non plumbing commands this
+       defaults to UTF-8.
index af9f87418c6ed342e0a3d751b8f8e59fe5e8aeed..6e4ec463024a3e6cc4199ea1937f3b11e0a0dace 100644 (file)
@@ -1039,6 +1039,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                                all_match = 1;
                                continue;
                        }
+                       if (!strncmp(arg, "--encoding=", 11)) {
+                               arg += 11;
+                               if (strcmp(arg, "none"))
+                                       git_log_output_encoding = strdup(arg);
+                               else
+                                       git_log_output_encoding = "";
+                               continue;
+                       }
 
                        opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);
                        if (opts > 0) {