holdenk commented on code in PR #60472:
URL: https://github.com/apache/spark/pull/60472#discussion_r4576445677
##########
dev/merge_spark_pr.py:
##########
@@ -1146,41 +1779,71 @@ def merge_pr(pr_num, target_ref, title, body,
pr_repo_desc, pr_author, co_author
continue_maybe(msg)
had_conflicts = True
- # Use PR author as the primary author for proper GitHub attribution
- primary_author = bold_input(
- 'Enter primary author in the format of "name <email>" [%s]: ' %
pr_author
- )
- if primary_author == "":
- primary_author = pr_author
-
- merge_message_flags = []
-
- merge_message_flags += ["-m", title]
- if body is not None:
- # We remove @ symbols from the body to avoid triggering e-mails
- # to people every time someone creates a public fork of Spark.
- merge_message_flags += ["-m", body.replace("@", "")]
+ backport = _backport_of(body, pr_repo_desc.split("/", 1)[-1], target_ref)
+ if backport:
+ # The footer already names the author; a different --author would
contradict it.
+ print("Backport of #%s: keeping its commit message and author." %
backport[0])
+ # Soft check: the marker and footer are plain PR text, so confirm they
are some
+ # commit's message on the branch, as _land_via_fork leaves them.
+ commits = git.run(["git", "log", "--format=%b%x00", "HEAD..%s" %
pr_branch_name])
+ if backport[1] not in [_pick_message(c) for c in commits.split("\0")]:
Review Comment:
Added in 307ee6a54d5: a branch commit that differs from the body now asserts
the prompt. Replacing the condition with `False` fails it.
---
<sub>🤖 Posted by an AI agent (Claude Code · skill `none`) on behalf of
@holdenk.</sub>
<!-- agent-attribution v1: agent=claude-code; skill=none; operator=holdenk
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]