scripts

scripts
git clone git://git.wimdupont.com/scripts.git
Log | Files | Refs | README | LICENSE

gitc (531B)


      1 #!/bin/bash
      2 
      3 nosign=0
      4 current=0
      5 while getopts "nc" arg; do
      6 	case $arg in
      7 		n) nosign=1;;
      8 		c) current=1;;
      9 	esac
     10 done
     11 
     12 shift $((OPTIND-1))
     13 
     14 if [[ -z "${@// }" ]] ; then
     15 	echo "Please give commit message as argument" >&2
     16 	exit 1;
     17 fi
     18 
     19 git status
     20 
     21 echo "Are you sure you want to add all changes? [y/N]"
     22 
     23 read answer
     24 
     25 if [[ ! "$answer" =~ ^(y|Y|yes)$ ]]; then
     26 	echo "Exiting"
     27 	exit 0;
     28 fi
     29 
     30 git add .
     31 test "$nosign" == 1 && git -c commit.gpgsign=false commit -m "$*"  || git commit -m "$*"
     32 test "$current" == 1 && git push || git pushall