fnc_mc_git.inc.sh
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/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
git branch | grep '*'
git branch | grep '*' >> $logfile
git status -s
mc_log "git status -s" $logfile
git status -s >> $logfile
git pull
git status -s | grep UU
git status -s | grep UU >> $logfile
git status | grep Version
#mc_bashsu "git log | grep -m 1 commit" 1
git log | grep -m 1 commit >> $logfile
git log | grep -m 1 Date
git log | grep -m 1 Date >> $logfile
echo '----------------------------' >> $logfile
}
mc_git_push() {
gitdir=$1
logfile=$2
echo ''
echo '' >> $logfile
mc_log "git pull $gitdir" $logfile
mc_bashsu "cd $gitdir" 1
git branch | grep '*'
git branch | grep '*' >> $logfile
git status -s
mc_log "git status -s" $logfile
git status -s >> $logfile
git push
git status -s | grep UU
git status -s | grep UU >> $logfile
git status | grep Version
#mc_bashsu "git log | grep -m 1 commit" 1
git log | grep -m 1 commit >> $logfile
git log | grep -m 1 Date
git log | grep -m 1 Date >> $logfile
echo '----------------------------' >> $logfile
}
mc_git_status() {
gitdir=$1
cd $gitdir
echo $gitdir
git status -s
git branch | grep '*'
git status -s | grep UU
git status | grep ersion
echo '----------------------------'
}