summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Shawn Pearce <spearce@spearce.org>2006-05-19 05:16:18 -0400
committerLibravatar Junio C Hamano <junkio@cox.net>2006-05-19 15:03:21 -0700
commit67644a4d77f55cd1c960d046079d26719f1e7cd6 (patch)
treed7b35c3a18c53c7b1fbf9991561edfaf0b5158f0
parentChange order of -m option to update-ref. (diff)
downloadtgif-67644a4d77f55cd1c960d046079d26719f1e7cd6.tar.xz
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>
-rwxr-xr-xgit-am.sh2
-rwxr-xr-xgit-applypatch.sh2
-rwxr-xr-xgit-branch.sh2
-rwxr-xr-xgit-commit.sh3
-rwxr-xr-xgit-reset.sh2
5 files changed, 6 insertions, 5 deletions
diff --git a/git-am.sh b/git-am.sh
index 33f208cb0b..25c95c24fd 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -447,7 +447,7 @@ do
parent=$(git-rev-parse --verify HEAD) &&
commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") &&
echo Committed: $commit &&
- git-update-ref HEAD $commit $parent ||
+ git-update-ref -m "am: $SUBJECT" HEAD $commit $parent ||
stop_here $this
if test -x "$GIT_DIR"/hooks/post-applypatch
diff --git a/git-applypatch.sh b/git-applypatch.sh
index 12cab1e0d4..e4b09472e1 100755
--- a/git-applypatch.sh
+++ b/git-applypatch.sh
@@ -204,7 +204,7 @@ echo Wrote tree $tree
parent=$(git-rev-parse --verify HEAD) &&
commit=$(git-commit-tree $tree -p $parent <"$final") || exit 1
echo Committed: $commit
-git-update-ref HEAD $commit $parent || exit
+git-update-ref -m "applypatch: $SUBJECT" HEAD $commit $parent || exit
if test -x "$GIT_DIR"/hooks/post-applypatch
then
diff --git a/git-branch.sh b/git-branch.sh
index 134e68cf7f..d1e3730761 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -117,4 +117,4 @@ then
die "cannot force-update the current branch."
fi
fi
-git update-ref "refs/heads/$branchname" $rev
+git update-ref -m "branch: Created from $head" "refs/heads/$branchname" $rev
diff --git a/git-commit.sh b/git-commit.sh
index 6ef1a9dedc..a4b0a90740 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -676,7 +676,8 @@ then
rm -f "$TMP_INDEX"
fi &&
commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
- git-update-ref HEAD $commit $current &&
+ rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) &&
+ git-update-ref -m "commit: $rlogm" HEAD $commit $current &&
rm -f -- "$GIT_DIR/MERGE_HEAD" &&
if test -f "$NEXT_INDEX"
then
diff --git a/git-reset.sh b/git-reset.sh
index 0ee3e3e154..296f3b779b 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -48,7 +48,7 @@ then
else
rm -f "$GIT_DIR/ORIG_HEAD"
fi
-git-update-ref HEAD "$rev"
+git-update-ref -m "reset $reset_type $@" HEAD "$rev"
case "$reset_type" in
--hard )