@matheusbsbs / matheus-bagliano / commits / 49aba0bb3a
Fork 0

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>

Sean committed Jul 4, 2007 at 04:33 UTC 49aba0bb3a85a4364cf3f0f73b3b6ddf98f7e037
1 file changed +2 -1
git-checkout.sh
+2 -1
@@ -259,7 +259,8 @@ if [ "$?" -eq 0 ]; then
259 fi
260 if test -n "$branch"
261 then
262 - GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving to $branch" HEAD "refs/heads/$branch"
262 + old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
263 + GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving from $old_branch_name to $branch" HEAD "refs/heads/$branch"
264 if test -n "$quiet"
265 then
266 true # nothing