git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Alter git-checkout reflog message to include "from" branch
@ 2007-07-04  8:33 Sean
  0 siblings, 0 replies; only message in thread
From: Sean @ 2007-07-04  8:33 UTC (permalink / raw)
  To: git


    
    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>

diff --git a/git-checkout.sh b/git-checkout.sh
index e00b697..17f4392 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-04  8:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04  8:33 Alter git-checkout reflog message to include "from" branch Sean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).