attempting to clean noise about x11 forwarding from checkin also.
[feisty_meow.git] / scripts / rev_control / checkin.sh
1 #!/bin/bash
2
3 # checks in all the folders present in the REPOSITORY_LIST variable.
4
5 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
6 source "$FEISTY_MEOW_SCRIPTS/rev_control/rev_control.sh"
7
8 # selects the method for check-in based on where we are.
9 function do_checkin()
10 {
11   local directory="$1"; shift
12   if [ -d "CVS" ]; then cvs ci . ;
13   elif [ -d ".svn" ]; then svn ci . ;
14   elif [ -d ".git" ]; then
15     # snag all new files.  not to everyone's liking.
16     git add .
17     # tell git about all the files and get a check-in comment.
18     git commit .
19     # upload the files to the server so others can see them.
20     git push 2>&1 | grep -v "X11 forwarding request failed"
21   else
22     echo unknown repository for $directory...
23   fi
24 }
25
26 # checks in all the folders in a specified list.
27 function checkin_list {
28   local list=$*
29   for i in $list; do
30     # turn repo list back into an array.
31     eval "repository_list=( ${REPOSITORY_LIST[*]} )"
32     for j in "${repository_list[@]}"; do
33       # add in the directory component.
34       j="$i/$j"
35       if [ ! -d "$j" ]; then continue; fi
36
37       pushd $j &>/dev/null
38       echo "checking in '$j'..."
39       do_checkin $j
40       popd &>/dev/null
41     done
42   done
43 }
44
45 echo "Committing repositories at: $(date)"
46
47 if [ "$OS" != "Windows_NT" ]; then
48   # first get individual folders.
49   checkin_list $HOME
50 else
51   checkin_list $HOME c:/ d:/ e:/ 
52 fi
53