1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# bl-push-main — balls close.post plugin: deliver main to origin.
#
# bl close seals its squash-merge to main itself, outside `git commit`, so the
# repo's .githooks/post-commit hook never fires and upstream delivery stalls.
# Wired into close.post, this plugin restores it: once close lands the squash
# on main, push main to origin.
#
# Contract:
# * answers the balls plugin protocol handshake;
# * ignores stdin (drains a piped payload, never blocks);
# * ALWAYS exits 0 — a non-zero exit in close.post triggers plugin rollback,
# un-sealing a commit the remote may already hold; a push failure only
# warns on stderr;
# * acts on THIS project's repo, resolved from the plugin's own on-disk home
# (<repo>/scripts/bl-push-main -> <repo>), so it is right regardless of the
# dispatch working directory.
# Plugin protocol handshake: declare the ops we serve.
if [; then
fi
# Ignore stdin: drain a piped payload, never block on a terminal.
[ ||
# The repo is the plugin's own home: <repo>/scripts/bl-push-main -> <repo>.
self=""
root="" ||
# Guard: no 'origin' remote -> nothing to deliver.
||
if ! ; then
fi