{"thread":{"id":"6548","subject":"[PATCH] fix suggested branch creation command when detaching head","startedAt":"2007-01-26T16:50:06Z","lastAt":"2007-01-26T16:50:06Z","messageCount":1,"participants":["Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"32754","messageId":"Pine.LNX.4.64.0701261120020.3021@xanadu.home","threadId":"6548","inReplyTo":null,"subject":"[PATCH] fix suggested branch creation command when detaching head","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-01-26T16:50:06Z","receivedAt":"2007-01-26T16:50:06Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"Doing:\n\n$ git checkout HEAD^\n\nGenerates the following message:\n\n|warning: you are not on ANY branch anymore.\n|If you meant to create a new branch from the commit, you need -b to\n|associate a new branch with the wanted checkout.  Example:\n|  git checkout -b <new_branch_name> HEAD^\n\nOf course if the user does as told at this point the created branch \nwon't be located at the expected commit.  Reword this message a bit to \navoid such confusion.\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n---\ndiff --git a/git-checkout.sh b/git-checkout.sh\nindex c52f352..1929424 100755\n--- a/git-checkout.sh\n+++ b/git-checkout.sh\n@@ -156,9 +156,9 @@ then\n \tif test -n \"$oldbranch\"\n \tthen\n \t\tdetach_warn=\"warning: you are not on ANY branch anymore.\n-If you meant to create a new branch from the commit, you need -b to\n-associate a new branch with the wanted checkout.  Example:\n-  git checkout -b <new_branch_name> $arg\"\n+If you meant to create a new branch from this checkout, you may still do\n+so (now or later) by using -b with the checkout command again.  Example:\n+  git checkout -b <new_branch_name>\"\n \tfi\n elif test -z \"$oldbranch\" && test -n \"$branch\"\n then\n"}]}