diff --git a/bin/sde-commit b/bin/sde-commit index 9d580ec..5d67230 100755 --- a/bin/sde-commit +++ b/bin/sde-commit @@ -37,7 +37,7 @@ commit_abort() { exit 1 } -shortopts='F:m:' +shortopts='F:m:s' longopts='file:' options=$( getopt -o "$shortopts" -l "$longopts" -- "$@" ) if [ $? -ne 0 ]; then @@ -50,6 +50,7 @@ eval set -- "$options" logfile= message= +signed= tmpfile=$SDEROOT/tmp/$$ mkdir -p "$SDEROOT/tmp" @@ -58,6 +59,7 @@ while [ $# -gt 0 ]; do case "$1" in -F|--file) logfile="`readlink -f $2 2> /dev/null`"; shift ;; -m) message="$2"; shift ;; + -s) signed=true; shift ;; --) shift; break ;; *) echo_abort 1 "Unknown argument '$1', aborting." @@ -194,7 +196,7 @@ if [ -s $tmpfile.diff -o -s $tmpfile.status ]; then continue elif [ -d ".git" ]; then # git commit - git commit --file $logfile && rm "$logfile" ; quit=1 + git commit ${signed:+-s} --file $logfile && rm "$logfile" ; quit=1 elif [ -d ".svn" ]; then # svn commit svn commit --file $logfile -- $locations && rm "$logfile" ; quit=1