{"thread":{"id":"2696","subject":"[PATCH 1/3] Introduce i18n.commitencoding.","startedAt":"2005-11-28T00:39:08Z","lastAt":"2005-11-28T00:39:08Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"12830","messageId":"7vd5kl61xv.fsf@assigned-by-dhcp.cox.net","threadId":"2696","inReplyTo":null,"subject":"[PATCH 1/3] Introduce i18n.commitencoding.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-28T00:39:08Z","receivedAt":"2005-11-28T00:39:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is to hold what the project-local rule as to the\ncharset/encoding for the commit log message is.  Lack of it\ndefaults to utf-8.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n * This is not needed to make the gitk patch I just sent out\n   work, because git-repo-config can do its own thing without\n   the C-level integration like this.\n\n   That may or may not be a good thing, though.  I wished either\n   'git-var i18n.commitencoding' or 'git-repo-config --get\n   i18n.commitencoding' in a vanilla repository to emit the\n   default \"utf-8\".  Johannes?\n\n cache.h       |    3 +++\n config.c      |    5 +++++\n environment.c |    1 +\n 3 files changed, 9 insertions(+), 0 deletions(-)\n\napplies-to: 5596ac6f4661c80f823d93de7fa9aeec65ace1f1\n4e72dcec89c7cda7022d4ec2dd686e77deb5376e\ndiff --git a/cache.h b/cache.h\nindex 61bf884..634b5aa 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -399,6 +399,9 @@ extern int check_repository_format_versi\n extern char git_default_email[MAX_GITNAME];\n extern char git_default_name[MAX_GITNAME];\n \n+#define MAX_ENCODING_LENGTH 64\n+extern char git_commit_encoding[MAX_ENCODING_LENGTH];\n+\n /* Sane ctype - no locale, and works with signed chars */\n #undef isspace\n #undef isdigit\ndiff --git a/config.c b/config.c\nindex 0c43d76..152fa28 100644\n--- a/config.c\n+++ b/config.c\n@@ -237,6 +237,11 @@ int git_default_config(const char *var, \n \t\treturn 0;\n \t}\n \n+\tif (!strcmp(var, \"i18n.commitencoding\")) {\n+\t\tstrncpy(git_commit_encoding, value, sizeof(git_commit_encoding));\n+\t\treturn 0;\n+\t}\n+\n \t/* Add other config variables here.. */\n \treturn 0;\n }\ndiff --git a/environment.c b/environment.c\nindex 3f19473..0886ad3 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -14,6 +14,7 @@ char git_default_name[MAX_GITNAME];\n int trust_executable_bit = 1;\n int only_use_symrefs = 0;\n int repository_format_version = 0;\n+char git_commit_encoding[MAX_ENCODING_LENGTH] = \"utf-8\";\n \n static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir,\n \t*git_graft_file;\n---\n0.99.9.GIT\n"}]}