3 #==============================================================================
5 # File ID: 4f906152-875d-11ef-9cd0-754a1be59913
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
13 progname
=git-push-to-gitlab
16 T_GREEN
=$
(tput setaf
2)
23 while test -n "$1"; do
25 -h|
--help) opt_help
=1; shift ;;
26 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
27 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
28 --version) echo $progname $VERSION; exit 0 ;;
31 if printf '%s\n' "$1" |
grep -q ^
-; then
32 echo "$progname: $1: Unknown option" >&2
40 opt_verbose
=$
(($opt_verbose - $opt_quiet))
42 if test "$opt_help" = "1"; then
43 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
46 Usage: $progname [options]
53 Be more quiet. Can be repeated to increase silence.
55 Increase level of verbosity. Can be repeated.
57 Print version information.
63 if git branch |
grep 'tmp-gitlab'; then
64 echo $progname: tmp-gitlab branch already exists
>&2
68 for rev in $
(git sht
--reverse gitlab
/master..master
); do
70 GIT_PAGER
=cat git log
-1 --format="$T_GREEN%h$T_RESET %s" $rev \
71 && echo git branch tmp-gitlab
$rev \
72 && git branch tmp-gitlab
$rev \
73 && echo git push
-f gitlab tmp-gitlab
:master \
74 && git push
-f gitlab tmp-gitlab
:master \
75 && echo git branch
-D tmp-gitlab \
76 && git branch
-D tmp-gitlab \
77 && if git sht gitlab
/master..master |
grep -q ^
; then
78 printf '%s sleep 60...' $
(date +%H
:%M
:%S
)
87 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :