]> gitweb.fluxo.info Git - scripts.git/commitdiff
Remove 'config' from args, otherwise it goes to the commit log
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 15:47:03 +0000 (13:47 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 15:47:21 +0000 (13:47 -0200)
commit

diff --git a/commit b/commit
index fc5df312179fa1bc0d30d35d05785328a16e3ae0..0bd561363b1c722349de04c8ef6f8e74668db9c6 100755 (executable)
--- 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