We don't have any real need for 1.23wmf* and 1.24wmf* deployment branches anymore. They should probably be changed to tags.
Chad, do you have a script for doing this? Timo seemed to think you had from before...
EDIT: Krinkle used the following script for individual repositories at https://github.com/Krinkle/dotfiles/tree/master/hosts/KrinkleMac/bin:
1 | #!/bin/bash -ue |
---|---|
2 | |
3 | if [ -z "${1:-}" ]; then |
4 | # Missing parameters |
5 | echo |
6 | echo " Usage: $(basename $0) <version>" |
7 | echo |
8 | echo ' Options:' |
9 | echo ' <version> MediaWiki version, e.g. "1.25" or "1.27"' |
10 | echo |
11 | exit 1 |
12 | fi |
13 | |
14 | remote='origin' |
15 | prefix=$1 |
16 | if (( $(echo "$prefix >= 1.27" | bc ) )); then |
17 | prefix="$prefix.0-" |
18 | fi |
19 | git remote update $remote |
20 | git remote prune $remote |
21 | # Examples: "wmf/1.26wmf21", "wmf/1.27.0-wmf.12". |
22 | # Use a strict prefix with "wmf" mach to avoid disasted when passing "1.2" |
23 | # (e.g. don't expand as "1.20 - 1.29" or "1.200") |
24 | refs=`git for-each-ref --format='%(refname)' "refs/remotes/${remote}/wmf/${prefix}wmf*"` |
25 | branches=() |
26 | for ref in $refs; do |
27 | echo $ref |
28 | branch=$(echo $ref | cut -d '/' -f 4-6) |
29 | branches+=("$branch") |
30 | done |
31 | if [ -n "${branches:-}" ]; then |
32 | for branch in "${branches[@]}"; do |
33 | if git push $remote ":refs/heads/$branch" > /dev/null 2>&1; then |
34 | echo "... removed branch $branch" |
35 | else |
36 | echo "Could not remove $branch" |
37 | fi |
38 | done |
39 | fi |
40 | git remote prune $remote |
1 | #!/bin/bash -ue |
---|---|
2 | |
3 | if [ -z "${1:-}" ]; then |
4 | # Missing parameters |
5 | echo |
6 | echo " Usage: $(basename $0) <version>" |
7 | echo |
8 | echo ' Options:' |
9 | echo ' <version> MediaWiki version, e.g. "1.25"' |
10 | echo |
11 | exit 1 |
12 | fi |
13 | |
14 | remote='origin' |
15 | version=$1 |
16 | git remote update $remote |
17 | git remote prune $remote |
18 | refs=`git for-each-ref --format='%(refname)' refs/remotes/${remote}/wmf/${version}wmf*` |
19 | branches=() |
20 | for ref in $refs; do |
21 | branch=$(echo $ref | cut -d '/' -f 4-6) |
22 | if git tag $branch $ref > /dev/null 2>&1; then |
23 | echo "... created tag $branch" |
24 | else |
25 | echo "Could not (re)create tag $branch" |
26 | fi |
27 | # Remove branches after publishing tags in case user is |
28 | # not authorised to publish forged tags in Gerrit. |
29 | branches+=("$branch") |
30 | done |
31 | echo "... publishing tags" |
32 | git push $remote --tags |
33 | if [ -n "${branches:-}" ]; then |
34 | for branch in "${branches[@]}"; do |
35 | if git push $remote ":refs/heads/$branch" > /dev/null 2>&1; then |
36 | echo "... removed branch $branch" |
37 | else |
38 | echo "Could not remove $branch" |
39 | fi |
40 | done |
41 | fi |
42 | git remote update $remote |
43 | git remote prune $remote |