2 # TopGit - A different patch queue manager
23 tgish_deps_only
=true
;;
27 echo "Usage: ${tgname:-tg} [...] push [--dry-run] [--force] [--no-deps] [--tgish-only] [-r <remote>] [-a | --all | <branch>...]"
34 branches
="$branches $arg";;
38 if [ -z "$remote" ]; then
42 if [ -z "$remote" ]; then
43 die
"no remote location given. Either use -r remote argument or set topgit.remote"
46 if [ -z "$branches" ]; then
48 branches
="$(non_annihilated_branches)"
50 branches
="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')"
54 for name
in $branches; do
55 ref_exists
"$name" || die
"detached HEAD? Can't push $name"
58 _listfile
="$(get_temp tg-push-listfile)"
62 # FIXME should we abort on missing dependency?
63 [ -z "$_dep_missing" ] ||
return 0
65 # if so desired omit non tgish deps
66 $tgish_deps_only && [ -z "$_dep_is_tgish" ] && return 0
68 # filter out plain SHA1s. These don't need to be pushed explicitly as
69 # the patches that depend on the sha1 have it already in their ancestry.
70 is_sha1
"$_dep" && return 0
72 echo "$_dep" >> "$_listfile"
73 [ -z "$_dep_is_tgish" ] ||
74 echo "top-bases/$_dep" >> "$_listfile"
77 for name
in $branches; do
79 # re-use push_branch, which expects some pre-defined variables
83 ref_exists
"top-bases/$_dep" ||
87 # deps but only if branch is tgish
88 $recurse_deps && [ -n "$_dep_is_tgish" ] &&
89 no_remotes
=1 recurse_deps push_branch
"$name"
92 # remove multiple occurrences of the same branch
93 sort -u "$_listfile" |
xargs git push
$dry_run $force "$remote"