Skip to content

Commit 95f2fb7

Browse files
dschoJunio C Hamano
authored andcommitted
git-reset --hard: tell the user what the HEAD was reset to
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent f79c73c commit 95f2fb7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-reset.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ update_ref_status=$?
8686

8787
case "$reset_type" in
8888
--hard )
89-
;; # Nothing else to do
89+
test $update_ref_status = 0 && {
90+
echo -n "HEAD is now at "
91+
GIT_PAGER= git log --max-count=1 --pretty=oneline \
92+
--abbrev-commit HEAD
93+
}
94+
;;
9095
--soft )
9196
;; # Nothing else to do
9297
--mixed )

0 commit comments

Comments
 (0)