# PFX ref prefix of the topic branches (default
# refs/heads/misc-next/topics/)
# EXCLUDE the exclusion list (default scripts/exclude.txt)
+# PUBBASE the base-commit the mails name (default: searched, below;
+# set it empty to send without a base-commit line)
+# PUBREMOTES remotes searched for it (default "kdave btrfs linus")
set -e -o pipefail
HERE=$(cd "$(dirname "$0")/.." && pwd)
OUT=${OUT:-$HERE}
cd "$SRC"
B=$(git rev-parse "$TESTING^1")
TESTING_SHA=$(git rev-parse "$TESTING")
+
+# --- the base-commit the mails name. The lane base is a local copy of
+# kdave's "=== misc-next on b-for-next ===" marker, so no reviewer can
+# fetch its hash. Name instead a commit on a public remote-tracking branch
+# with the same tree; if there is none, the mails carry no base-commit line
+# (prerequisite-patch-id lines of stacked series stay). Fetch first.
+PUBREMOTES=${PUBREMOTES:-kdave btrfs linus}
+if [ -z "${PUBBASE+x}" ]; then
+ btree=$(git rev-parse "$B^{tree}")
+ pubrefs=$(for r in $PUBREMOTES; do git for-each-ref --format='%(refname)' "refs/remotes/$r/"; done)
+ PUBBASE=
+ [ -z "$pubrefs" ] || PUBBASE=$(git log --format='%H %T' --since=120.days $pubrefs |
+ awk -v t="$btree" '$2 == t { print $1; exit }')
+fi
+[ -z "$PUBBASE" ] || PUBBASE=$(git rev-parse --verify "$PUBBASE^{commit}")
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
die() { echo "STOP: $*" >&2; exit 1; }
if len(out) != len(lines):
open(f, 'w').write('\n'.join(out))
PY
+ if [ -n "$PUBBASE" ]; then
+ sed -i "s/^base-commit: $B\$/base-commit: $PUBBASE/" "$d"/[0-9][0-9][0-9][0-9]-*.patch
+ else
+ sed -i "/^base-commit: $B\$/d" "$d"/[0-9][0-9][0-9][0-9]-*.patch
+ fi
echo "$t $n $(git rev-parse --short=12 "$PFX$t")${LANEPARENT[$t]:+ on ${LANEPARENT[$t]}}"
done
sed -n '/^$/q;p' "$f" | grep -q '^From: .*<ce3g8jdj@umail\.furryterror\.org>' || continue
sed -n '/^---$/q;/^[Aa]ssisted-by:/{s|^|'"$f"': |;p}' "$f"; done; done)
[ -z "$left" ] || die "verify: Assisted-by left in Zygo's changelogs: $left"
+badbase=$(for t in "${exported[@]}"; do grep -H '^base-commit:' "$OUT"/topics/$t/[0-9]*.patch 2>/dev/null; done |
+ grep -v ":base-commit: ${PUBBASE:-NONE}\$" || true)
+[ -z "$badbase" ] || die "verify: unexpected base-commit lines: $badbase"
GIT_INDEX_FILE=$idx git read-tree "$acc"
if [ -s "$OUT/fixups/post-merge.patch" ]; then
GIT_INDEX_FILE=$idx git apply --cached "$OUT/fixups/post-merge.patch"
[ "$(GIT_INDEX_FILE=$idx git write-tree)" = "$(git rev-parse "$target^{tree}")" ] || die "verify: post-merge"
echo "fixup target: tree $(git rev-parse "$target^{tree}") (testing without the dropped commits${RESOLVED:+; ${#RESOLVED[@]} revert(s) by stored resolution})"
echo "fixup: $(git diff --shortstat "$acc" "$target" | sed 's/^ //;s/^$/empty/')"
-echo "verified; base $(git rev-parse --short=12 "$B") testing $(git rev-parse --short=12 "$TESTING") zb64 $(git rev-parse --short=12 zygo-misc-next-zb64)"
+echo "verified; base $(git rev-parse --short=12 "$B") (mails: $([ -n "$PUBBASE" ] && echo "base-commit $(git rev-parse --short=12 "$PUBBASE")" || echo "no base-commit")) testing $(git rev-parse --short=12 "$TESTING") zb64 $(git rev-parse --short=12 zygo-misc-next-zb64)"