git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean <seanlkml@sympatico.ca>
To: git@vger.kernel.org
Subject: Alter git-checkout reflog message to include "from" branch
Date: Wed, 4 Jul 2007 04:33:36 -0400	[thread overview]
Message-ID: <20070704043336.0cfa4d8a.seanlkml@sympatico.ca> (raw)


    
    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

                 reply	other threads:[~2007-07-04  8:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070704043336.0cfa4d8a.seanlkml@sympatico.ca \
    --to=seanlkml@sympatico.ca \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).