File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ target=~ /src/git-split-branch/git-split-branch
4+ link=" ${TUE_BIN} " /git-split-branch
5+
6+ tue-install-ln " ${target} " " ${link} "
Original file line number Diff line number Diff line change 1+ - type : git
2+ url : https://github.com/tue-robotics/git-split-branch.git
3+ path : ~/src/git-split-branch
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ function split-tue-robocup
4+ {
5+ if [ -z " $1 " ]
6+ then
7+ echo -e " Provide robocup environment"
8+ exit 1
9+ fi
10+
11+ local robocup_env=$1
12+
13+ local args=
14+
15+ local repo_path
16+ repo_path=$( dirname " $( realpath _ros_location_find tue_robocup) " )
17+
18+ # shellcheck disable=SC2044
19+ for pkg in $( find " ${repo_path} " -path ' ./[^.]*' -prune -type d -printf ' %P\n' )
20+ do
21+ echo " ${pkg} "
22+ if [[ " ${pkg} " != " challenge" * ]]
23+ then
24+ echo " Skipping ${pkg} "
25+ continue
26+ fi
27+
28+ # Splitting the args
29+ if [ -n " ${args} " ]
30+ then
31+ args=" ${args} -- "
32+ fi
33+ args=" ${args}${robocup_env} _${pkg} ${pkg} robocup_knowledge/src/robocup_knowledge/environments/*/${pkg} .py"
34+ done
35+
36+ echo -e " args: '${args} '"
37+
38+ echo -e " git split-branch -b origin/master -r ${robocup_env} _remainder ${robocup_env} ${args} \n\n\n"
39+ # shellcheck disable=SC2086
40+ git split-branch -b origin/master -r " ${robocup_env} " _remainder " ${robocup_env} " ${args}
41+
42+ for branch in $( git branch --format=' %(refname:short)' )
43+ do
44+ if [[ " ${branch} " != " ${robocup_env} _challenge_" * ]] && [[ " ${branch} " != " ${robocup_env} _remainder" ]]
45+ then
46+ continue
47+ fi
48+
49+ echo " branch: ${branch} "
50+ if git diff --exit-code --quiet origin/master " ${branch} "
51+ then
52+ echo " Empty diff, skipping: ${branch} "
53+ continue
54+ fi
55+
56+ git push -u origin " ${branch} "
57+ done
58+ }
You can’t perform that action at this time.
0 commit comments