@matheusbsbs / matheus-bagliano / commits / 67644a4d77
Fork 0

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>

Shawn Pearce committed May 19, 2006 at 05:16 UTC 67644a4d77f55cd1c960d046079d26719f1e7cd6
5 files changed +6 -5
git-am.sh
+1 -1
@@ -447,7 +447,7 @@ do
447 parent=$(git-rev-parse --verify HEAD) &&
448 commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") &&
449 echo Committed: $commit &&
450 - git-update-ref HEAD $commit $parent ||
450 + git-update-ref -m "am: $SUBJECT" HEAD $commit $parent ||
451 stop_here $this
452
453 if test -x "$GIT_DIR"/hooks/post-applypatch
git-applypatch.sh
+1 -1
@@ -204,7 +204,7 @@ echo Wrote tree $tree
204 parent=$(git-rev-parse --verify HEAD) &&
205 commit=$(git-commit-tree $tree -p $parent <"$final") || exit 1
206 echo Committed: $commit
207 -git-update-ref HEAD $commit $parent || exit
207 +git-update-ref -m "applypatch: $SUBJECT" HEAD $commit $parent || exit
208
209 if test -x "$GIT_DIR"/hooks/post-applypatch
210 then
git-branch.sh
+1 -1
@@ -117,4 +117,4 @@ then
117 die "cannot force-update the current branch."
118 fi
119 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
+2 -1
@@ -676,7 +676,8 @@ then
676 rm -f "$TMP_INDEX"
677 fi &&
678 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 &&
681 rm -f -- "$GIT_DIR/MERGE_HEAD" &&
682 if test -f "$NEXT_INDEX"
683 then
git-reset.sh
+1 -1
@@ -48,7 +48,7 @@ then
48 else
49 rm -f "$GIT_DIR/ORIG_HEAD"
50 fi
51 -git-update-ref HEAD "$rev"
51 +git-update-ref -m "reset $reset_type $@" HEAD "$rev"
52
53 case "$reset_type" in
54 --hard )