]> git.hungrycats.org Git - linux/commitdiff
scripts/export.sh: strip Assisted-by from the exported patches
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 6 Nov 2026 01:42:26 +0000 (20:42 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 6 Nov 2026 01:42:26 +0000 (20:42 -0500)
Upstream dropped the Assisted-by rule in 1e035297ffda ("docs: remove
Assisted-by references"); tool use is described in the cover letter
instead.  The lane commits keep the tag, so Zygo can see which model
wrote or edited a patch, but the send-email copies lose it: every
"Assisted-by:" line in the changelog part of each exported patch
(headers to the first "---") is removed, whoever added it.  Cover
letters are left alone.  The verify step now fails if any is left.

Dry run against misc-next/testing 2365f2f67131: 226 lines removed, all
patches still apply to the topic trees, fixup verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/export.sh

index c3160184193f4315f1e6cdf5251a6326b84a1923..473d93aee37b7ec7a04852edfb3fac1bdb6a2257 100755 (executable)
@@ -233,6 +233,23 @@ PY
        else
                git format-patch "${args[@]}" "$from..$tip"
        fi
+       # Assisted-by is no longer asked for upstream (1e035297ffda "docs:
+       # remove Assisted-by references"; tool use goes in the cover letter).
+       # The lane commits keep it, so Zygo can see which model wrote or
+       # edited a patch; only the mail copies lose it, in the changelog part
+       # (headers to the first "---") of every patch, whoever added it.
+       python3 -I - "$d"/[0-9][0-9][0-9][0-9]-*.patch <<'PY'
+import sys
+for f in sys.argv[1:]:
+    if f.endswith('/0000-cover-letter.patch'):
+        continue
+    lines = open(f).read().split('\n')
+    end = lines.index('---')
+    out = [l for i, l in enumerate(lines)
+           if i >= end or not l.lower().startswith('assisted-by:')]
+    if len(out) != len(lines):
+        open(f, 'w').write('\n'.join(out))
+PY
        echo "$t $n $(git rev-parse --short=12 "$PFX$t")${LANEPARENT[$t]:+ on ${LANEPARENT[$t]}}"
 done
 
@@ -267,6 +284,9 @@ for t in "${exported[@]}"; do
        done
        [ "$got" = "$(git rev-parse "$want^{tree}")" ] || die "verify: $t patches != lane topic minus the dropped commits"
 done
+left=$(for t in "${exported[@]}"; do for f in "$OUT"/topics/$t/[0-9]*.patch; do
+       [ -e "$f" ] && sed -n '/^---$/q;/^[Aa]ssisted-by:/{s|^|'"$f"': |;p}' "$f"; done; done)
+[ -z "$left" ] || die "verify: Assisted-by left in the changelogs: $left"
 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"