forked from eva980636/kernelci-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateGIT.sh
executable file
·66 lines (43 loc) · 1.27 KB
/
updateGIT.sh
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
#!/bin/bash
dirname_path=$(cd `dirname $0`; pwd)
build_sh="$dirname_path/build.sh"
tmp_branch="$dirname_path/tmp_branch"
source $tmp_branch/envar
#linux_repo="/media/vdb1/xly/common"
cd $linux_repo
git fetch origin
if [ $? -ne 0 ]; then
echo -e "git fetch ERROR!"
exit
fi
remote_branches=$(git branch -r | sed -e "1d" -e "s/origin\///")
echo -e "All branches: ($remote_branches)"
#remote_branches="master"
remote_branches="kernel-4.4"
for br_ in $remote_branches
do
old_br_com=(`cat $tmp_branch/$br_`) #old_branch_commit
git checkout $br_
br_com=(`git log -1 --pretty=format:"%H %cd" --date=raw` )
if [ "${old_br_com[0]}"x = "${br_com[0]}"x ]
then
continue
else
echo ${br_com[@]} > $tmp_branch/$br_
fi
#git log --pretty=format:"%H %cd" --date=raw "$old_commit_id"..
#x#do not contain old_commit_id
#branch_log=$(git log --pretty=format:"%H" ${old_br_com}..)
branch_log=$(git log --pretty=format:"%H" --since=${old_br_com[1]} )
echo -e "Branch $br_: ($branch_log)"
for log_ in $branch_log
do
echo '#!/bin/bash' > $tmp_branch/$log_
echo -e "/bin/bash $build_sh $br_ $log_" >> $tmp_branch/$log_
chmod 755 $tmp_branch/$log_
echo -e "\033[32m Running $br_ $tmp_branch/$log_ \033[0m"
/bin/bash $tmp_branch/$log_
sleep 5
done
#for loop
done