Skip to content

Commit 67644a4

Browse files
spearceJunio C Hamano
authored andcommitted
Include ref log detail in commit, reset, etc.
When updating a ref at the direction of the user include a reason why head was changed as part of the ref log (assuming it was enabled). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 7792cc2 commit 67644a4

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

git-am.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ do
447447
parent=$(git-rev-parse --verify HEAD) &&
448448
commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") &&
449449
echo Committed: $commit &&
450-
git-update-ref HEAD $commit $parent ||
450+
git-update-ref -m "am: $SUBJECT" HEAD $commit $parent ||
451451
stop_here $this
452452

453453
if test -x "$GIT_DIR"/hooks/post-applypatch

git-applypatch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ echo Wrote tree $tree
204204
parent=$(git-rev-parse --verify HEAD) &&
205205
commit=$(git-commit-tree $tree -p $parent <"$final") || exit 1
206206
echo Committed: $commit
207-
git-update-ref HEAD $commit $parent || exit
207+
git-update-ref -m "applypatch: $SUBJECT" HEAD $commit $parent || exit
208208

209209
if test -x "$GIT_DIR"/hooks/post-applypatch
210210
then

git-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ then
117117
die "cannot force-update the current branch."
118118
fi
119119
fi
120-
git update-ref "refs/heads/$branchname" $rev
120+
git update-ref -m "branch: Created from $head" "refs/heads/$branchname" $rev

git-commit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,8 @@ then
676676
rm -f "$TMP_INDEX"
677677
fi &&
678678
commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
679-
git-update-ref HEAD $commit $current &&
679+
rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) &&
680+
git-update-ref -m "commit: $rlogm" HEAD $commit $current &&
680681
rm -f -- "$GIT_DIR/MERGE_HEAD" &&
681682
if test -f "$NEXT_INDEX"
682683
then

git-reset.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ then
4848
else
4949
rm -f "$GIT_DIR/ORIG_HEAD"
5050
fi
51-
git-update-ref HEAD "$rev"
51+
git-update-ref -m "reset $reset_type $@" HEAD "$rev"
5252

5353
case "$reset_type" in
5454
--hard )

0 commit comments

Comments
 (0)