fnc_mc_git.inc.sh 645 Bytes
#!/bin/bash

#
# @param string	$1	git dir
# @param string $2	logfile (FILE exists and is writable)
#

mc_git_pull() {
	gitdir=$1
	logfile=$2

	echo ''
	echo '' >> $logfile
	mc_log "git pull $gitdir" $logfile

	mc_bashsu "cd $gitdir" 1
	mc_bashsu "git branch | grep '*'" 1
	git branch | grep '*' >> $logfile
	mc_bashsu "git status -s" 1
	mc_log "git status -s" $logfile
	git status -s >> $logfile
	
	mc_bashsu "git pull" 1 
	
	mc_bashsu "git log | grep -m 1 commit" 1 
	git log | grep -m 1 commit >> $logfile	
	
	mc_bashsu "git log | grep -m 1 Date" 1 
	git log | grep -m 1 Date >> $logfile
	
	echo '----------------------------' >> $logfile	
	
}