From abf70b75a038c289307e59cd4176f89c780cec41 Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Fri, 21 Aug 2026 11:25:12 -0400 Subject: [PATCH 1/2] complete cherry pick in merge script --- dev/merge_spark_pr.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dev/merge_spark_pr.py b/dev/merge_spark_pr.py index 291f09d2635e..f22b4178ebf8 100755 --- a/dev/merge_spark_pr.py +++ b/dev/merge_spark_pr.py @@ -681,8 +681,22 @@ def _do_cherry_pick(pr_num, merge_hash, pick_ref): except Exception as e: msg = "Error cherry-picking: %s\nWould you like to manually fix-up this merge?" % e continue_maybe(msg, True) - msg = "Okay, please fix any conflicts and finish the cherry-pick. Finished?" + msg = "Okay, please fix any conflicts and 'git add' conflicting files... Finished?" continue_maybe(msg, True) + # Finish the pick here so the committer never runs `cherry-pick --continue` + # (that opens an editor and defaults to --cleanup=strip, which drops lines + # that begin with '#'). Match the no-editor path used for clean picks and + # for conflicted squash-merges above. + run_cmd( + [ + "git", + "-c", + "commit.cleanup=whitespace", + "cherry-pick", + "--continue", + "--no-edit", + ] + ) continue_maybe( "Pick complete (local ref %s). Push to %s?" % (pick_branch_name, PUSH_REMOTE_NAME) From ca5a75426014c037b5e02db68f073ee835df3fde Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Sat, 22 Aug 2026 22:32:00 -0400 Subject: [PATCH 2/2] use scissors --- dev/merge_spark_pr.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/dev/merge_spark_pr.py b/dev/merge_spark_pr.py index f22b4178ebf8..7d5c646823f5 100755 --- a/dev/merge_spark_pr.py +++ b/dev/merge_spark_pr.py @@ -677,24 +677,31 @@ def _do_cherry_pick(pr_num, merge_hash, pick_ref): run_cmd("git checkout %s" % pick_branch_name) try: - run_cmd("git cherry-pick -sx %s" % merge_hash) + run_cmd( + [ + "git", + "-c", + "commit.cleanup=scissors", + "cherry-pick", + "-sx", + merge_hash, + ] + ) except Exception as e: msg = "Error cherry-picking: %s\nWould you like to manually fix-up this merge?" % e continue_maybe(msg, True) msg = "Okay, please fix any conflicts and 'git add' conflicting files... Finished?" continue_maybe(msg, True) - # Finish the pick here so the committer never runs `cherry-pick --continue` - # (that opens an editor and defaults to --cleanup=strip, which drops lines - # that begin with '#'). Match the no-editor path used for clean picks and - # for conflicted squash-merges above. + # Important to use `scissors` and `--edit` otherwise git will strip lines starting with `#` + # when calling `--continue`. See: https://github.com/apache/spark/pull/58214 run_cmd( [ "git", "-c", - "commit.cleanup=whitespace", + "commit.cleanup=scissors", "cherry-pick", "--continue", - "--no-edit", + "--edit", ] )