File: git_push_all

package info (click to toggle)
trilinos 16.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 994,012 kB
  • sloc: cpp: 3,764,859; ansic: 425,011; fortran: 160,684; python: 101,476; xml: 74,329; sh: 37,044; makefile: 22,641; perl: 7,525; f90: 6,424; csh: 5,285; objc: 2,620; lex: 1,646; lisp: 810; yacc: 603; javascript: 552; awk: 364; ml: 281; php: 145
file content (43 lines) | stat: -rwxr-xr-x 901 bytes parent folder | download | duplicates (4)
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
#! /usr/bin/env bash

error_code=0

usage="git_push_all <branch name>"
if [ "$1" == "" ]; then
  echo "Must provide branch name."
  echo $usage
  exit 1
elif [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
  echo $usage
  exit 0
fi

branch_name=$1

echo "branch_name = $branch_name"

external_packages="CTrilinos ForTrilinos mesquite moocho optika Sundance"

echo "Pushing branch on current repo."
git push -u origin $branch_name
error_code=$?
git push --tags
error_code=$(expr $? + $error_code)

for package in $external_packages
do
  echo "pushing branch on package $package"
  if [ ! -e packages/$package ]; then
    echo "packages/$package does not exist."
    error_code=1
    continue
  fi
  pushd packages/$package >/dev/null
  git push -u origin $branch_name
  error_code=$(expr $? + $error_code)
  git push --tags
  error_code=$(expr $? + $error_code)
  popd >/dev/null
done

exit $error_code