From: Junio C Hamano Date: Mon, 28 Nov 2005 00:09:40 +0000 (-0800) Subject: Introduce i18n.commitencoding. X-Git-Tag: v0.99.9l^2~45 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4e72dcec89c7cda7022d4ec2dd686e77deb5376e;p=git.git Introduce i18n.commitencoding. This is to hold what the project-local rule as to the charset/encoding for the commit log message is. Lack of it defaults to utf-8. Signed-off-by: Junio C Hamano --- diff --git a/cache.h b/cache.h index 61bf884f8..634b5aa69 100644 --- a/cache.h +++ b/cache.h @@ -399,6 +399,9 @@ extern int check_repository_format_version(const char *var, const char *value); extern char git_default_email[MAX_GITNAME]; extern char git_default_name[MAX_GITNAME]; +#define MAX_ENCODING_LENGTH 64 +extern char git_commit_encoding[MAX_ENCODING_LENGTH]; + /* Sane ctype - no locale, and works with signed chars */ #undef isspace #undef isdigit diff --git a/config.c b/config.c index 0c43d7615..152fa282f 100644 --- a/config.c +++ b/config.c @@ -237,6 +237,11 @@ int git_default_config(const char *var, const char *value) return 0; } + if (!strcmp(var, "i18n.commitencoding")) { + strncpy(git_commit_encoding, value, sizeof(git_commit_encoding)); + return 0; + } + /* Add other config variables here.. */ return 0; } diff --git a/environment.c b/environment.c index 3f194732e..0886ad38f 100644 --- a/environment.c +++ b/environment.c @@ -14,6 +14,7 @@ char git_default_name[MAX_GITNAME]; int trust_executable_bit = 1; int only_use_symrefs = 0; int repository_format_version = 0; +char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8"; static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file;