projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
svn import: skip initial revisions
[git.git]
/
git-commit.sh
diff --git
a/git-commit.sh
b/git-commit.sh
index
9412840
..
5e85b54
100755
(executable)
--- a/
git-commit.sh
+++ b/
git-commit.sh
@@
-94,13
+94,13
@@
esac
case "$all,$#" in
t,*)
git-diff-files --name-only -z |
case "$all,$#" in
t,*)
git-diff-files --name-only -z |
- xargs -0 git-update-index -q --remove --
+ git-update-index --remove -z --stdin
;;
,0)
;;
*)
git-diff-files --name-only -z "$@" |
;;
,0)
;;
*)
git-diff-files --name-only -z "$@" |
- xargs -0 git-update-index -q --remove --
+ git-update-index --remove -z --stdin
;;
esac || exit 1
git-update-index -q --refresh || exit 1
;;
esac || exit 1
git-update-index -q --refresh || exit 1
@@
-133,10
+133,13
@@
fi | git-stripspace >.editmsg
case "$signoff" in
t)
case "$signoff" in
t)
- git-var GIT_COMMITTER_IDENT | sed -e '
- s/>.*/>/
- s/^/Signed-off-by: /
- ' >>.editmsg
+ {
+ echo
+ git-var GIT_COMMITTER_IDENT | sed -e '
+ s/>.*/>/
+ s/^/Signed-off-by: /
+ '
+ } >>.editmsg
;;
esac
;;
esac
@@
-153,13
+156,8
@@
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
fi >>.editmsg
PARENTS="-p HEAD"
fi >>.editmsg
PARENTS="-p HEAD"
-if [ ! -r "$GIT_DIR/HEAD" ]; then
- if [ -z "$(git-ls-files)" ]; then
- echo Nothing to commit 1>&2
- exit 1
- fi
- PARENTS=""
-else
+if GIT_DIR="$GIT_DIR" git-rev-parse --verify HEAD >/dev/null 2>&1
+then
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"`
fi
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"`
fi
@@
-192,6
+190,12
@@
else
export GIT_AUTHOR_EMAIL
export GIT_AUTHOR_DATE
fi
export GIT_AUTHOR_EMAIL
export GIT_AUTHOR_DATE
fi
+else
+ if [ -z "$(git-ls-files)" ]; then
+ echo Nothing to commit 1>&2
+ exit 1
+ fi
+ PARENTS=""
fi
git-status >>.editmsg
if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
fi
git-status >>.editmsg
if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
@@
-220,7
+224,7
@@
if test -s .cmitchk
then
tree=$(git-write-tree) &&
commit=$(cat .cmitmsg | git-commit-tree $tree $PARENTS) &&
then
tree=$(git-write-tree) &&
commit=$(cat .cmitmsg | git-commit-tree $tree $PARENTS) &&
-
echo $commit > "$GIT_DIR/HEAD"
&&
+
git-update-ref HEAD $commit $current
&&
rm -f -- "$GIT_DIR/MERGE_HEAD"
else
echo >&2 "* no commit message? aborting commit."
rm -f -- "$GIT_DIR/MERGE_HEAD"
else
echo >&2 "* no commit message? aborting commit."