{"thread":{"id":"18238","subject":"[PATCH 7/7] git push: Remove warning for \"git push\" default change","startedAt":"2009-03-09T22:35:44Z","lastAt":"2009-03-13T10:07:15Z","messageCount":31,"participants":["Finn Arne Gangstad","Johannes Schindelin","Daniel Barkalow","Junio C Hamano","Jay Soffian","Jeff King","Nanako Shiraishi","Miles Bader","John Tapsell"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"107518","messageId":"1236638151-6465-1-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":null,"subject":"[RFC/PATCH] git push usability improvements and default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:44Z","receivedAt":"2009-03-09T22:35:44Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"Usability improvements:\n\n\"-\" is now an alias for the current remote (the remote of the current\nbranch or \"origin\" as a fallback). This works both for push, fetch,\npull, remote (and possibly some others), creating a lot of nice\nshortcuts I think:\ngit remote prune - : prune the current remote\ngit push - HEAD : push the current branch to a branch of the same name\ngit fetch - next : fetch the next branch from the current remote\n\ngit push has learned two new command line options --matching and\n--current, which override any configuration.  'matching' pushes all\nbranches that already exist at the remote, while 'current' pushes the\ncurrent branch to whatever it is tracking\n\nI chose this behaviour for 'current', since it is the one that I find\nmost useful, and there seems to be no good way of expressing it from\nthe command line.  Pushing a branch to an identically named branch on\na remote can now easily be done by \"git push - HEAD\".\n\nAlso added a new configuration option push.default, which can have values\n\"nothing\", \"matching\" and \"current\". This variable will only be used if\nyou have not specificed any refspecs at all, no command line options imply\nany refspecs, and the current branch has no push configuration.\n\nThis is implemented in 1-3\n\n\ngit push default change:\n\ngit push will by default push \"nothing\" instead of \"matching\".\n\nThis is implemented in 4-7. 4-5 are for immediate consumption, 6 is for\nnext major release (or later), and 7 is even later.\n\n4 Adds a warning if you have not configured push.default\n5 Changes the wording to say that the default will change. 4 and 5 can\n  be applied immediately.\n6 changes the deault to \"nothing\", but keeps the warning.\n7 removes the warning entirely\n\nFinn Arne Gangstad (7):\n      remote: Make \"-\" an alias for the current remote\n      New config option push.default\n      git push: New options --matching and --current\n      git push: Display warning on unconfigured default push\n      git push: Document that \"nothing\" is the future push default\n      git push: Change default for \"git push\" to nothing.\n      git push: Remove warning for \"git push\" default change\n\n Documentation/RelNotes-1.6.3.txt |    7 +++\n Documentation/config.txt         |   18 ++++++++\n Documentation/git-push.txt       |   14 +++++--\n builtin-push.c                   |   84 +++++++++++++++++++++++++++++--------\n cache.h                          |    7 +++\n config.c                         |   23 ++++++++++\n environment.c                    |    1 +\n remote.c                         |    2 +-\n transport.h                      |    9 ++++\n 9 files changed, 142 insertions(+), 23 deletions(-)\n\n- Finn Arne\n"},{"id":"107519","messageId":"1236638151-6465-2-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"[PATCH 1/7] remote: Make \"-\" an alias for the current remote","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:45Z","receivedAt":"2009-03-09T22:35:45Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"This creates a handy alias \"-\" for the remote of the current branch\n(or origin if no such remote exists), which can be used in both\npush, pull, fetch and remote to make many tasks easier. E.g.:\ngit push - HEAD  : push the current branch\ngit remote prune - : prune the current remote\ngit fetch - next : get the next branch from the current remote\n\nSigned-off-by: Finn Arne Gangstad <finnag@pvv.org>\n---\n remote.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex d7079c6..3a6d002 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -645,7 +645,7 @@ struct remote *remote_get(const char *name)\n \tstruct remote *ret;\n \n \tread_config();\n-\tif (!name)\n+\tif (!name || !strcmp(name, \"-\"))\n \t\tname = default_remote_name;\n \tret = make_remote(name, 0);\n \tif (valid_remote_nick(name)) {\n-- \n1.6.2.105.g6ff1f.dirty\n"},{"id":"107517","messageId":"1236638151-6465-3-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"[PATCH 2/7] New config option push.default","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:46Z","receivedAt":"2009-03-09T22:35:46Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"This option takes effect when no refspec is given explicitly or implicitly\nby any of the command line arguments to push, and no refspec is configured\nfor the current remote. The possible values are:\n* nothing - do not push anything\n* current - push the current branch to whatever it is tracking\n* matching - push all branches that already exist remotely (same name)\n\nSigned-off-by: Finn Arne Gangstad <finnag@pvv.org>\n---\n Documentation/config.txt |   18 ++++++++++++++++++\n cache.h                  |    8 ++++++++\n config.c                 |   23 +++++++++++++++++++++++\n environment.c            |    1 +\n 4 files changed, 50 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex f5152c5..50bc1d0 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1160,6 +1160,24 @@ pull.octopus::\n pull.twohead::\n \tThe default merge strategy to use when pulling a single branch.\n \n+push.default::\n+\tDefines the action git push should take if no refspec is given\n+\ton the command line, no refspec is configured in the remote, and\n+\tno refspec is implied by any of the options given on the command\n+\tline.\n+\n+\tThe term `current remote` means the remote configured for the current\n+\tbranch, or `origin` if no remote is configured. `origin` is also used\n+\tif you are not on any branch.\n++\n+* `nothing` do not push anything\n+* `matching` push all matching branches to the current remote.\n+  All branches having the same name in both ends are considered to be\n+  matching. This is the default value.\n+* `current` push the current branch to the branch it is tracking on\n+  the remote\n+\n+\n receive.fsckObjects::\n \tIf it is set to true, git-receive-pack will check all received\n \tobjects. It will abort in the case of a malformed object or a\ndiff --git a/cache.h b/cache.h\nindex 189151d..3a6acb8 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -541,8 +541,16 @@ enum rebase_setup_type {\n \tAUTOREBASE_ALWAYS,\n };\n \n+enum push_default_type {\n+\tPUSH_DEFAULT_UNSPECIFIED = -1,\n+\tPUSH_DEFAULT_NOTHING = 0,\n+\tPUSH_DEFAULT_MATCHING,\n+\tPUSH_DEFAULT_CURRENT,\n+};\n+\n extern enum branch_track git_branch_track;\n extern enum rebase_setup_type autorebase;\n+extern enum push_default_type push_default;\n \n #define GIT_REPO_VERSION 0\n extern int repository_format_version;\ndiff --git a/config.c b/config.c\nindex 0c8c76f..12d5a2b 100644\n--- a/config.c\n+++ b/config.c\n@@ -565,6 +565,26 @@ static int git_default_branch_config(const char *var, const char *value)\n \treturn 0;\n }\n \n+static int git_default_push_config(const char *var, const char *value)\n+{\n+\tif (!strcmp(var, \"push.default\")) {\n+\t\tif (!value)\n+\t\t\treturn config_error_nonbool(var);\n+\t\telse if (!strcmp(value, \"nothing\"))\n+\t\t\tpush_default = PUSH_DEFAULT_NOTHING;\n+\t\telse if (!strcmp(value, \"current\"))\n+\t\t\tpush_default = PUSH_DEFAULT_CURRENT;\n+\t\telse if (!strcmp(value, \"matching\"))\n+\t\t\tpush_default = PUSH_DEFAULT_MATCHING;\n+\t\telse\n+\t\t\treturn error(\"Malformed value for %s\", var);\n+\t\treturn 0;\n+\t}\n+\n+\t/* Add other config variables here and to Documentation/config.txt. */\n+\treturn 0;\n+}\n+\n static int git_default_mailmap_config(const char *var, const char *value)\n {\n \tif (!strcmp(var, \"mailmap.file\"))\n@@ -588,6 +608,9 @@ int git_default_config(const char *var, const char *value, void *dummy)\n \tif (!prefixcmp(var, \"branch.\"))\n \t\treturn git_default_branch_config(var, value);\n \n+\tif (!prefixcmp(var, \"push.\"))\n+\t\treturn git_default_push_config(var, value);\n+\n \tif (!prefixcmp(var, \"mailmap.\"))\n \t\treturn git_default_mailmap_config(var, value);\n \ndiff --git a/environment.c b/environment.c\nindex e278bce..4696885 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -42,6 +42,7 @@ enum safe_crlf safe_crlf = SAFE_CRLF_WARN;\n unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;\n enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;\n enum rebase_setup_type autorebase = AUTOREBASE_NEVER;\n+enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;\n \n /* Parallel index stat data preload? */\n int core_preload_index = 0;\n-- \n1.6.2.105.g6ff1f.dirty\n"},{"id":"107516","messageId":"1236638151-6465-4-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"[PATCH 3/7] git push: New options --matching and --current","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:47Z","receivedAt":"2009-03-09T22:35:47Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"--matching: Push all branches that already exist with the same name in\nthe remote\n--current: Push the current branch to whatever it is tracking\n\nSigned-off-by: Finn Arne Gangstad <finnag@pvv.org>\n---\n Documentation/git-push.txt |   10 +++++-\n builtin-push.c             |   87 +++++++++++++++++++++++++++++++++++---------\n transport.h                |    9 +++++\n 3 files changed, 87 insertions(+), 19 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 4e7e5a7..cb7b3d2 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -9,7 +9,8 @@ git-push - Update remote refs along with associated objects\n SYNOPSIS\n --------\n [verse]\n-'git push' [--all | --mirror | --tags] [--dry-run] [--receive-pack=<git-receive-pack>]\n+'git push' [--all | --mirror | --tags | --matching | --current]\n+\t   [--dry-run] [--receive-pack=<git-receive-pack>]\n \t   [--repo=<repository>] [-f | --force] [-v | --verbose]\n \t   [<repository> <refspec>...]\n \n@@ -82,6 +83,13 @@ nor in any Push line of the corresponding remotes file---see below).\n \tif the configuration option `remote.<remote>.mirror` is\n \tset.\n \n+--matching::\n+\tFor every branch on the local side, the remote side is updated if\n+\ta branch of the same name already exists there.\n+\n+--current::\n+\tPush the current branch to the branch it is tracking on the remote.\n+\n --dry-run::\n \tDo everything except actually send the updates.\n \ndiff --git a/builtin-push.c b/builtin-push.c\nindex 122fdcf..5706c99 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -10,7 +10,7 @@\n #include \"parse-options.h\"\n \n static const char * const push_usage[] = {\n-\t\"git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]\",\n+\t\"git push [--all | --mirror | --current | --matching] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]\",\n \tNULL,\n };\n \n@@ -48,6 +48,53 @@ static void set_refspecs(const char **refs, int nr)\n \t}\n }\n \n+static const char *make_push_ref(const char *a, const char *b)\n+{\n+\tchar *buf = xmalloc(strlen(a) + strlen(b) + 2);\n+\tstrcpy(buf, a);\n+\tstrcat(buf, \":\");\n+\tstrcat(buf, b);\n+\treturn buf;\n+}\n+\n+static void setup_push_current(struct remote *remote)\n+{\n+\tint n;\n+\tstruct branch *branch = branch_get(NULL);\n+\tif (!branch)\n+\t\tdie(\"You are not currently on a branch.\");\n+\tif (!branch->merge_nr)\n+\t\tdie(\"The current branch %s is not tracking anything.\",\n+\t\t    branch->name);\n+\tif (branch->remote != remote)\n+\t\tdie(\"The current branch is tracking \\\"%s\\\", not \\\"%s\\\"!\",\n+\t\t    branch->remote->name, remote->name);\n+\tfor (n = 0; n < branch->merge_nr; n++)\n+\t\tadd_refspec(make_push_ref(branch->name,\n+\t\t\t\t\t\tbranch->merge[n]->src));\n+}\n+\n+static void handle_default_push(struct remote *remote, int *flags)\n+{\n+\tgit_config(git_default_config, NULL);\n+\tswitch (push_default) {\n+\tcase PUSH_DEFAULT_UNSPECIFIED:\n+\t\t/* fallthrough */\n+\n+\tcase PUSH_DEFAULT_MATCHING:\n+\t\tadd_refspec(\":\");\n+\t\tbreak;\n+\n+\tcase PUSH_DEFAULT_CURRENT:\n+\t\tsetup_push_current(remote);\n+\t\tbreak;\n+\n+\tcase PUSH_DEFAULT_NOTHING:\n+\t\tdie(\"No refspec given, and none configured.\");\n+\t\tbreak;\n+\t}\n+}\n+\n static int do_push(const char *repo, int flags)\n {\n \tint i, errs;\n@@ -59,29 +106,29 @@ static int do_push(const char *repo, int flags)\n \tif (remote->mirror)\n \t\tflags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE);\n \n-\tif ((flags & TRANSPORT_PUSH_ALL) && refspec) {\n+\tif ((flags & TRANSPORT_PUSH_MODE_MASK) && refspec) {\n \t\tif (!strcmp(*refspec, \"refs/tags/*\"))\n-\t\t\treturn error(\"--all and --tags are incompatible\");\n-\t\treturn error(\"--all can't be combined with refspecs\");\n+\t\t\treturn error(\"--tags cannot be combined with a push mode\");\n+\t\treturn error(\"push modes cannot be combined with explicit refspecs\");\n \t}\n \n-\tif ((flags & TRANSPORT_PUSH_MIRROR) && refspec) {\n-\t\tif (!strcmp(*refspec, \"refs/tags/*\"))\n-\t\t\treturn error(\"--mirror and --tags are incompatible\");\n-\t\treturn error(\"--mirror can't be combined with refspecs\");\n-\t}\n+\tif (HAS_MULTI_BITS(flags & TRANSPORT_PUSH_MODE_MASK))\n+\t\treturn error(\"Multiple push modes specified\");\n \n-\tif ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==\n-\t\t\t\t(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {\n-\t\treturn error(\"--all and --mirror are incompatible\");\n-\t}\n+\tif (flags & TRANSPORT_PUSH_CURRENT)\n+\t\tsetup_push_current(remote);\n+\telse if (flags & TRANSPORT_PUSH_MATCHING)\n+\t\tadd_refspec(\":\");\n \n-\tif (!refspec\n-\t\t&& !(flags & TRANSPORT_PUSH_ALL)\n-\t\t&& remote->push_refspec_nr) {\n-\t\trefspec = remote->push_refspec;\n-\t\trefspec_nr = remote->push_refspec_nr;\n+\tif (!refspec && !(flags & TRANSPORT_PUSH_MODE_MASK)) {\n+\t\tif (remote->push_refspec_nr) {\n+\t\t\trefspec = remote->push_refspec;\n+\t\t\trefspec_nr = remote->push_refspec_nr;\n+\t\t} else {\n+\t\t\thandle_default_push(remote, &flags);\n+\t\t}\n \t}\n+\n \terrs = 0;\n \tfor (i = 0; i < remote->url_nr; i++) {\n \t\tstruct transport *transport =\n@@ -120,6 +167,10 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT( 0 , \"all\", &flags, \"push all refs\", TRANSPORT_PUSH_ALL),\n \t\tOPT_BIT( 0 , \"mirror\", &flags, \"mirror all refs\",\n \t\t\t    (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),\n+\t\tOPT_BIT( 0 , \"matching\", &flags, \"push all matching refs\",\n+\t\t\t TRANSPORT_PUSH_MATCHING),\n+\t\tOPT_BIT( 0 , \"current\", &flags, \"push current branch\",\n+\t\t\t TRANSPORT_PUSH_CURRENT),\n \t\tOPT_BOOLEAN( 0 , \"tags\", &tags, \"push tags\"),\n \t\tOPT_BIT( 0 , \"dry-run\", &flags, \"dry run\", TRANSPORT_PUSH_DRY_RUN),\n \t\tOPT_BIT('f', \"force\", &flags, \"force updates\", TRANSPORT_PUSH_FORCE),\ndiff --git a/transport.h b/transport.h\nindex 6bbc1a8..b897d0c 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -34,6 +34,15 @@ struct transport {\n #define TRANSPORT_PUSH_DRY_RUN 4\n #define TRANSPORT_PUSH_MIRROR 8\n #define TRANSPORT_PUSH_VERBOSE 16\n+#define TRANSPORT_PUSH_MATCHING 32\n+#define TRANSPORT_PUSH_CURRENT 64\n+/**\n+ * All push flags that imply a certain set of refspecs to be pushed must\n+ * be combined into TRANSPORT_PUSH_MODE_MASK\n+ **/\n+#define TRANSPORT_PUSH_MODE_MASK \\\n+    (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR | TRANSPORT_PUSH_MATCHING | \\\n+    TRANSPORT_PUSH_CURRENT)\n \n /* Returns a transport suitable for the url */\n struct transport *transport_get(struct remote *, const char *);\n-- \n1.6.2.105.g6ff1f.dirty\n"},{"id":"107520","messageId":"1236638151-6465-5-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"[PATCH 4/7] git push: Display warning on unconfigured default push","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:48Z","receivedAt":"2009-03-09T22:35:48Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"As a preparation for a possible future \"git push\" default behaviour change,\ndisplay a prominent warning for operations that may change behaviour\nin the future. The warning explains for the user how to configure this\npermanently so the warning will not be seen again after proper configuration.\n\nSigned-off-by: Finn Arne Gangstad <finnag@pvv.org>\n---\n builtin-push.c |   23 +++++++++++++++++++++++\n 1 files changed, 23 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 5706c99..b9fe206 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -74,11 +74,34 @@ static void setup_push_current(struct remote *remote)\n \t\t\t\t\t\tbranch->merge[n]->src));\n }\n \n+static const char *warn_unconfigured_push_msg[] = {\n+\t\"You did not specify any refspecs to push, and the current remote\",\n+\t\"has not configured any push refspecs. The default action in this\",\n+\t\"case has been to push all matching refspecs, that is, all branches\",\n+\t\"that exist both locally and remotely will be updated.\",\n+\t\"This default may change in the future.\",\n+\t\"\",\n+\t\"You can specify what action you want to take in this case, and\",\n+\t\"avoid seeing this message again, by configuring 'push.default' to:\",\n+\t\"  'nothing'  : Do not push anythig\",\n+\t\"  'matching' : Push all matching branches (the current default)\",\n+\t\"  'current'  : Push the current branch to whatever it is tracking\",\n+\t\"\"\n+};\n+\n+static void warn_unconfigured_push()\n+{\n+\tint i;\n+\tfor (i = 0; i < ARRAY_SIZE(warn_unconfigured_push_msg); i++)\n+\t\twarning(\"%s\", warn_unconfigured_push_msg[i]);\n+}\n+\n static void handle_default_push(struct remote *remote, int *flags)\n {\n \tgit_config(git_default_config, NULL);\n \tswitch (push_default) {\n \tcase PUSH_DEFAULT_UNSPECIFIED:\n+\t\twarn_unconfigured_push();\n \t\t/* fallthrough */\n \n \tcase PUSH_DEFAULT_MATCHING:\n-- \n1.6.2.105.g6ff1f.dirty\n"},{"id":"107521","messageId":"1236638151-6465-6-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"[PATCH 5/7] git push: Document that \"nothing\" is the future push default","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:49Z","receivedAt":"2009-03-09T22:35:49Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"Signed-off-by: Finn Arne Gangstad <finnag@pvv.org>\n---\n Documentation/RelNotes-1.6.3.txt |    7 +++++++\n builtin-push.c                   |    4 ++--\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/RelNotes-1.6.3.txt b/Documentation/RelNotes-1.6.3.txt\nindex ee1fddb..87de02a 100644\n--- a/Documentation/RelNotes-1.6.3.txt\n+++ b/Documentation/RelNotes-1.6.3.txt\n@@ -22,6 +22,13 @@ branch pointed at by its HEAD, gets a large warning.  You can choose what\n should happen upon such a push by setting the configuration variable\n receive.denyDeleteCurrent in the receiving repository.\n \n+In a future release, the default of \"git push\" without further\n+arguments will be to push nothing. Currently, it will push all\n+matching refspecs to the current remote.  A configuration variable\n+push.default has been introduced to select the default behaviour.  To\n+ease the transition, a big warning is issued if this is not configured\n+and a git push without arguments is attempted.\n+\n \n Updates since v1.6.2\n --------------------\ndiff --git a/builtin-push.c b/builtin-push.c\nindex b9fe206..7ef499f 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -79,11 +79,11 @@ static const char *warn_unconfigured_push_msg[] = {\n \t\"has not configured any push refspecs. The default action in this\",\n \t\"case has been to push all matching refspecs, that is, all branches\",\n \t\"that exist both locally and remotely will be updated.\",\n-\t\"This default may change in the future.\",\n+\t\"This default will change in the future.\",\n \t\"\",\n \t\"You can specify what action you want to take in this case, and\",\n \t\"avoid seeing this message again, by configuring 'push.default' to:\",\n-\t\"  'nothing'  : Do not push anythig\",\n+\t\"  'nothing'  : Do not push anythig (the future default)\",\n \t\"  'matching' : Push all matching branches (the current default)\",\n \t\"  'current'  : Push the current branch to whatever it is tracking\",\n \t\"\"\n-- \n1.6.2.105.g6ff1f.dirty\n"},{"id":"107515","messageId":"1236638151-6465-7-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"[PATCH 6/7] git push: Change default for \"git push\" to nothing.","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:50Z","receivedAt":"2009-03-09T22:35:50Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"Signed-off-by: Finn Arne Gangstad <finnag@pvv.org>\n---\n Documentation/config.txt   |    4 ++--\n Documentation/git-push.txt |    4 +---\n builtin-push.c             |    7 ++++---\n 3 files changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 50bc1d0..437216c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1170,10 +1170,10 @@ push.default::\n \tbranch, or `origin` if no remote is configured. `origin` is also used\n \tif you are not on any branch.\n +\n-* `nothing` do not push anything\n+* `nothing` do not push anything.  This is new the default value.\n * `matching` push all matching branches to the current remote.\n   All branches having the same name in both ends are considered to be\n-  matching. This is the default value.\n+  matching.  This used to be the default value.\n * `current` push the current branch to the branch it is tracking on\n   the remote\n \ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex cb7b3d2..149c1f0 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -64,9 +64,7 @@ the remote repository.\n The special refspec `:` (or `{plus}:` to allow non-fast forward updates)\n directs git to push \"matching\" branches: for every branch that exists on\n the local side, the remote side is updated if a branch of the same name\n-already exists on the remote side.  This is the default operation mode\n-if no explicit refspec is found (that is neither on the command line\n-nor in any Push line of the corresponding remotes file---see below).\n+already exists on the remote side.\n \n --all::\n \tInstead of naming each ref to push, specifies that all\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 7ef499f..93f12a8 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -104,6 +104,10 @@ static void handle_default_push(struct remote *remote, int *flags)\n \t\twarn_unconfigured_push();\n \t\t/* fallthrough */\n \n+\tcase PUSH_DEFAULT_NOTHING:\n+\t\tdie(\"No refspec given, and none configured.\");\n+\t\tbreak;\n+\n \tcase PUSH_DEFAULT_MATCHING:\n \t\tadd_refspec(\":\");\n \t\tbreak;\n@@ -112,9 +116,6 @@ static void handle_default_push(struct remote *remote, int *flags)\n \t\tsetup_push_current(remote);\n \t\tbreak;\n \n-\tcase PUSH_DEFAULT_NOTHING:\n-\t\tdie(\"No refspec given, and none configured.\");\n-\t\tbreak;\n \t}\n }\n \n-- \n1.6.2.105.g6ff1f.dirty\n"},{"id":"107514","messageId":"1236638151-6465-8-git-send-email-finnag@pvv.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"[PATCH 7/7] git push: Remove warning for \"git push\" default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-09T22:35:51Z","receivedAt":"2009-03-09T22:35:51Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"Signed-off-by: Finn Arne Gangstad <finnag@pvv.org>\n---\n Documentation/config.txt |    4 ++--\n builtin-push.c           |   27 ---------------------------\n cache.h                  |    1 -\n environment.c            |    2 +-\n 4 files changed, 3 insertions(+), 31 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 437216c..d110edc 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1170,10 +1170,10 @@ push.default::\n \tbranch, or `origin` if no remote is configured. `origin` is also used\n \tif you are not on any branch.\n +\n-* `nothing` do not push anything.  This is new the default value.\n+* `nothing` do not push anything.  This is the default value.\n * `matching` push all matching branches to the current remote.\n   All branches having the same name in both ends are considered to be\n-  matching.  This used to be the default value.\n+  matching.\n * `current` push the current branch to the branch it is tracking on\n   the remote\n \ndiff --git a/builtin-push.c b/builtin-push.c\nindex 93f12a8..d0ab76d 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -74,36 +74,10 @@ static void setup_push_current(struct remote *remote)\n \t\t\t\t\t\tbranch->merge[n]->src));\n }\n \n-static const char *warn_unconfigured_push_msg[] = {\n-\t\"You did not specify any refspecs to push, and the current remote\",\n-\t\"has not configured any push refspecs. The default action in this\",\n-\t\"case has been to push all matching refspecs, that is, all branches\",\n-\t\"that exist both locally and remotely will be updated.\",\n-\t\"This default will change in the future.\",\n-\t\"\",\n-\t\"You can specify what action you want to take in this case, and\",\n-\t\"avoid seeing this message again, by configuring 'push.default' to:\",\n-\t\"  'nothing'  : Do not push anythig (the future default)\",\n-\t\"  'matching' : Push all matching branches (the current default)\",\n-\t\"  'current'  : Push the current branch to whatever it is tracking\",\n-\t\"\"\n-};\n-\n-static void warn_unconfigured_push()\n-{\n-\tint i;\n-\tfor (i = 0; i < ARRAY_SIZE(warn_unconfigured_push_msg); i++)\n-\t\twarning(\"%s\", warn_unconfigured_push_msg[i]);\n-}\n-\n static void handle_default_push(struct remote *remote, int *flags)\n {\n \tgit_config(git_default_config, NULL);\n \tswitch (push_default) {\n-\tcase PUSH_DEFAULT_UNSPECIFIED:\n-\t\twarn_unconfigured_push();\n-\t\t/* fallthrough */\n-\n \tcase PUSH_DEFAULT_NOTHING:\n \t\tdie(\"No refspec given, and none configured.\");\n \t\tbreak;\n@@ -115,7 +89,6 @@ static void handle_default_push(struct remote *remote, int *flags)\n \tcase PUSH_DEFAULT_CURRENT:\n \t\tsetup_push_current(remote);\n \t\tbreak;\n-\n \t}\n }\n \ndiff --git a/cache.h b/cache.h\nindex 3a6acb8..f3f8e28 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -542,7 +542,6 @@ enum rebase_setup_type {\n };\n \n enum push_default_type {\n-\tPUSH_DEFAULT_UNSPECIFIED = -1,\n \tPUSH_DEFAULT_NOTHING = 0,\n \tPUSH_DEFAULT_MATCHING,\n \tPUSH_DEFAULT_CURRENT,\ndiff --git a/environment.c b/environment.c\nindex 4696885..6766394 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -42,7 +42,7 @@ enum safe_crlf safe_crlf = SAFE_CRLF_WARN;\n unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;\n enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;\n enum rebase_setup_type autorebase = AUTOREBASE_NEVER;\n-enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;\n+enum push_default_type push_default = PUSH_DEFAULT_NOTHING;\n \n /* Parallel index stat data preload? */\n int core_preload_index = 0;\n-- \n1.6.2.105.g6ff1f.dirty\n"},{"id":"107523","messageId":"alpine.DEB.1.00.0903100033400.6358@intel-tinevez-2-302","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-09T23:35:12Z","receivedAt":"2009-03-09T23:35:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 9 Mar 2009, Finn Arne Gangstad wrote:\n\n> git push default change:\n> \n> git push will by default push \"nothing\" instead of \"matching\".\n\nHasn't this been shot down already?  I do not want that change.  I think \nit is harmful.\n\nAt least without a proper way to prepare existing users for the end of the \nworld.\n\nCiao,\nDscho\n"},{"id":"107524","messageId":"alpine.LNX.1.00.0903091938150.19665@iabervon.org","threadId":"18238","inReplyTo":"1236638151-6465-4-git-send-email-finnag@pvv.org","subject":"Re: [PATCH 3/7] git push: New options --matching and --current","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-09T23:49:47Z","receivedAt":"2009-03-09T23:49:47Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 9 Mar 2009, Finn Arne Gangstad wrote:\n\n> diff --git a/transport.h b/transport.h\n> index 6bbc1a8..b897d0c 100644\n> --- a/transport.h\n> +++ b/transport.h\n> @@ -34,6 +34,15 @@ struct transport {\n>  #define TRANSPORT_PUSH_DRY_RUN 4\n>  #define TRANSPORT_PUSH_MIRROR 8\n>  #define TRANSPORT_PUSH_VERBOSE 16\n> +#define TRANSPORT_PUSH_MATCHING 32\n> +#define TRANSPORT_PUSH_CURRENT 64\n> +/**\n> + * All push flags that imply a certain set of refspecs to be pushed must\n> + * be combined into TRANSPORT_PUSH_MODE_MASK\n> + **/\n> +#define TRANSPORT_PUSH_MODE_MASK \\\n> +    (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR | TRANSPORT_PUSH_MATCHING | \\\n> +    TRANSPORT_PUSH_CURRENT)\n\nIt's kind of odd that you define these flags as TRANSPORT_PUSH_*, but \nimplement them before entering transport_push(). I'm not sure which is \nright, but the combination is odd. I think just taking care of it in \nbuiltin-push with flags or options defined there is probably the best \nthing, currently.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"107525","messageId":"7vfxhmdyvn.fsf@gitster.siamese.dyndns.org","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-10T00:07:08Z","receivedAt":"2009-03-10T00:07:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Finn Arne Gangstad <finnag@pvv.org> writes:\n\n> \"-\" is now an alias for the current remote (the remote of the current\n> branch or \"origin\" as a fallback). This works both for push, fetch,\n> pull, remote (and possibly some others), creating a lot of nice\n> shortcuts I think:\n> git remote prune - : prune the current remote\n> git push - HEAD : push the current branch to a branch of the same name\n> git fetch - next : fetch the next branch from the current remote\n>\n> git push has learned two new command line options --matching and\n> --current, which override any configuration.  'matching' pushes all\n> branches that already exist at the remote, while 'current' pushes the\n> current branch to whatever it is tracking\n>\n> I chose this behaviour for 'current', since it is the one that I find\n> most useful, and there seems to be no good way of expressing it from\n> the command line.  Pushing a branch to an identically named branch on\n> a remote can now easily be done by \"git push - HEAD\".\n>\n> Also added a new configuration option push.default, which can have values\n> \"nothing\", \"matching\" and \"current\". This variable will only be used if\n> you have not specificed any refspecs at all, no command line options imply\n> any refspecs, and the current branch has no push configuration.\n>\n> This is implemented in 1-3\n\nI think the last four are more or less sane, but I am not sure about the\nfirst three, which makes it very unfortunate that the former depends on\nthe latter.\n\nSome design issues and questions regarding the first three; not all of\nthem are objections:\n\n * Do we use a short-hand for \"the default thing\" anywhere else in the\n   current UI (not just \"git push\" but in the \"git\" command set)?\n\n   - If the answer to the above question is \"yes\", does it use '-' as the\n     short-hand too?  In other words, is this new short-hand consistent\n     with it, or is it introducing \"git-push uses '-' as the short-hand\n     for the default, while git-frotz uses something else\" confusion?\n\n   - Even if the answer to the above question is \"no\", are there other\n     commands that we currently do not allow a quick shorthand to mean\n     \"the default thing\", but would benefit from having one?  If so, how\n     good does it look to use '-' as such a short-hand?\n\n     In other words, is it safe to establish a precedent to use '-' to\n     denote \"the default thing\"?  Would we later regret, saying that\n     \"'git-frotz command would benefit from a short-hand notation for 'the\n     default thing', but - is already taken -- it means send the output to\n     the stdout\"?\n\n   - Do we use a short-hand '-' to mean something entirely different in\n     the UI, making this new use of '-' to mean the default confusing?\n\n     I think '-' for checkout means \"the previous one\", which already\n     answers this question somewhat.\n\n * What's the point of having --matching option, when you can already say\n   ':', i.e.\n\n\t$ git push origin :\n\n * What's the point of having --current option, when you can already say\n   HEAD, i.e.\n\n\t$ git push origin HEAD\n\n * Is push.default still necessary if we had \"remote.*.push\" (where '*' is\n   literally an \"asterisk\") that is used as a fall-back default when there\n   is no \"remote.<name>.push\" for the remote we are about to push to?\n"},{"id":"107527","messageId":"7vbpsadymp.fsf@gitster.siamese.dyndns.org","threadId":"18238","inReplyTo":"alpine.DEB.1.00.0903100033400.6358@intel-tinevez-2-302","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-10T00:12:30Z","receivedAt":"2009-03-10T00:12:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> git push default change:\n>> \n>> git push will by default push \"nothing\" instead of \"matching\".\n>\n> Hasn't this been shot down already?  I do not want that change.  I think \n> it is harmful.\n>\n> At least without a proper way to prepare existing users for the end of the \n> world.\n\nI haven't actually read the patch, but my reading of the cover lette ris\nthat the four-patch sequence 4-to-7 is (meant to be, at least) structured\nthat way.\n"},{"id":"107529","messageId":"7v7i2ydyb3.fsf@gitster.siamese.dyndns.org","threadId":"18238","inReplyTo":"7vfxhmdyvn.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-10T00:19:28Z","receivedAt":"2009-03-10T00:19:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>    - Even if the answer to the above question is \"no\", are there other\n>      commands that we currently do not allow a quick shorthand to mean\n>      \"the default thing\", but would benefit from having one?  If so, how\n>      good does it look to use '-' as such a short-hand?\n\nI need \" for these other commands\" before the question mark at the end of\nthis sentence.\n\n>      In other words, is it safe to establish a precedent to use '-' to\n>      denote \"the default thing\"?  Would we later regret, saying that\n>      \"'git-frotz command would benefit from a short-hand notation for 'the\n>      default thing', but - is already taken -- it means send the output to\n>      the stdout\"?\n\nI need \", or something like that\" before the question mark at the end of\nthis sentence.\n\n>    - Do we use a short-hand '-' to mean something entirely different in\n>      the UI, making this new use of '-' to mean the default confusing?\n>\n>      I think '-' for checkout means \"the previous one\", which already\n>      answers this question somewhat.\n\nI am wondering if we can handle this by DWIMming the command line\narguments better.  For example, in all of these:\n\n\t$ git push HEAD\n        $ git push :\n        $ git push master\n\nwhen \"HEAD\", \":\", or \"master\" can only be refspec, we know that the user\nsaid \"I do not bother saying which repository to --- you know what I\nmean.\"  It would be natural to DWIM it to \"the default remote\" without\neven having to use your '-' notation.\n"},{"id":"107530","messageId":"76718490903091725j2bed43b0r4adca79e03dba96a@mail.gmail.com","threadId":"18238","inReplyTo":"1236638151-6465-5-git-send-email-finnag@pvv.org","subject":"Re: [PATCH 4/7] git push: Display warning on unconfigured default push","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-10T00:25:21Z","receivedAt":"2009-03-10T00:25:21Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Mon, Mar 9, 2009 at 6:35 PM, Finn Arne Gangstad <finnag@pvv.org> wrote:\n> +       \"  'nothing'  : Do not push anythig\",\n\ns/anythig/anything/\n\nj.\n"},{"id":"107555","messageId":"20090310084615.GA11448@pvv.org","threadId":"18238","inReplyTo":"alpine.DEB.1.00.0903100033400.6358@intel-tinevez-2-302","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-10T08:46:15Z","receivedAt":"2009-03-10T08:46:15Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Tue, Mar 10, 2009 at 12:35:12AM +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Mon, 9 Mar 2009, Finn Arne Gangstad wrote:\n> \n> > git push default change:\n> > \n> > git push will by default push \"nothing\" instead of \"matching\".\n> \n> Hasn't this been shot down already?  I do not want that change.  I think \n> it is harmful.\n> \n> At least without a proper way to prepare existing users for the end of the \n> world.\n\nThat is pretty much what patches 4 and 5 are about - add nice\nwarnings, but do not change behavior. 6 introduces the changed default.\n\n- Finn Arne\n"},{"id":"107556","messageId":"20090310085433.GB11448@pvv.org","threadId":"18238","inReplyTo":"alpine.LNX.1.00.0903091938150.19665@iabervon.org","subject":"Re: [PATCH 3/7] git push: New options --matching and --current","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-10T08:54:33Z","receivedAt":"2009-03-10T08:54:33Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Mon, Mar 09, 2009 at 07:49:47PM -0400, Daniel Barkalow wrote:\n> On Mon, 9 Mar 2009, Finn Arne Gangstad wrote:\n> \n> > diff --git a/transport.h b/transport.h\n> > index 6bbc1a8..b897d0c 100644\n> > --- a/transport.h\n> > +++ b/transport.h\n> > @@ -34,6 +34,15 @@ struct transport {\n> >  #define TRANSPORT_PUSH_DRY_RUN 4\n> >  #define TRANSPORT_PUSH_MIRROR 8\n> >  #define TRANSPORT_PUSH_VERBOSE 16\n> > +#define TRANSPORT_PUSH_MATCHING 32\n> > +#define TRANSPORT_PUSH_CURRENT 64\n> > +/**\n> > + * All push flags that imply a certain set of refspecs to be pushed must\n> > + * be combined into TRANSPORT_PUSH_MODE_MASK\n> > + **/\n> > +#define TRANSPORT_PUSH_MODE_MASK \\\n> > +    (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR | TRANSPORT_PUSH_MATCHING | \\\n> > +    TRANSPORT_PUSH_CURRENT)\n> \n> It's kind of odd that you define these flags as TRANSPORT_PUSH_*, but \n> implement them before entering transport_push(). I'm not sure which is \n> right, but the combination is odd. I think just taking care of it in \n> builtin-push with flags or options defined there is probably the best \n> thing, currently.\n\nTrue, this was not very beautiful. I will make something better.\n\n- Finn Arne\n"},{"id":"107560","messageId":"20090310100400.GC11448@pvv.org","threadId":"18238","inReplyTo":"7vfxhmdyvn.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-10T10:04:00Z","receivedAt":"2009-03-10T10:04:00Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Mon, Mar 09, 2009 at 05:07:08PM -0700, Junio C Hamano wrote:\n> Finn Arne Gangstad <finnag@pvv.org> writes:\n> \n> I think the last four are more or less sane, but I am not sure about the\n> first three, which makes it very unfortunate that the former depends on\n> the latter.\n\nNo problem splitting them up, there is just a single function that is\nshared between 1-3 and 4-7 really.\n\n[...]\n>  * What's the point of having --matching option, when you can already say\n>    ':', i.e.\n> \n> \t$ git push origin :\n\nIf you have the name of your remote easily available, --matching is\nidentical to \"git push remote :\". As I believe I found out, getting\nthe name of the current remote is a bit more tedious than it should\nbe, which is why I also suggested being able to use \"-\" as the current\nremote.\n\nIf a way to specify the default remote is possible, --matching would\nnot be necessary, but would probably be more obvious to the reader\nthan \"git push - :\" or whatever we can agree on.\n\n>  * What's the point of having --current option, when you can already\n> say HEAD, i.e.  $ git push origin HEAD\n\nIt does something very different. Maybe --tracking would be a better name.\n--current does basically this:\n\nbranch=`git-symbolic-ref HEAD`\nbranch=${branch#refs/heads/}\nremote=$(git config branch.$branch.remote)\n\nfor remotebranch in $(git config branch.$branch.merge); do\n\tgit push $remote $branch:$remotebranch\ndone\n\nThis is the shortest shell script sequence I could find to mimic the\nbehaviour, maybe I have missed something very obvious. All error\nhandling is removed for clarity.\n\nThe goal here is to be able to:\n\ngit checkout -b junios-next origin/next\ngit push --current  <=>  git push origin junios-next:next\n\ngit push origin HEAD would do git push origin junios-next:junios-next,\nwhich was not the intention.\n\nIt seems that there is an assumption that branch names are identical\nin different repositories, we find that that is not the case at all,\npeople choose local names that make sense to themselves. Or, from\nanother viewpoint, even if branches have the same name in two\nrepositories, they are not necessarily (strongly) related!\n\n\"A tracks B\" can be a much stronger relation than \"A has the same name\nas B\".\n\n>  * Is push.default still necessary if we had \"remote.*.push\" (where '*' is\n>    literally an \"asterisk\") that is used as a fall-back default when there\n>    is no \"remote.<name>.push\" for the remote we are about to push to?\n\nThe main reason for push.default is to be able to change the default\nbehaviour for git push to push nothing in a staged manner, and still\nlet people who are used to and fond of the old behavior continue as before.\n\nYou are thinking of something like this in .gitconfig?\n[remote \"*\"]\n\tpush = __something__\n\nPreviously you indicated that there is no way to specify the current\nmatching rule in a remote push line I think?\n\n- Finn Arne\n"},{"id":"298984","messageId":"alpine.DEB.1.00.0903101159530.14295@intel-tinevez-2-302","threadId":"18238","inReplyTo":"20090310084615.GA11448@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-10T11:01:00Z","receivedAt":"2009-03-10T11:01:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 10 Mar 2009, Finn Arne Gangstad wrote:\n\n> On Tue, Mar 10, 2009 at 12:35:12AM +0100, Johannes Schindelin wrote:\n> \n> > On Mon, 9 Mar 2009, Finn Arne Gangstad wrote:\n> > \n> > > git push default change:\n> > > \n> > > git push will by default push \"nothing\" instead of \"matching\".\n> > \n> > Hasn't this been shot down already?  I do not want that change.  I \n> > think it is harmful.\n> > \n> > At least without a proper way to prepare existing users for the end of \n> > the world.\n> \n> That is pretty much what patches 4 and 5 are about - add nice warnings, \n> but do not change behavior. 6 introduces the changed default.\n\nAh, so you meant that 1-5 should be committed right away, and 6 in one \nyear?\n\nCiao,\nDscho\n\n"},{"id":"299096","messageId":"20090310111233.GA10036@pvv.org","threadId":"18238","inReplyTo":"alpine.DEB.1.00.0903101159530.14295@intel-tinevez-2-302","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-10T11:12:34Z","receivedAt":"2009-03-10T11:12:34Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Tue, Mar 10, 2009 at 12:01:00PM +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Tue, 10 Mar 2009, Finn Arne Gangstad wrote:\n> \n> > On Tue, Mar 10, 2009 at 12:35:12AM +0100, Johannes Schindelin wrote:\n> > \n> > > [...]\n> > > At least without a proper way to prepare existing users for the end of \n> > > the world.\n> > \n> > That is pretty much what patches 4 and 5 are about - add nice warnings, \n> > but do not change behavior. 6 introduces the changed default.\n> \n> Ah, so you meant that 1-5 should be committed right away, and 6 in one \n> year?\n\nYes, that was the intention.\n\n- Finn Arne\n"},{"id":"107590","messageId":"76718490903100920v3d3a3d68xc7a258d92be56454@mail.gmail.com","threadId":"18238","inReplyTo":"20090310100400.GC11448@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-10T16:20:38Z","receivedAt":"2009-03-10T16:20:38Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Tue, Mar 10, 2009 at 6:04 AM, Finn Arne Gangstad <finnag@pvv.org> wrote:\n> You are thinking of something like this in .gitconfig?\n> [remote \"*\"]\n>        push = __something__\n>\n> Previously you indicated that there is no way to specify the current\n> matching rule in a remote push line I think?\n\nNo, you can. \"push = :\" works fine.\n\nHowever, there's no way to specify \"push = nothing\" currently.\n\nFWIW, I don't care for using remote.*.push for this use case. I think\npush.default is clearer here.\n\nj.\n"},{"id":"107597","messageId":"20090310175233.GA26351@sigill.intra.peff.net","threadId":"18238","inReplyTo":"1236638151-6465-1-git-send-email-finnag@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-10T17:52:33Z","receivedAt":"2009-03-10T17:52:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 09, 2009 at 11:35:44PM +0100, Finn Arne Gangstad wrote:\n\n> git push has learned two new command line options --matching and\n> --current, which override any configuration.  'matching' pushes all\n> branches that already exist at the remote, while 'current' pushes the\n> current branch to whatever it is tracking\n\nI have not been following this topic too closely, so can you please\nexplain (or point me to an explanation about) something? How do these\noptions interact with refspecs given on the command line? That is, why\nwould I choose to use:\n\n  git push --current\n\nover\n\n  git push - HEAD\n\n(assuming your earlier patch is applied, or \"git push HEAD\" if Junio's\nsuggested DWIMmery is implemented). And what does it mean to say\n\n  git push --matching - HEAD\n\n? Those are conflicting instructions. Is one followed and one discarded?\nAre they merged?\n\n-Peff\n"},{"id":"107614","messageId":"20090310220400.GA9612@pvv.org","threadId":"18238","inReplyTo":"20090310175233.GA26351@sigill.intra.peff.net","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-10T22:04:00Z","receivedAt":"2009-03-10T22:04:00Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Tue, Mar 10, 2009 at 01:52:33PM -0400, Jeff King wrote:\n> \n> I have not been following this topic too closely, so can you please\n> explain (or point me to an explanation about) something? How do these\n> options interact with refspecs given on the command line? That is, why\n> would I choose to use:\n> \n>   git push --current\n> \n> over\n> \n>   git push - HEAD\n\n--current pushs the current branch to whatever it is tracking, no\nmatter what name it has (i.e. it can push to a branch of different\nname). If it is not tracking anything, it will not push.\n\ngit push - HEAD pushes the current branch to a branch of the same name\non the \"current remote\", which defaults to origin if nothing is set up\nfor the branch.\n\n> (assuming your earlier patch is applied, or \"git push HEAD\" if Junio's\n> suggested DWIMmery is implemented). And what does it mean to say\n> \n>   git push --matching - HEAD\n> \n> ? Those are conflicting instructions. Is one followed and one discarded?\n> Are they merged?\n\nIt would be an error, no refspecs can be specified with --matching.\n\n- Finn Arne\n"},{"id":"107615","messageId":"20090310221010.GA13452@coredump.intra.peff.net","threadId":"18238","inReplyTo":"20090310220400.GA9612@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-10T22:10:10Z","receivedAt":"2009-03-10T22:10:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 10, 2009 at 11:04:00PM +0100, Finn Arne Gangstad wrote:\n\n> --current pushs the current branch to whatever it is tracking, no\n> matter what name it has (i.e. it can push to a branch of different\n> name). If it is not tracking anything, it will not push.\n> \n> git push - HEAD pushes the current branch to a branch of the same name\n> on the \"current remote\", which defaults to origin if nothing is set up\n> for the branch.\n\nOK, that's what I was missing. Thanks.\n\n-Peff\n"},{"id":"107629","messageId":"76718490903101857v1b5825a6l145b6bcc51743325@mail.gmail.com","threadId":"18238","inReplyTo":"20090310220400.GA9612@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-11T01:57:25Z","receivedAt":"2009-03-11T01:57:25Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Tue, Mar 10, 2009 at 6:04 PM, Finn Arne Gangstad <finnag@pvv.org> wrote:\n> --current pushs the current branch to whatever it is tracking, no\n> matter what name it has (i.e. it can push to a branch of different\n> name). If it is not tracking anything, it will not push.\n\nI think the option is definitely misnamed then. If it survives the\nlist feedback, it should probably be called something like --tracked.\n\nj.\n"},{"id":"107735","messageId":"7v7i2v4x2v.fsf@gitster.siamese.dyndns.org","threadId":"18238","inReplyTo":"20090310100400.GC11448@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-11T20:35:20Z","receivedAt":"2009-03-11T20:35:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Finn Arne Gangstad <finnag@pvv.org> writes:\n\n> On Mon, Mar 09, 2009 at 05:07:08PM -0700, Junio C Hamano wrote:\n> ...\n>>  * What's the point of having --current option, when you can already\n>> say HEAD, i.e.  $ git push origin HEAD\n>\n> It does something very different. Maybe --tracking would be a better name.\n> --current does basically this:\n> ...\n> The goal here is to be able to:\n>\n> git checkout -b junios-next origin/next\n> git push --current  <=>  git push origin junios-next:next\n>\n> git push origin HEAD would do git push origin junios-next:junios-next,\n> which was not the intention.\n\nOk, now that sort of makes sense, and is very different from people would\nexpect from --current, which I think most people would associate with\nHEAD.  \"tracking\" or \"track back\" would be a better name.\n"},{"id":"107759","messageId":"20090312120109.6117@nanako3.lavabit.com","threadId":"18238","inReplyTo":"7v7i2v4x2v.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-03-12T03:01:09Z","receivedAt":"2009-03-12T03:01:09Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Junio C Hamano <gitster@pobox.com>:\n\n> Finn Arne Gangstad <finnag@pvv.org> writes:\n>\n>> On Mon, Mar 09, 2009 at 05:07:08PM -0700, Junio C Hamano wrote:\n>> ...\n>>>  * What's the point of having --current option, when you can already\n>>> say HEAD, i.e.  $ git push origin HEAD\n>>\n>> It does something very different. Maybe --tracking would be a better name.\n>> --current does basically this:\n>> ...\n>> The goal here is to be able to:\n>>\n>> git checkout -b junios-next origin/next\n>> git push --current  <=>  git push origin junios-next:next\n>>\n>> git push origin HEAD would do git push origin junios-next:junios-next,\n>> which was not the intention.\n>\n> Ok, now that sort of makes sense, and is very different from people would\n> expect from --current, which I think most people would associate with\n> HEAD.  \"tracking\" or \"track back\" would be a better name.\n\nI think this proposal has deeper problems than just that.\n\nThere can be two reasons you may want to give the branch a name other than 'next':\n\n1. Because you also have dschos-next that tracks remotes/dscho/next; or\n\n2. Because you also have junios-next2 that also tracks remotes/origin/next.\n\nThe first case indicates that the project is using a workflow where each developer has his own publishing repository [1], and it is very unlikely that Finn Arne has push access to either your or Johannes'es public repositories.\n\nThe second case of tracking a single branch with more than one is unnecessarily confusing. If you are on junios-next and you push (and we assume that you are Junio and have push access to the remote repository), after such a push you need to update junios-next2 somehow, either by rebasing or by merging. The reason junios-next2 branch needs updating is because it has changes unrelated to what you pushed out from your junios-next branch to the outside world as 'next'.\n\nIn such a case, wouldn't it be much easier to understand and manage if you had a single 'next' branch that has changes ready to be shown to the remote 'next', and make other topic branches fork from and track your local 'next' instead?\n\nYour changes based on the public 'next' that everybody else sees need to get first integrated and tested in your local repository before getting pushed out to the remote 'next' branch in any case.\n\nYou certainly could switch between junios-next and junios-next2 branches that both track the public 'next' branch, and make sure you will integrate everything you need to send to the public repository no matter what branch you are currently working on. Unless you do so, 'git push' will refuse to accept an update that isn't a fast-forward anyway, so it certainly possible to work with more than one local branches that track a single remote branch.\n\nBut in order to do this correctly, you need to be aware what each branch is meant to contain, and for which public branch you are developing your changes on it. I think that way of working leads to the confusion and perceived need for the \"--current\" option: \"I don't know which remote branch the changes I made on the current branch should be pushed to, and --current option remembers it for me, so I don't have to\". That new option may be solving \"where to push to\" part but I'm afraid the option not just leaves \"I still need to know for which public branch I am supposed to make changes while on this branch\" unsolved, but by making people rely on the option I think it makes the latter problem much worse.\n\nDedicating your local 'next' for the integration purpose to prepare what you push to your public 'next' is much easier to understand and explain to new people. Once a topic that is meant to be published on your 'next' becomes ready, you merge the branch locally to your own 'next', and you have a chance to review that you didn't accidentally included changes inappropriate for 'next' when you create the merge. You push the result out after you are happy.\n\nAnd I think the above discussion holds true if the public 'next' isn't your 'next', but a branch shared with others in a central repository.\n\nI don't understand how the new \"--current\" makes \"sort-of\" sense. It looks like it is making the command more complex and the only thing it does is to encourage a confused workflow.\n\n[1] Your http://gitster.livejournal.com/30645.html showed different ways to collaborate very nicely. I think this is the third approach in your article.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"107796","messageId":"20090312102243.GA27665@pvv.org","threadId":"18238","inReplyTo":"20090312120109.6117@nanako3.lavabit.com","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-12T10:22:43Z","receivedAt":"2009-03-12T10:22:43Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Thu, Mar 12, 2009 at 12:01:09PM +0900, Nanako Shiraishi wrote:\n\n[...]\n> There can be two reasons you may want to give the branch a name other than 'next':\n> \n> 1. Because you also have dschos-next that tracks remotes/dscho/next; or\n> \n> 2. Because you also have junios-next2 that also tracks remotes/origin/next.\n\n> The first case indicates that the project is using a workflow where\n> each developer has his own publishing repository [1], and it is very\n> unlikely that Finn Arne has push access to either your or\n> Johannes'es public repositories.\n\nNo, think more of different repositories with different function, such\nas \"my-public\", \"my-group\", \"beta\", \"customers\", \"public\" and so on.\nYou can have multiple repositories with different function. They (can)\nhave branches with the same name, but have different purposes. To\ntrack more than one you _must_ rename at least one locally (and just\nwith two remotes \"master\" is going to give you some issues).\n\nMaybe you want the name in the public repo to be different than the\nname in your own repo.\n\n[...]\n\n> I don't understand how the new \"--current\" makes \"sort-of\" sense. It\n> looks like it is making the command more complex and the only thing\n> it does is to encourage a confused workflow.\n\nThe naming --current was not good, so I have changed it to --tracking\nin my latest suggestion.  Why is it confused?  Why do I need to call\nmy branch locally the same as it is named remotely?  That does not\nscale. Branch names are unique per repository, not globally.\n\nI want to be able to \"git pull\" and then \"git push --tracking\" back to\nthe same branch, not push somewhere else. Curently this requires a\nsurprisingly complicated shellscript, and is not available from the\nguis.\n\n> [1] Your http://gitster.livejournal.com/30645.html showed different\n> ways to collaborate very nicely. I think this is the third approach\n> in your article.\n\nThe main problem with all these examples is that the underlying\nassumption is that you can always use the same branch name locally and\nremotely.  This just isn't always the case when you have many remotes,\nand each remote repository has some implicit function (e.g. \"beta\",\n\"john\", \"graphics-group\", \"my-public\", .....), and they have an active\n\"master\" branch for example.\n\n- Finn Arne\n"},{"id":"107800","messageId":"buomybrqahe.fsf@dhlpc061.dev.necel.com","threadId":"18238","inReplyTo":"20090312102243.GA27665@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2009-03-12T10:52:29Z","receivedAt":"2009-03-12T10:52:29Z","isPatch":true,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Finn Arne Gangstad <finnag@pvv.org> writes:\n> The main problem with all these examples is that the underlying\n> assumption is that you can always use the same branch name locally and\n> remotely.\n\nPresumably the push --track option would be used with an explicit branch\nname given to push anyway, right?  Then it can use that info to set up\nthe tracking flexibly (and with sane defaults).\n\nE.g.,, simple case:\n\n    git push --track SOME_REMOTE BRANCH_NAME\n\ncomplex case:\n\n    git push --track SOME_REMOTE MY-BRANCH:REMOTE-BRANCH\n\n-Miles\n\n-- \n=====\n(^o^;\n(()))\n*This is the cute octopus virus, please copy it into your sig so it can spread.\n"},{"id":"107816","messageId":"20090312122047.GA14157@pvv.org","threadId":"18238","inReplyTo":"buomybrqahe.fsf@dhlpc061.dev.necel.com","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2009-03-12T12:20:47Z","receivedAt":"2009-03-12T12:20:47Z","isPatch":true,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Thu, Mar 12, 2009 at 07:52:29PM +0900, Miles Bader wrote:\n> Finn Arne Gangstad <finnag@pvv.org> writes:\n> > The main problem with all these examples is that the underlying\n> > assumption is that you can always use the same branch name locally and\n> > remotely.\n> \n> Presumably the push --track option would be used with an explicit branch\n> name given to push anyway, right?  Then it can use that info to set up\n> the tracking flexibly (and with sane defaults).\n> \n> E.g.,, simple case:\n> \n>     git push --track SOME_REMOTE BRANCH_NAME\n> \n> complex case:\n> \n>     git push --track SOME_REMOTE MY-BRANCH:REMOTE-BRANCH\n\nYes, git push --track ... would typically do the same thing to the\nconfig as git checkout -b MY-BRANCH SOME_REMOTE/REMOTE-BRANCH, which\nis enough for push --tracking to do its thing.\n\nI am not sure if you mean that git push --track could do something\nextra to make --tracking unecessary for git push, currently it cannot\ndo that since the push configuration is per remote, not per branch.\n\n- Finn Arne\n"},{"id":"107918","messageId":"buohc1xddxa.fsf@dhlpc061.dev.necel.com","threadId":"18238","inReplyTo":"20090312122047.GA14157@pvv.org","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2009-03-13T08:28:49Z","receivedAt":"2009-03-13T08:28:49Z","isPatch":true,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Finn Arne Gangstad <finnag@pvv.org> writes:\n>> Presumably the push --track option would be used with an explicit branch\n>> name given to push anyway, right?  Then it can use that info to set up\n>> the tracking flexibly (and with sane defaults).\n>> \n>> E.g.,, simple case:\n>>     git push --track SOME_REMOTE BRANCH_NAME\n>> \n>> complex case:\n>>     git push --track SOME_REMOTE MY-BRANCH:REMOTE-BRANCH\n>\n> Yes, git push --track ... would typically do the same thing to the\n> config as git checkout -b MY-BRANCH SOME_REMOTE/REMOTE-BRANCH, which\n> is enough for push --tracking to do its thing.\n>\n> I am not sure if you mean that git push --track could do something\n> extra to make --tracking unecessary for git push, currently it cannot\n> do that since the push configuration is per remote, not per branch.\n\nHmm, now I'm confused... I was just thinking about --track, but am not\nsure what --tracking is ... need to go grovel past posts...\n\n-Miles\n\n-- \nHappiness, n. An agreeable sensation arising from contemplating the misery of\nanother.\n"},{"id":"107922","messageId":"43d8ce650903130307u2944ca8n3191ca7c9fb7e30f@mail.gmail.com","threadId":"18238","inReplyTo":"buohc1xddxa.fsf@dhlpc061.dev.necel.com","subject":"Re: [RFC/PATCH] git push usability improvements and default change","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-13T10:07:15Z","receivedAt":"2009-03-13T10:07:15Z","isPatch":true,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"Hi,\n\n   What's the status of these patches?  Will be commited?\n\nJohn\n\n2009/3/13 Miles Bader <miles@gnu.org>:\n> Finn Arne Gangstad <finnag@pvv.org> writes:\n>>> Presumably the push --track option would be used with an explicit branch\n>>> name given to push anyway, right?  Then it can use that info to set up\n>>> the tracking flexibly (and with sane defaults).\n>>>\n>>> E.g.,, simple case:\n>>>     git push --track SOME_REMOTE BRANCH_NAME\n>>>\n>>> complex case:\n>>>     git push --track SOME_REMOTE MY-BRANCH:REMOTE-BRANCH\n>>\n>> Yes, git push --track ... would typically do the same thing to the\n>> config as git checkout -b MY-BRANCH SOME_REMOTE/REMOTE-BRANCH, which\n>> is enough for push --tracking to do its thing.\n>>\n>> I am not sure if you mean that git push --track could do something\n>> extra to make --tracking unecessary for git push, currently it cannot\n>> do that since the push configuration is per remote, not per branch.\n>\n> Hmm, now I'm confused... I was just thinking about --track, but am not\n> sure what --tracking is ... need to go grovel past posts...\n>\n> -Miles\n>\n> --\n> Happiness, n. An agreeable sensation arising from contemplating the misery of\n> another.\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"}]}