-
Notifications
You must be signed in to change notification settings - Fork 0
/
merge-srp.bash
executable file
·48 lines (35 loc) · 1.26 KB
/
merge-srp.bash
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
#!/bin/bash
set -e
readarray() {
local i=0
unset -v "$1"
while IFS= read -r "$1[i++]"; do :; done
eval "[[ \${$1[--i]} ]]" || unset "$1[i]"
}
git remote add srp https://github.com/Unity-Technologies/ScriptableRenderPipeline || true
git fetch srp
git reset --hard
git checkout master
readarray new_branches < ../new_branches.list
for new_branch in "${new_branches[@]}"
do
git checkout vfx-import/$new_branch
done
git checkout master
git checkout -b vfx/main && git merge vfx-import/main --allow-unrelated-histories -m "creating vfx/main by merging master with vfx-import/main" || true
#delete=("main")
#new_branches=( "${new_branches[@]/$delete}" )
for new_branch in "${new_branches[@]}"
do
git checkout vfx/main
git checkout -b vfx/$new_branch && git merge vfx-import/$new_branch -m "creating vfx/${new_branch} by merging vfx/main with vfx-import/${new_branch}" || git reset --hard
done
#not yet tested
for new_branch in "${new_branches[@]}"
do
git checkout vfx/$new_branch || echo "branch vfx/$new_branch could not be created it doesn't merge automatically please use git merge vfx-import/$new_branch from vfx/main and fix the conflicts"
done
git remote add me git@gitlab.internal.unity3d.com:tristan/vfx-editor.git
$check="${0//merge/check}"
echo $check;
eval $check