honor GIT_REFLOG_ACTION in git-commit
PATCH 1/1 honor GIT_REFLOG_ACTION in git-commit
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.
---
git-commit.sh +2 -1
@@ -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
git-revert.sh +2 -0
@@ -54,6 +54,8 @@ do shift done +set_reflog_action "$me" + test "$me,$replay" = "revert,t" && usage case "$no_commit" in
Quoted 3 lines · Junio C Hamano
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.
Not sure how I missed that one when I introduced GIT_REFLOG_ACTION, but thanks for finding and fixing it. :-)
Signature · 1 line
Shawn.
Quoted 7 lines · Shawn O. Pearce
Quoted 3 lines · Junio C Hamano
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.
Not sure how I missed that one when I introduced
GIT_REFLOG_ACTION, but thanks for finding and fixing it. :-)
The fact that it went unnoticed for this long time shows how we lack proper tools to read the message part of the reflog, although we use @{N} and @{ago} notation every day and some people might even rely on it. I'd like to do something about it, and my earlier "show-branch --reflog" enhancement series (I'll park that in 'next' for now) was my attempt for that goal.
I found this out by accident while working on it.