-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgerpush
More file actions
executable file
·225 lines (221 loc) · 6.67 KB
/
gerpush
File metadata and controls
executable file
·225 lines (221 loc) · 6.67 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#!/bin/bash
# Arnav Gosain <gosain.arnav@gmail.com> was here.
banner () {
echo -e "> [N O L I N U X N O P A R T Y] <"
echo
echo -e " Script for automated commit pushing to code review (gerrit) system."
echo -e " The script supports EOS, CyanogenMod, OmniROM, AOKP, TEAM Gummy ROM , VanirAOSP, MerkMod and Nameless ROM currently."
echo
}
if [ -e ~/.gerpush-configs ]
then
echo -e "Gerrit Configs Directory Exists."
else
mkdir ~/.gerpush-configs
fi;
EOS=~/.gerpush-configs/eosreview-config
CM=~/.gerpush-configs/cmreview-config
OMNI=~/.gerpush-configs/omnireview-config
AOKP=~/.gerpush-configs/aokpreview-config
GUMMY=~/.gerpush-configs/gummyreview-config
VANIR=~/.gerpush-configs/vaniraospreview-config
NAMELESS=~/.gerpush-configs/nameless-config
MERK=~/.gerpush.configs/merk-config
echo -e "To which of the following rom code reviews do you want to?"
echo -e "[1] Team EOS"
echo -e "[2] CyanogenMod"
echo -e "[3] OmniROM"
echo -e "[4] AOKP"
echo -e "[5] TEAM Gummy ROM"
echo -e "[6] VanirAOSP"
echo -e "[7] Nameless ROM"
echo -e "[8] MerkMod"
echo -e "Enter your choice: "
read -n1 review
echo
echo
if [[ "$review" == "1" ]]; then
echo -e "So you want to push to EOS Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="review.teameos.org:29419"
BRANCH="kk4.4"
if [ -e .git ]
then
if [ -e $EOS ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $EOS && echo "USERNAME=$USERNAME" >> "$EOS"
fi;
REPO=$(git remote -v | grep teameos | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $EOS
git push ssh://$USERNAME@$REMOTE/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
elif [[ "$review" == "2" ]]; then
echo -e "So you want to push to CyanogenMod Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="review.cyanogenmod.org:29418"
BRANCH="cm-11.0"
if [ -e .git ]
then
if [ -e $CM ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $CM && echo "USERNAME=$USERNAME" >> "$CM"
fi;
REPO=$(git remote -v | grep github | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $CM
git push ssh://$USERNAME@$REMOTE/CyanogenMod/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
elif [[ "$review" == "3" ]]; then
echo -e "So you want to push to OmniROM Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="gerrit.omnirom.org:29418"
BRANCH="android-4.4"
if [ -e .git ]
then
if [ -e $OMNI ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $OMNI && echo "USERNAME=$USERNAME" >> "$OMNI"
fi;
REPO=$(git remote -v | grep omni | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $OMNI
git push ssh://$USERNAME@$REMOTE/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
elif [[ "$review" == "4" ]]; then
echo -e "So you want to push to AOKP Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="gerrit.aokp.co:29418"
BRANCH="kitkat"
if [ -e .git ]
then
if [ -e $AOKP ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $AOKP && echo "USERNAME=$USERNAME" >> "$AOKP"
fi;
REPO=$(git remote -v | grep omni | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $AOKP
git push ssh://$USERNAME@$REMOTE/AOKP/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
elif [[ "$review" == "5" ]]; then
echo -e "So you want to push to Gummy Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="review.gummyrom.com:29418"
BRANCH="kk4.4"
if [ -e .git ]
then
if [ -e $GUMMY ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $GUMMY && echo "USERNAME=$USERNAME" >> "$GUMMY"
fi;
REPO=$(git remote -v | grep tg | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $GUMMY
git push ssh://$USERNAME@$REMOTE/TEAM-Gummy/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
elif [[ "$review" == "6" ]]; then
echo -e "So you want to push to Vanir Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="gerrit.vanir.co:29419"
BRANCH="kk44"
if [ -e .git ]
then
if [ -e $VANIR ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $VANIR && echo "USERNAME=$USERNAME" >> "$VANIR"
fi;
REPO=$(git remote -v | grep vanir | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $VANIR
git push ssh://$USERNAME@$REMOTE/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
elif [[ "$review" == "7" ]]; then
echo -e "So you want to push to Nameless Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="gerrit.nameless-rom.org:29418"
BRANCH="android-4.4"
if [ -e .git ]
then
if [ -e $NAMELESS ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $NAMELESS && echo "USERNAME=$USERNAME" >> "$NAMELESS"
fi;
REPO=$(git remote -v | grep nameless | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $NAMELESS
git push ssh://$USERNAME@$REMOTE/NamelessRom/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
elif [[ "$review" == "8" ]]; then
echo -e "So you want to push to MerkMod Code Review?"
echo -e "Good Luck in getting it merged."
REMOTE="review.merkmod.com:29418"
BRANCH="android-4.4"
if [ -e .git ]
then
if [ -e $MERK ]
then
echo
else
echo -e "Enter your username:"
read -r USERNAME
touch $MERK && echo "USERNAME=$USERNAME" >> "$MERK"
fi;
REPO=$(git remote -v | grep merk | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
. $NAMELESS
git push ssh://$USERNAME@$REMOTE/$REPO HEAD:refs/for/$BRANCH
echo -e "Your change has been pushed."
else
echo -e "This directory is not a git directory.."
fi;
exit 0
fi;