#!/usr/bin/env bash
# Agents only: push every commit as it is made, so a draft PR always shows
# where the work is. That is what lets a later session resume an issue from
# the draft alone (see the issue-loop plugin's issue-solver agent), and what a person
# watching the PR sees move.
#
# Only a branch that already tracks one on the remote — set by the first
# `git push -u`, which is the deliberate step — and never main, which is only
# ever written by merging a PR. Nothing during a rebase, whose intermediate
# commits are not meant to be seen. In the background, so the commit returns at
# once; failures go to the log and not to the agent, who will see a stale PR
# and push by hand.
||
branch= ||
||
gitdir=
&&
log="/agent-push.log"
&