{"thread":{"id":"33354","subject":"[BUG] inconsistent behavior with --set-upstream vs --set-upstream-to","startedAt":"2013-04-02T17:07:01Z","lastAt":"2013-04-02T21:50:47Z","messageCount":15,"participants":["Garrett Cooper","Jeff King","Jonathan Nieder","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"212909","messageId":"F58991CB-9C83-4DA6-B82B-2E6C874C30EB@gmail.com","threadId":"33354","inReplyTo":null,"subject":"[BUG] inconsistent behavior with --set-upstream vs --set-upstream-to","fromName":"Garrett Cooper","fromEmail":"yaneurabeya@gmail.com","sentAt":"2013-04-02T17:07:01Z","receivedAt":"2013-04-02T17:07:01Z","isPatch":false,"sender":{"key":"yaneurabeya@gmail.com","avatar":"https://gravatar.com/avatar/48933e620edcd6784a0d640769b899693e42bce6c259e4a41bc612754a41285d?d=mp&s=160"},"body":"Hi!\n\tIt looks like git branch --set-upstream-to doesn't function with 1.8.1.3 until I run --set-upstream. Is this a known bug?\n\nroot@fuji-current:/usr/src # git branch --set-upstream-to origin/pjdfstest-onefs pjdfstest-onefs\nfatal: Not a valid object name: 'origin/pjdfstest-onefs'.\nroot@fuji-current:/usr/src # git branch --set-upstream origin/pjdfstest-onefs pjdfstest-onefs\nThe --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to\nBranch origin/pjdfstest-onefs set up to track local branch pjdfstest-onefs.\nroot@fuji-current:/usr/src # git branch --set-upstream-to origin/pjdfstest-onefs pjdfstest-onefs\nBranch pjdfstest-onefs set up to track local branch origin/pjdfstest-onefs.\nroot@fuji-current:/usr/src # git --version\ngit version 1.8.1.3\n\nThanks!\n-Garrett\n\nPS Please CC me as I'm not subscribed to the list."},{"id":"212916","messageId":"20130402172333.GB24698@sigill.intra.peff.net","threadId":"33354","inReplyTo":"F58991CB-9C83-4DA6-B82B-2E6C874C30EB@gmail.com","subject":"Re: [BUG] inconsistent behavior with --set-upstream vs --set-upstream-to","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T17:23:33Z","receivedAt":"2013-04-02T17:23:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 02, 2013 at 10:07:01AM -0700, Garrett Cooper wrote:\n\n> \tIt looks like git branch --set-upstream-to doesn't function with 1.8.1.3 until I run --set-upstream. Is this a known bug?\n\nNo, but I do not think that is exactly what is going on.\n\n> root@fuji-current:/usr/src # git branch --set-upstream-to origin/pjdfstest-onefs pjdfstest-onefs\n> fatal: Not a valid object name: 'origin/pjdfstest-onefs'.\n\nThis is complaining that origin/pjdfstest-onefs does not actually exist\nDoes it? If the pjdfstest-onefs branch exists on the remote, do you need\nto do a \"git fetch\" to make sure we have a local\nrefs/remotes/origin/pjdfstest-onefs tracking branch locally?\n\n> root@fuji-current:/usr/src # git branch --set-upstream origin/pjdfstest-onefs pjdfstest-onefs\n> The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to\n> Branch origin/pjdfstest-onefs set up to track local branch pjdfstest-onefs.\n\nThis did _not_ create the remote-tracking branch refs/remotes/origin/pjdfstest-onefs.\nIt created a new local branch called \"origin/pjdfstest-onefs\" (i.e.,\nrefs/heads/origin/pjdfstest-onefs), whose upstream is another local\nbranch \"pjdfstest-onefs\". That \"backwards\" order to the arguments is why\n--set-upstream is deprecated; many people have made the same mistake.\n\n> root@fuji-current:/usr/src # git branch --set-upstream-to origin/pjdfstest-onefs pjdfstest-onefs\n> Branch pjdfstest-onefs set up to track local branch origin/pjdfstest-onefs.\n\nNote how it says \"local branch\" here; you are not tracking anything at\nthe origin. You are tracking a local branch that happens to have\n\"origin/\" in the name.\n\n-Peff\n"},{"id":"212920","messageId":"A4C40BCB-85DD-4BCB-8BF0-79A75DE73211@gmail.com","threadId":"33354","inReplyTo":"20130402172333.GB24698@sigill.intra.peff.net","subject":"Re: [BUG] inconsistent behavior with --set-upstream vs --set-upstream-to","fromName":"Garrett Cooper","fromEmail":"yaneurabeya@gmail.com","sentAt":"2013-04-02T17:30:35Z","receivedAt":"2013-04-02T17:30:35Z","isPatch":false,"sender":{"key":"yaneurabeya@gmail.com","avatar":"https://gravatar.com/avatar/48933e620edcd6784a0d640769b899693e42bce6c259e4a41bc612754a41285d?d=mp&s=160"},"body":"On Apr 2, 2013, at 10:23 AM, Jeff King <peff@peff.net> wrote:\n\n> On Tue, Apr 02, 2013 at 10:07:01AM -0700, Garrett Cooper wrote:\n> \n>>    It looks like git branch --set-upstream-to doesn't function with 1.8.1.3 until I run --set-upstream. Is this a known bug?\n> \n> No, but I do not think that is exactly what is going on.\n> \n>> root@fuji-current:/usr/src # git branch --set-upstream-to origin/pjdfstest-onefs pjdfstest-onefs\n>> fatal: Not a valid object name: 'origin/pjdfstest-onefs'.\n> \n> This is complaining that origin/pjdfstest-onefs does not actually exist\n> Does it? If the pjdfstest-onefs branch exists on the remote, do you need\n> to do a \"git fetch\" to make sure we have a local\n> refs/remotes/origin/pjdfstest-onefs tracking branch locally?\n> \n>> root@fuji-current:/usr/src # git branch --set-upstream origin/pjdfstest-onefs pjdfstest-onefs\n>> The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to\n>> Branch origin/pjdfstest-onefs set up to track local branch pjdfstest-onefs.\n> \n> This did _not_ create the remote-tracking branch refs/remotes/origin/pjdfstest-onefs.\n> It created a new local branch called \"origin/pjdfstest-onefs\" (i.e.,\n> refs/heads/origin/pjdfstest-onefs), whose upstream is another local\n> branch \"pjdfstest-onefs\". That \"backwards\" order to the arguments is why\n> --set-upstream is deprecated; many people have made the same mistake.\n> \n>> root@fuji-current:/usr/src # git branch --set-upstream-to origin/pjdfstest-onefs pjdfstest-onefs\n>> Branch pjdfstest-onefs set up to track local branch origin/pjdfstest-onefs.\n> \n> Note how it says \"local branch\" here; you are not tracking anything at\n> the origin. You are tracking a local branch that happens to have\n> \"origin/\" in the name.\n\nI push the branch to origin/ and then things tend to work, but since I obviously had been doing things wrong what's the correct order of operations for creating a branch and setting the upstream appropriately?\n\nThanks!\n-Garrett\n\nPS I love git as a tool, but I really wish the workflows were simpler or more straightforward, and error messages were clearer. It seems like this would help prevent usage errors like this.."},{"id":"212927","messageId":"20130402175113.GD24698@sigill.intra.peff.net","threadId":"33354","inReplyTo":"A4C40BCB-85DD-4BCB-8BF0-79A75DE73211@gmail.com","subject":"Re: [BUG] inconsistent behavior with --set-upstream vs --set-upstream-to","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T17:51:13Z","receivedAt":"2013-04-02T17:51:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 02, 2013 at 10:30:35AM -0700, Garrett Cooper wrote:\n\n> I push the branch to origin/ and then things tend to work, but since I\n> obviously had been doing things wrong what's the correct order of\n> operations for creating a branch and setting the upstream\n> appropriately?\n\nOnce you have pushed it, the push creates the refs/remotes/origin/foo\ntracking branch automatically. You are then free to reference it\nwherever you like, including in set-upstream-to. However, you can also\njust ask push to do it for you with \"--set-upstream\" or \"-u\". So the\nworkflow is something like:\n\n  $ git checkout -b my-topic\n  $ hack hack hack\n  $ git commit -m \"looking good, time to publish\"\n  $ git push -u origin HEAD\n\n> PS I love git as a tool, but I really wish the workflows were simpler\n> or more straightforward, and error messages were clearer. It seems\n> like this would help prevent usage errors like this..\n\nThings slowly improve as people make suggestions. I think the thing that\nmight have helped here is better advice when \"set-upstream-to\" is\npointed to a ref that does not exist.\n\nPatches coming in a minute.\n\n-Peff\n"},{"id":"212935","messageId":"20130402190134.GA17784@sigill.intra.peff.net","threadId":"33354","inReplyTo":"20130402175113.GD24698@sigill.intra.peff.net","subject":"[RFC/PATCH 0/5] branch --set-upstream-to error-message improvements","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T19:01:34Z","receivedAt":"2013-04-02T19:01:34Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 02, 2013 at 01:51:13PM -0400, Jeff King wrote:\n\n> Things slowly improve as people make suggestions. I think the thing that\n> might have helped here is better advice when \"set-upstream-to\" is\n> pointed to a ref that does not exist.\n> \n> Patches coming in a minute.\n\nOr 60 minutes. :)\n\nI'm not decided on whether the last patch is overkill or not (or even if\nit is not, whether it may end up confusing people who do not fit into\none of the slots it suggests).\n\n  [1/5]: t3200: test --set-upstream-to with bogus refs\n  [2/5]: branch: factor out \"upstream is not a branch\" error messages\n  [3/5]: branch: improve error message for missing --set-upstream-to ref\n  [4/5]: branch: mention start_name in set-upstream error messages\n  [5/5]: branch: give advice when tracking start-point is missing\n\n-Peff\n"},{"id":"212936","messageId":"20130402190252.GA32316@sigill.intra.peff.net","threadId":"33354","inReplyTo":"20130402190134.GA17784@sigill.intra.peff.net","subject":"[PATCH 1/5] t3200: test --set-upstream-to with bogus refs","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T19:02:53Z","receivedAt":"2013-04-02T19:02:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"These tests pass with the current code, but let's make sure\nwe don't accidentally break the behavior in the future.\n\nNote that our tests expect failure when we try to set the\nupstream to or from a missing branch. Technically we are\njust munging config here, so we do not need the refs to\nexist. But seeing that they do exist is a good check that\nthe user has not made a typo.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/t3200-branch.sh | 12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex b08c9f2..09f65f8 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -409,6 +409,18 @@ test_expect_success '--set-upstream-to fails on detached HEAD' '\n \tgit checkout -\n '\n \n+test_expect_success '--set-upstream-to fails on a missing dst branch' '\n+\ttest_must_fail git branch --set-upstream-to master does-not-exist\n+'\n+\n+test_expect_success '--set-upstream-to fails on a missing src branch' '\n+\ttest_must_fail git branch --set-upstream-to does-not-exist master\n+'\n+\n+test_expect_success '--set-upstream-to fails on a non-ref' '\n+\ttest_must_fail git branch --set-upstream-to HEAD^{}\n+'\n+\n test_expect_success 'use --set-upstream-to modify HEAD' '\n \ttest_config branch.master.remote foo &&\n \ttest_config branch.master.merge foo &&\n-- \n1.8.2.rc0.33.gd915649\n"},{"id":"212939","messageId":"20130402190355.GB32316@sigill.intra.peff.net","threadId":"33354","inReplyTo":"20130402190134.GA17784@sigill.intra.peff.net","subject":"[PATCH 2/5] branch: factor out \"upstream is not a branch\" error messages","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T19:03:55Z","receivedAt":"2013-04-02T19:03:55Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This message is duplicated, and is quite long. Let's factor\nit out, which avoids the repetition and the long lines. It\nwill also make future patches easier as we tweak the\nmessage.\n\nWhile we're at it, let's also mark it for translation.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n branch.c | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/branch.c b/branch.c\nindex 2bef1e7..1acbd4e 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -197,6 +197,9 @@ int validate_new_branchname(const char *name, struct strbuf *ref,\n \treturn 1;\n }\n \n+static const char upstream_not_branch[] =\n+N_(\"Cannot setup tracking information; starting point is not a branch.\");\n+\n void create_branch(const char *head,\n \t\t   const char *name, const char *start_name,\n \t\t   int force, int reflog, int clobber_head,\n@@ -231,14 +234,14 @@ void create_branch(const char *head,\n \tcase 0:\n \t\t/* Not branching from any existing branch */\n \t\tif (explicit_tracking)\n-\t\t\tdie(\"Cannot setup tracking information; starting point is not a branch.\");\n+\t\t\tdie(_(upstream_not_branch));\n \t\tbreak;\n \tcase 1:\n \t\t/* Unique completion -- good, only if it is a real branch */\n \t\tif (prefixcmp(real_ref, \"refs/heads/\") &&\n \t\t    prefixcmp(real_ref, \"refs/remotes/\")) {\n \t\t\tif (explicit_tracking)\n-\t\t\t\tdie(\"Cannot setup tracking information; starting point is not a branch.\");\n+\t\t\t\tdie(_(upstream_not_branch));\n \t\t\telse\n \t\t\t\treal_ref = NULL;\n \t\t}\n-- \n1.8.2.rc0.33.gd915649\n"},{"id":"212948","messageId":"20130402190427.GC32316@sigill.intra.peff.net","threadId":"33354","inReplyTo":"20130402190134.GA17784@sigill.intra.peff.net","subject":"[PATCH 3/5] branch: improve error message for missing --set-upstream-to ref","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T19:04:27Z","receivedAt":"2013-04-02T19:04:27Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"If we are trying to set the upstream config for a branch,\nthe create_branch function will check both that the name\nresolves as a ref, and that it is either a local or\nremote-tracking branch.\n\nHowever, before we do so we run get_sha1 on it to find out\nwhether it resolves at all (since the create_branch function\nis also used to create actual branches, it wants to know\nwhere to start the new branch). This means that if you feed\na ref that does not exist to \"branch --set-upstream-to\",\nrather than getting a helpful message about tracking, you\nonly get \"not a valid object name\".\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n branch.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/branch.c b/branch.c\nindex 1acbd4e..060e9e3 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -199,6 +199,8 @@ N_(\"Cannot setup tracking information; starting point is not a branch.\");\n \n static const char upstream_not_branch[] =\n N_(\"Cannot setup tracking information; starting point is not a branch.\");\n+static const char upstream_missing[] =\n+N_(\"Cannot setup tracking information; starting point does not exist\");\n \n void create_branch(const char *head,\n \t\t   const char *name, const char *start_name,\n@@ -227,8 +229,11 @@ void create_branch(const char *head,\n \t}\n \n \treal_ref = NULL;\n-\tif (get_sha1(start_name, sha1))\n+\tif (get_sha1(start_name, sha1)) {\n+\t\tif (explicit_tracking)\n+\t\t\tdie(_(upstream_missing));\n \t\tdie(\"Not a valid object name: '%s'.\", start_name);\n+\t}\n \n \tswitch (dwim_ref(start_name, strlen(start_name), sha1, &real_ref)) {\n \tcase 0:\n-- \n1.8.2.rc0.33.gd915649\n"},{"id":"212954","messageId":"20130402190451.GD32316@sigill.intra.peff.net","threadId":"33354","inReplyTo":"20130402190134.GA17784@sigill.intra.peff.net","subject":"[PATCH 4/5] branch: mention start_name in set-upstream error messages","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T19:04:51Z","receivedAt":"2013-04-02T19:04:51Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"If we refuse a branch operation because the tracking\nstart_name the user gave us is bogus, we just print\nsomething like:\n\n fatal: Cannot setup tracking information; start point is not a branch\n\nIf we mention the actual name we tried to use, that may help\nthe user figure out why it didn't work (e.g., if they gave\nus the arguments in the wrong order).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n branch.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/branch.c b/branch.c\nindex 060e9e3..d6f4001 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -198,9 +198,9 @@ static const char upstream_missing[] =\n }\n \n static const char upstream_not_branch[] =\n-N_(\"Cannot setup tracking information; starting point is not a branch.\");\n+N_(\"Cannot setup tracking information; starting point '%s' is not a branch.\");\n static const char upstream_missing[] =\n-N_(\"Cannot setup tracking information; starting point does not exist\");\n+N_(\"Cannot setup tracking information; starting point '%s' does not exist\");\n \n void create_branch(const char *head,\n \t\t   const char *name, const char *start_name,\n@@ -231,7 +231,7 @@ void create_branch(const char *head,\n \treal_ref = NULL;\n \tif (get_sha1(start_name, sha1)) {\n \t\tif (explicit_tracking)\n-\t\t\tdie(_(upstream_missing));\n+\t\t\tdie(_(upstream_missing), start_name);\n \t\tdie(\"Not a valid object name: '%s'.\", start_name);\n \t}\n \n@@ -239,14 +239,14 @@ void create_branch(const char *head,\n \tcase 0:\n \t\t/* Not branching from any existing branch */\n \t\tif (explicit_tracking)\n-\t\t\tdie(_(upstream_not_branch));\n+\t\t\tdie(_(upstream_not_branch), start_name);\n \t\tbreak;\n \tcase 1:\n \t\t/* Unique completion -- good, only if it is a real branch */\n \t\tif (prefixcmp(real_ref, \"refs/heads/\") &&\n \t\t    prefixcmp(real_ref, \"refs/remotes/\")) {\n \t\t\tif (explicit_tracking)\n-\t\t\t\tdie(_(upstream_not_branch));\n+\t\t\t\tdie(_(upstream_not_branch), start_name);\n \t\t\telse\n \t\t\t\treal_ref = NULL;\n \t\t}\n-- \n1.8.2.rc0.33.gd915649\n"},{"id":"212955","messageId":"20130402190512.GE32316@sigill.intra.peff.net","threadId":"33354","inReplyTo":"20130402190134.GA17784@sigill.intra.peff.net","subject":"[PATCH 5/5] branch: give advice when tracking start-point is missing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T19:05:12Z","receivedAt":"2013-04-02T19:05:12Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"If the user requests to --set-upstream-to a branch that does\nnot exist, then either:\n\n  1. It was a typo.\n\n  2. They thought the branch should exist.\n\nIn case (1), there is not much we can do beyond showing the\nname we tried to use. For case (2), though, we can help to\nguide them through common workflows.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n advice.c |  2 ++\n advice.h |  1 +\n branch.c | 19 +++++++++++++++++--\n 3 files changed, 20 insertions(+), 2 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex 3bc8626..a8deee6 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -13,6 +13,7 @@ int advice_detached_head = 1;\n int advice_resolve_conflict = 1;\n int advice_implicit_identity = 1;\n int advice_detached_head = 1;\n+int advice_set_upstream_failure = 1;\n \n static struct {\n \tconst char *name;\n@@ -31,6 +32,7 @@ static struct {\n \t{ \"resolveconflict\", &advice_resolve_conflict },\n \t{ \"implicitidentity\", &advice_implicit_identity },\n \t{ \"detachedhead\", &advice_detached_head },\n+\t{ \"setupstreamfailure\", &advice_set_upstream_failure },\n \n \t/* make this an alias for backward compatibility */\n \t{ \"pushnonfastforward\", &advice_push_update_rejected }\ndiff --git a/advice.h b/advice.h\nindex af0c983..94caa32 100644\n--- a/advice.h\n+++ b/advice.h\n@@ -16,6 +16,7 @@ extern int advice_detached_head;\n extern int advice_resolve_conflict;\n extern int advice_implicit_identity;\n extern int advice_detached_head;\n+extern int advice_set_upstream_failure;\n \n int git_default_advice_config(const char *var, const char *value);\n void advise(const char *advice, ...);\ndiff --git a/branch.c b/branch.c\nindex d6f4001..6ae6a4c 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -200,7 +200,16 @@ static const char upstream_missing[] =\n static const char upstream_not_branch[] =\n N_(\"Cannot setup tracking information; starting point '%s' is not a branch.\");\n static const char upstream_missing[] =\n-N_(\"Cannot setup tracking information; starting point '%s' does not exist\");\n+N_(\"the requested upstream branch '%s' does not exist\");\n+static const char upstream_advice[] =\n+N_(\"\\n\"\n+\"If you are planning on basing your work on an upstream\\n\"\n+\"branch that already exists at the remote, you may need to\\n\"\n+\"run \\\"git fetch\\\" to retrieve it.\\n\"\n+\"\\n\"\n+\"If you are planning to push out a new local branch that\\n\"\n+\"will track its remote counterpart, you may want to use\\n\"\n+\"\\\"git push -u\\\" to set the upstream config as you push.\");\n \n void create_branch(const char *head,\n \t\t   const char *name, const char *start_name,\n@@ -230,8 +239,14 @@ void create_branch(const char *head,\n \n \treal_ref = NULL;\n \tif (get_sha1(start_name, sha1)) {\n-\t\tif (explicit_tracking)\n+\t\tif (explicit_tracking) {\n+\t\t\tif (advice_set_upstream_failure) {\n+\t\t\t\terror(_(upstream_missing), start_name);\n+\t\t\t\tadvise(_(upstream_advice));\n+\t\t\t\texit(1);\n+\t\t\t}\n \t\t\tdie(_(upstream_missing), start_name);\n+\t\t}\n \t\tdie(\"Not a valid object name: '%s'.\", start_name);\n \t}\n \n-- \n1.8.2.rc0.33.gd915649\n"},{"id":"212957","messageId":"20130402190808.GH28148@google.com","threadId":"33354","inReplyTo":"A4C40BCB-85DD-4BCB-8BF0-79A75DE73211@gmail.com","subject":"Re: [BUG] inconsistent behavior with --set-upstream vs --set-upstream-to","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-04-02T19:08:08Z","receivedAt":"2013-04-02T19:08:08Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Garrett Cooper wrote:\n\n> I push the branch to origin/ and then things tend to work, but since\n> I obviously had been doing things wrong what's the correct order of\n> operations for creating a branch and setting the upstream\n> appropriately?\n\ngit push -u origin pjdfstest-onefs\n\nThanks for a useful example,\nJonathan\n"},{"id":"212969","messageId":"CAGHfRMC6mRSzdrY-iL3bvCETd5eY4D1-T85zMFcJg5tyNK7ciw@mail.gmail.com","threadId":"33354","inReplyTo":"20130402190355.GB32316@sigill.intra.peff.net","subject":"Re: [PATCH 2/5] branch: factor out \"upstream is not a branch\" error messages","fromName":"Garrett Cooper","fromEmail":"yaneurabeya@gmail.com","sentAt":"2013-04-02T19:36:16Z","receivedAt":"2013-04-02T19:36:16Z","isPatch":true,"sender":{"key":"yaneurabeya@gmail.com","avatar":"https://gravatar.com/avatar/48933e620edcd6784a0d640769b899693e42bce6c259e4a41bc612754a41285d?d=mp&s=160"},"body":"On Tue, Apr 2, 2013 at 12:03 PM, Jeff King <peff@peff.net> wrote:\n>\n> This message is duplicated, and is quite long. Let's factor\n> it out, which avoids the repetition and the long lines. It\n> will also make future patches easier as we tweak the\n> message.\n>\n> While we're at it, let's also mark it for translation.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n\nLGTM!\n\nSigned-off-by: Garrett Cooper <yaneurabeya@gmail.com>\n"},{"id":"212970","messageId":"CAGHfRMDqmQHBrML84iUnh8TE0Lz5EunUB-t9bCASSXOo25i3pQ@mail.gmail.com","threadId":"33354","inReplyTo":"CAGHfRMC6mRSzdrY-iL3bvCETd5eY4D1-T85zMFcJg5tyNK7ciw@mail.gmail.com","subject":"Re: [PATCH 2/5] branch: factor out \"upstream is not a branch\" error messages","fromName":"Garrett Cooper","fromEmail":"yaneurabeya@gmail.com","sentAt":"2013-04-02T19:36:42Z","receivedAt":"2013-04-02T19:36:42Z","isPatch":true,"sender":{"key":"yaneurabeya@gmail.com","avatar":"https://gravatar.com/avatar/48933e620edcd6784a0d640769b899693e42bce6c259e4a41bc612754a41285d?d=mp&s=160"},"body":"On Tue, Apr 2, 2013 at 12:36 PM, Garrett Cooper <yaneurabeya@gmail.com> wrote:\n> On Tue, Apr 2, 2013 at 12:03 PM, Jeff King <peff@peff.net> wrote:\n>>\n>> This message is duplicated, and is quite long. Let's factor\n>> it out, which avoids the repetition and the long lines. It\n>> will also make future patches easier as we tweak the\n>> message.\n>>\n>> While we're at it, let's also mark it for translation.\n>>\n>> Signed-off-by: Jeff King <peff@peff.net>\n>\n> LGTM!\n>\n> Signed-off-by: Garrett Cooper <yaneurabeya@gmail.com>\n\nSorry, meant...\n\nReviewed-by: Garrett Cooper <yaneurabeya@gmail.com>\n"},{"id":"212971","messageId":"CAGHfRMA8oAX-vigeYXxEVzWsrcPaWw0jCoOHWUMA-gbbAESNRA@mail.gmail.com","threadId":"33354","inReplyTo":"20130402190451.GD32316@sigill.intra.peff.net","subject":"Re: [PATCH 4/5] branch: mention start_name in set-upstream error messages","fromName":"Garrett Cooper","fromEmail":"yaneurabeya@gmail.com","sentAt":"2013-04-02T19:39:48Z","receivedAt":"2013-04-02T19:39:48Z","isPatch":true,"sender":{"key":"yaneurabeya@gmail.com","avatar":"https://gravatar.com/avatar/48933e620edcd6784a0d640769b899693e42bce6c259e4a41bc612754a41285d?d=mp&s=160"},"body":"On Tue, Apr 2, 2013 at 12:04 PM, Jeff King <peff@peff.net> wrote:\n> If we refuse a branch operation because the tracking\n> start_name the user gave us is bogus, we just print\n> something like:\n>\n>  fatal: Cannot setup tracking information; start point is not a branch\n>\n> If we mention the actual name we tried to use, that may help\n> the user figure out why it didn't work (e.g., if they gave\n> us the arguments in the wrong order).\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n\nLGTM!\n\nReviewed-by: Garrett Cooper <yaneurabeya@gmail.com>\n"},{"id":"212998","messageId":"7vmwtga9fs.fsf@alter.siamese.dyndns.org","threadId":"33354","inReplyTo":"20130402190134.GA17784@sigill.intra.peff.net","subject":"Re: [RFC/PATCH 0/5] branch --set-upstream-to error-message improvements","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-02T21:50:47Z","receivedAt":"2013-04-02T21:50:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Tue, Apr 02, 2013 at 01:51:13PM -0400, Jeff King wrote:\n>\n>> Things slowly improve as people make suggestions. I think the thing that\n>> might have helped here is better advice when \"set-upstream-to\" is\n>> pointed to a ref that does not exist.\n>> \n>> Patches coming in a minute.\n>\n> Or 60 minutes. :)\n>\n> I'm not decided on whether the last patch is overkill or not (or even if\n> it is not, whether it may end up confusing people who do not fit into\n> one of the slots it suggests).\n\nYeah, I am uneasy about 5/5 for the same reason.  \nAlso I feel a bit uneasy about 1/5 as well.\n\n>> If the user requests to --set-upstream-to a branch that does\n>> not exist, then either:\n>> \n>>   1. It was a typo.\n>> \n>>   2. They thought the branch should exist.\n\nCould there be the third?\n\n    3. She planned to create a branch after setting the\n       configuration.\n\nI think it is remote (no pun intended) possibility, and I may be\nworried about people's existing workflow too much (as usual).\n"}]}