3 #==============================================================================
5 # File ID: 96b89f6a-d1eb-11e7-9056-f74d993421b0
7 # Make a full Git update in the current repository
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
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))
44 echo "$T_GREEN$progname: $*$T_RESET" >&2
48 if test "$opt_help" = "1"; then
49 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
52 Make a full Git update in the current repository. Fetch everything,
53 update all local branches, create commit-* branches from dangling heads
54 and push the result to all remotes.
56 Usage: $progname [options]
63 Be more quiet. Can be repeated to increase silence.
65 Increase level of verbosity. Can be repeated.
67 Print version information.
73 currbranch
=$
(git rev-parse
--abbrev-ref HEAD
)
78 if test -n "$currbranch" -a "$currbranch" != "HEAD"; then
79 runcmd git checkout
"$branch"
81 echo -n "$T_RED$progname: " >&2
82 echo "No current branch, skip \"git checkout $branch\"$T_RESET" >&2
86 runcmd git fetch
--all --prune
87 runcmd git merge
--ff-only
88 safe_checkout $
(git rev-parse HEAD
)
94 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :