aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-24 13:47:03 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-24 13:47:21 -0200
commit4552017e07e60b11e0cb3e36d43e76524b48851f (patch)
tree89bf2a8c1d389419cdd5a0a16ec9124ed83c8032
parentcb68828dd0fee670afc296b7ba577cde7aabc176 (diff)
downloadscripts-4552017e07e60b11e0cb3e36d43e76524b48851f.tar.gz
scripts-4552017e07e60b11e0cb3e36d43e76524b48851f.tar.bz2
Remove 'config' from args, otherwise it goes to the commit log
-rwxr-xr-xcommit10
1 files changed, 8 insertions, 2 deletions
diff --git a/commit b/commit
index fc5df31..0bd5613 100755
--- a/commit
+++ b/commit
@@ -87,7 +87,6 @@ function git_push {
# Check user information
function git_user {
if ! grep -q "^\[user\]" $GIT_FOLDER/.git/config; then
- # TODO: remove '--config' from args, otherwise it goes to the commit log
if echo $ARGS | grep -q -- '--config'; then
grep -A 2 "^\[user\]" $HOME/.gitconfig >> $GIT_FOLDER/.git/config
else
@@ -118,6 +117,13 @@ function git_user {
fi
}
+# Commit changes
+function git_commit {
+ # Remove '--config' from args, otherwise it goes to the commit log
+ params="echo $* | sed -e 's/--commit//'"
+ git commit -a -m "$params"
+}
+
# Main
if [ ! -z "$1" ]; then
if is_svn .; then
@@ -127,7 +133,7 @@ if [ ! -z "$1" ]; then
if is_git .; then
git_folder $(pwd)
git_user
- git commit -a -m "$*"
+ git_commit $*
git_push
fi
fi