Skip to content

Commit

Permalink
Introduce i18n.commitencoding.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Nov 28, 2005
1 parent 55d1eb0 commit 4e72dce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4e72dce

Please sign in to comment.