2 # TopGit - A different patch queue manager
19 tgish_deps_only
=true
;;
21 echo "Usage: tg push [--dry-run] [--no-deps] [--tgish-only] [-r remote] branch*"
28 branches
="$branches $arg";;
32 if [ -z "$remote" ]; then
36 if [ -z "$remote" ]; then
37 die
"no remote location given. Either use -r remote argument or set topgit.remote"
40 if [ -z "$branches" ]; then
41 branches
="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')"
44 for name
in $branches; do
45 ref_exists
"$name" || die
"detached HEAD? Can't push $name"
48 _listfile
="$(get_temp tg-push-listfile)"
52 # FIXME should we abort on missing dependency?
53 [ -z "$_dep_missing" ] ||
return 0
55 # if so desired omit non tgish deps
56 $tgish_deps_only && [ -z "$_dep_is_tgish" ] && return 0
58 # filter out plain SHA1s. These don't need to be pushed explicitly as
59 # the patches that depend on the sha1 have it already in their ancestry.
60 is_sha1
"$_dep" && return 0
62 echo "$_dep" >> "$_listfile"
63 [ -z "$_dep_is_tgish" ] ||
64 echo "top-bases/$_dep" >> "$_listfile"
67 for name
in $branches; do
69 # re-use push_branch, which expects some pre-defined variables
73 ref_exists
"top-bases/$_dep" ||
77 # deps but only if branch is tgish
78 $recurse_deps && [ -n "$_dep_is_tgish" ] &&
79 no_remotes
=1 recurse_deps push_branch
"$name"
81 # remove multiple occurrences of the same branch
82 sort -u "$_listfile" |
xargs git push
$dry_run "$remote"