]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jh/push-default-upstream-configname' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)
* jh/push-default-upstream-configname:
  push.default: Rename 'tracking' to 'upstream'

Documentation/config.txt
builtin/push.c
cache.h
config.c

index 84e308fce5b2a0a67dcb64a98e414c49e4cd3b01..701fba92dc1cfda8982aee8b66eb39b8b1c5816b 100644 (file)
@@ -1582,7 +1582,8 @@ push.default::
 * `matching` - push all matching branches.
   All branches having the same name in both ends are considered to be
   matching. This is the default.
-* `tracking` - push the current branch to its upstream branch.
+* `upstream` - push the current branch to its upstream branch.
+* `tracking` - deprecated synonym for `upstream`.
 * `current` - push the current branch to a branch of the same name.
 
 rebase.stat::
index e655eb7695faba13c4d9e8f25b9649ffec7195be..31da418cf4a9e4732edb8201c80b07f7ddadbac1 100644 (file)
@@ -64,17 +64,17 @@ static void set_refspecs(const char **refs, int nr)
        }
 }
 
-static void setup_push_tracking(void)
+static void setup_push_upstream(void)
 {
        struct strbuf refspec = STRBUF_INIT;
        struct branch *branch = branch_get(NULL);
        if (!branch)
                die("You are not currently on a branch.");
        if (!branch->merge_nr || !branch->merge)
-               die("The current branch %s is not tracking anything.",
+               die("The current branch %s has no upstream branch.",
                    branch->name);
        if (branch->merge_nr != 1)
-               die("The current branch %s is tracking multiple branches, "
+               die("The current branch %s has multiple upstream branches, "
                    "refusing to push.", branch->name);
        strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);
        add_refspec(refspec.buf);
@@ -88,8 +88,8 @@ static void setup_default_push_refspecs(void)
                add_refspec(":");
                break;
 
-       case PUSH_DEFAULT_TRACKING:
-               setup_push_tracking();
+       case PUSH_DEFAULT_UPSTREAM:
+               setup_push_upstream();
                break;
 
        case PUSH_DEFAULT_CURRENT:
diff --git a/cache.h b/cache.h
index 39ca875fb54afa8ef31631d6096738c46df02ccc..c782495a8f097e45c4bedd0e18c1f1250b794728 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -607,7 +607,7 @@ enum rebase_setup_type {
 enum push_default_type {
        PUSH_DEFAULT_NOTHING = 0,
        PUSH_DEFAULT_MATCHING,
-       PUSH_DEFAULT_TRACKING,
+       PUSH_DEFAULT_UPSTREAM,
        PUSH_DEFAULT_CURRENT
 };
 
index 3dd55d507b5e3551e2ec315dda3fc37d2a74ad5a..822ef8365ce29c48e4b04fcccc47ba2e0b3a255f 100644 (file)
--- a/config.c
+++ b/config.c
@@ -729,8 +729,10 @@ static int git_default_push_config(const char *var, const char *value)
                        push_default = PUSH_DEFAULT_NOTHING;
                else if (!strcmp(value, "matching"))
                        push_default = PUSH_DEFAULT_MATCHING;
-               else if (!strcmp(value, "tracking"))
-                       push_default = PUSH_DEFAULT_TRACKING;
+               else if (!strcmp(value, "upstream"))
+                       push_default = PUSH_DEFAULT_UPSTREAM;
+               else if (!strcmp(value, "tracking")) /* deprecated */
+                       push_default = PUSH_DEFAULT_UPSTREAM;
                else if (!strcmp(value, "current"))
                        push_default = PUSH_DEFAULT_CURRENT;
                else {