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

[PATCH] honor GIT_REFLOG_ACTION in git-commit

From
Junio C Hamano <junkio@cox.net>
Date
Jan 20, 2007, 01:12 UTC
Message-ID
<7vfya6bixg.fsf@assigned-by-dhcp.cox.net>

This allows git-cherry-pick and git-revert to properly identify themselves in the resulting reflog entries. Earlier they were recorded as what git-commit has done.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/git-commit.sh b/git-commit.sh
index e23918c..eb211e5 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -524,6 +524,7 @@ else
 	rloga='commit (initial)'
 	current=''
 fi
+set_reflog_action "$rloga"
 
 if test -z "$no_edit"
 then
@@ -598,7 +599,7 @@ then
 	fi &&
 	commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
 	rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) &&
-	git-update-ref -m "$rloga: $rlogm" HEAD $commit "$current" &&
+	git-update-ref -m "$GIT_REFLOG_ACTION: $rlogm" HEAD $commit "$current" &&
 	rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" &&
 	if test -f "$NEXT_INDEX"
 	then
diff --git a/git-revert.sh b/git-revert.sh
index bb8f1ca..8207c9e 100755
--- a/git-revert.sh
+++ b/git-revert.sh
@@ -54,6 +54,8 @@ do
 	shift
 done
 
+set_reflog_action "$me"
+
 test "$me,$replay" = "revert,t" && usage
 
 case "$no_commit" in
Next: Shawn O. Pearce
Message 1 of 3 in “honor GIT_REFLOG_ACTION in git-commit”
  1. honor GIT_REFLOG_ACTION in git-commitJunio C Hamano, Jan 20, 2007
  2. Shawn O. PearceJan 20, 2007
  3. Junio C HamanoJan 20, 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.