summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorSean <seanlkml@sympatico.ca>2007-07-04 04:33:36 -0400
committerJunio C Hamano <gitster@pobox.com>2007-07-04 12:56:02 -0700
commit49aba0bb3a85a4364cf3f0f73b3b6ddf98f7e037 (patch)
treee68ce8793b6d3f35fdd5ce747bb4678b119470b5 /git-checkout.sh
parentef6f0af2b6975e6568542123d015aa7e39bea0c3 (diff)
downloadgit-49aba0bb3a85a4364cf3f0f73b3b6ddf98f7e037.tar.gz
Alter git-checkout reflog message to include "from" branch
As suggested by Junio, adding the current branch name to the reflog message for git-checkout would be helpful. For example: "checkout: moving from next to master" Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index e00b697fef..17f43927aa 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -259,7 +259,8 @@ if [ "$?" -eq 0 ]; then
fi
if test -n "$branch"
then
- GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving to $branch" HEAD "refs/heads/$branch"
+ old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
+ GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving from $old_branch_name to $branch" HEAD "refs/heads/$branch"
if test -n "$quiet"
then
true # nothing