git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-reset: print always the status when HEAD changes

From
SBSanti Béjar <sbejar@gmail.com>
Date
Jan 25, 2007, 08:48 UTC
Message-ID
<87lkjrv6f0.fsf@gmail.com>
Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 git-reset.sh |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/git-reset.sh b/git-reset.sh
index fee6d98..a2405c6 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -84,14 +84,16 @@ fi
 git-update-ref -m "$GIT_REFLOG_ACTION" HEAD "$rev"
 update_ref_status=$?
 
+if test $update_ref_status = 0 && test "$orig" != "$rev"
+then
+	printf "HEAD is now at "
+	GIT_PAGER= git log --max-count=1 --pretty=oneline \
+		--abbrev-commit HEAD
+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.ga98e3
Message 1 of 1 in “git-reset: print always the status when HEAD changes”
  1. git-reset: print always the status when HEAD changesSanti Béjar, Jan 25, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.