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 <junkio@cox.net>
Junio C Hamano committed
Nov 27, 2005 at 16:09 UTC
4e72dcec89c7cda7022d4ec2dd686e77deb5376e
3 files changed
+9
cache.h
+3
@@ -399,6 +399,9 @@ extern int check_repository_format_version(const char *var, const char *value);
399
extern char git_default_email[MAX_GITNAME];
400
extern char git_default_name[MAX_GITNAME];
401
402
+#define MAX_ENCODING_LENGTH 64
403
+extern char git_commit_encoding[MAX_ENCODING_LENGTH];
404
+
405
/* Sane ctype - no locale, and works with signed chars */
406
#undef isspace
407
#undef isdigit
config.c
+5
@@ -237,6 +237,11 @@ int git_default_config(const char *var, const char *value)
237
return 0;
238
}
239
240
+ if (!strcmp(var, "i18n.commitencoding")) {
241
+ strncpy(git_commit_encoding, value, sizeof(git_commit_encoding));
242
+ return 0;
243
+ }
244
+
245
/* Add other config variables here.. */
246
return 0;
247
}
environment.c
+1
@@ -14,6 +14,7 @@ char git_default_name[MAX_GITNAME];
14
int trust_executable_bit = 1;
15
int only_use_symrefs = 0;
16
int repository_format_version = 0;
17
+char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
18
19
static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir,
20
*git_graft_file;