summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2008-05-10 15:36:29 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-11 09:28:52 -0700
commitc998ae9baa1cc5f507646da9850731de634d2ee7 (patch)
tree0df6f1a71d2a6e5de4737c4ea784d67cdd760340 /config.c
parentd1a8d0ea5fb2d4d43d0ea8f2fe45ec1fce7ec4bc (diff)
downloadgit-c998ae9baa1cc5f507646da9850731de634d2ee7.tar.gz
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.<name>.rebase set to true. Signed-off-by: Dustin Sallings <dustin@spy.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/config.c b/config.c
index b0ada515b9..cf2bfd35c8 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;