3 reponame
="$(basename "$(readlink -f .)")"
5 FORMAT="%C
(auto
)%h by
%an
(%ah
: %s
) sig
: %G?
%GS
0x
%GK https
://jfr.im
/git
/$reponame/commitdiff
/%h
"
6 H2I="https
://h2i
:ef199c443ca3f1f49709dbe79c3758273658fb7cfbb2ff88ab97ef9aedd6bb30@chat
.2948.ca
/h
2i
/null
"
12 if [ "$old" = "0000000000000000000000000000000000000000" ]; then # new branch
13 commits="created with
$(git describe --always "$new")"
14 elif [ "$new" = "0000000000000000000000000000000000000000" ]; then # deleted branch
15 commits="deleted from
$(git describe --always "$old")"
16 elif [ "$old" = "$(git merge-base "$old" "$new")" ]; then # fast-forward update
17 commits="updated from
$(git describe --always "$old") -> $(git describe --always "$new")"
18 elif [ "$new" = "$(git merge-base "$old" "$new")" ]; then # rollback
19 commits="!! rolled back to
$(git describe --always "$new") erasing
history through
$(git describe --always "$old")"
20 else # commit --amend, rebase, or similar
21 commits="!! rewrote
history from
$(git describe --always "$(git merge-base "$old" "$new")") -> $(git describe --always "$new") erasing history through $(git describe --always "$old")"
24 curl
-sS -d "[$reponame] $ref $commits" "$H2I" >/dev
/null
26 if [ "$old" = "0000000000000000000000000000000000000000" ]; then
27 git show
--no-show-signature --no-patch --pretty="tformat:$FORMAT" "$new"
29 git log
--no-show-signature --pretty="tformat:$FORMAT" "$old"..
"$new"
30 fi | while read line
; do
31 curl
-sS -d "$line" "$H2I" >/dev
/null