summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorFinn Arne Gangstad <finnag@pvv.org>2009-03-16 16:42:51 +0100
committerJunio C Hamano <gitster@pobox.com>2009-03-17 14:50:21 -0700
commit521537476fe99b97bfcdf1b8f0c579061af5fd3e (patch)
tree54e9b9349d7ba1197de646dfaf7154968ee2470b /cache.h
parent52e7787609d18af76a8c1befb0a06123fb7ce89e (diff)
downloadgit-521537476fe99b97bfcdf1b8f0c579061af5fd3e.tar.gz
New config push.default to decide default behavior for push
When "git push" is not told what refspecs to push, it pushes all matching branches to the current remote. For some workflows this default is not useful, and surprises new users. Some have even found that this default behaviour is too easy to trigger by accident with unwanted consequences. Introduce a new configuration variable "push.default" that decides what action git push should take if no refspecs are given or implied by the command line arguments or the current remote configuration. Possible values are: 'nothing' : Push nothing; 'matching' : Current default behaviour, push all branches that already exist in the current remote; 'tracking' : Push the current branch to whatever it is tracking; 'current' : Push the current branch to a branch of the same name, i.e. HEAD. Signed-off-by: Finn Arne Gangstad <finnag@pvv.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 189151de25..df4f117ac6 100644
--- a/cache.h
+++ b/cache.h
@@ -541,8 +541,17 @@ enum rebase_setup_type {
AUTOREBASE_ALWAYS,
};
+enum push_default_type {
+ PUSH_DEFAULT_UNSPECIFIED = -1,
+ PUSH_DEFAULT_NOTHING = 0,
+ PUSH_DEFAULT_MATCHING,
+ PUSH_DEFAULT_TRACKING,
+ PUSH_DEFAULT_CURRENT,
+};
+
extern enum branch_track git_branch_track;
extern enum rebase_setup_type autorebase;
+extern enum push_default_type push_default;
#define GIT_REPO_VERSION 0
extern int repository_format_version;