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

[PATCH] git-reset --hard: use quotes when we tell the user what HEAD was reset to

From
Fredrik Kuivinen <freku045@student.liu.se>
Date
Jan 6, 2007, 10:23 UTC
Message-ID
<20070106102322.7468.57615.stgit@c165>
Idea and motivating example from Andy Whitcroft:
    apw@pinky$ git checkout -b bar master
    apw@pinky$ git reset --hard ac9c1108d8915f0937795e354ad72c4ae6890a3f
    HEAD is now at ac9c110... git-fetch: remove .keep file at the end.
    Huh, fetch?  Remove what .keep file?  Did I do a fetch?  What?
    
    I think we need to delimit the name better, probabally we need to quote
    it.  Perhaps something like:
    HEAD is now at ac9c110: "git-fetch: remove .keep file at the end".
Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
---
 git-reset.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-reset.sh b/git-reset.sh
index a969370..9b49883 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -90,7 +90,8 @@ case "$reset_type" in
 	test $update_ref_status = 0 && {
 		echo -n "HEAD is now at "
 		GIT_PAGER= git log --max-count=1 --pretty=oneline \
-			--abbrev-commit HEAD
+			--abbrev-commit HEAD |
+		    sed 's/\([0-9a-f.]*\) \(.*\)/\1: "\2"/'
 	}
 	;;
 --soft )
Next: Junio C Hamano
Message 1 of 5 in “git-reset --hard: use quotes when we tell the user what HEAD was reset to”
  1. git-reset --hard: use quotes when we tell the user what HEAD was reset toFredrik Kuivinen, Jan 6, 2007
  2. Junio C HamanoJan 6, 2007
  3. Fredrik KuivinenJan 7, 2007
  4. Junio C HamanoJan 7, 2007
  5. Andy WhitcroftJan 8, 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.