Git development
 help / color / mirror / Atom feed
From: "Santi Béjar" <sbejar@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] git-reset: make the output as the fetch output
Date: Wed, 17 Jan 2007 13:56:15 +0100	[thread overview]
Message-ID: <87odox23u9.fsf@gmail.com> (raw)


... and only when HEAD is changed.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 git-reset.sh |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/git-reset.sh b/git-reset.sh
index bf2a058..acefddc 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -24,6 +24,7 @@ do
 		usage
 		;;
 	*)
+		commit="$1"
 		rev=$(git-rev-parse --verify "$1") || exit
 		shift
 		break
@@ -84,14 +85,20 @@ fi
 git-update-ref -m "$GIT_REFLOG_ACTION" HEAD "$rev"
 update_ref_status=$?
 
+if test $update_ref_status = 0 && test "$orig" != "$rev"
+then
+    revshort=$(git-rev-parse --short $rev)
+    echo "* HEAD: reset to $commit"
+    if test "$orig" ; then
+	echo "  old..new: $(git-rev-parse --short $orig)..$revshort"
+    else
+	echo "  commit: $revshort"
+    fi
+fi
+
 case "$reset_type" in
 --hard )
-	test $update_ref_status = 0 && {
-		printf "HEAD is now at "
-		GIT_PAGER= git log --max-count=1 --pretty=oneline \
-			--abbrev-commit HEAD
-	}
-	;;
+	;; # Nothing else to do
 --soft )
 	;; # Nothing else to do
 --mixed )
-- 
1.5.0.rc1.g0dee5

             reply	other threads:[~2007-01-17 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-17 12:56 Santi Béjar [this message]
2007-01-17 13:27 ` [PATCH] git-reset: make the output as the fetch output Santi Béjar
2007-01-17 13:38   ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-17 13:41   ` Andy Parkins
2007-01-17 13:43 ` Johannes Schindelin
     [not found]   ` <8aa486160701170723j5767f0d3jd3eb4b8817413195@mail.gmail.com>
2007-01-17 15:35     ` Johannes Schindelin

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=87odox23u9.fsf@gmail.com \
    --to=sbejar@gmail.com \
    --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