{"thread":{"id":"8853","subject":"Alter git-checkout reflog message to include \"from\" branch","startedAt":"2007-07-04T08:33:36Z","lastAt":"2007-07-04T08:33:36Z","messageCount":1,"participants":["Sean"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"46452","messageId":"20070704043336.0cfa4d8a.seanlkml@sympatico.ca","threadId":"8853","inReplyTo":null,"subject":"Alter git-checkout reflog message to include \"from\" branch","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2007-07-04T08:33:36Z","receivedAt":"2007-07-04T08:33:36Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"\n    \n    As suggested by Junio, adding the current branch name to the\n    reflog message for git-checkout would be helpful.  For example:\n    \n       \"checkout: moving from next to master\"\n    \n    Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>\n\ndiff --git a/git-checkout.sh b/git-checkout.sh\nindex e00b697..17f4392 100755\n--- a/git-checkout.sh\n+++ b/git-checkout.sh\n@@ -259,7 +259,8 @@ if [ \"$?\" -eq 0 ]; then\n \tfi\n \tif test -n \"$branch\"\n \tthen\n-\t\tGIT_DIR=\"$GIT_DIR\" git symbolic-ref -m \"checkout: moving to $branch\" HEAD \"refs/heads/$branch\"\n+\t\told_branch_name=`expr \"z$oldbranch\" : 'zrefs/heads/\\(.*\\)'`\n+\t\tGIT_DIR=\"$GIT_DIR\" git symbolic-ref -m \"checkout: moving from $old_branch_name to $branch\" HEAD \"refs/heads/$branch\"\n \t\tif test -n \"$quiet\"\n \t\tthen\n \t\t\ttrue\t# nothing\n"}]}