From c998ae9baa1cc5f507646da9850731de634d2ee7 Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Sat, 10 May 2008 15:36:29 -0700 Subject: Allow tracking branches to set up rebase by default. Change cd67e4d4 introduced a new configuration parameter that told pull to automatically perform a rebase instead of a merge. This change provides a configuration option to enable this feature automatically when creating a new branch. If the variable branch.autosetuprebase applies for a branch that's being created, that branch will have branch..rebase set to true. Signed-off-by: Dustin Sallings Signed-off-by: Junio C Hamano --- config.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index b0ada515b..cf2bfd35c 100644 --- a/config.c +++ b/config.c @@ -487,6 +487,21 @@ int git_default_config(const char *var, const char *value) git_branch_track = git_config_bool(var, value); return 0; } + if (!strcmp(var, "branch.autosetuprebase")) { + if (!value) + return config_error_nonbool(var); + else if (!strcmp(value, "never")) + autorebase = AUTOREBASE_NEVER; + else if (!strcmp(value, "local")) + autorebase = AUTOREBASE_LOCAL; + else if (!strcmp(value, "remote")) + autorebase = AUTOREBASE_REMOTE; + else if (!strcmp(value, "always")) + autorebase = AUTOREBASE_ALWAYS; + else + return error("Malformed value for %s", var); + return 0; + } /* Add other config variables here and to Documentation/config.txt. */ return 0; -- cgit v1.2.1