Skip to content

Commit

Permalink
Alter git-checkout reflog message to include "from" branch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sean authored and Junio C Hamano committed Jul 4, 2007
1 parent ef6f0af commit 49aba0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49aba0b

Please sign in to comment.