@@ -145,41 +145,13 @@ def main(
145145 stack_orig_refs .append ((ref , pr_resolved ))
146146
147147 # OK, actually do the land now
148- for orig_ref , pr_resolved in stack_orig_refs :
148+ for orig_ref , _ in stack_orig_refs :
149149 try :
150150 sh .git ("cherry-pick" , f"{ remote_name } /{ orig_ref } " )
151151 except BaseException :
152152 sh .git ("cherry-pick" , "--abort" )
153153 raise
154154
155- # Add PR number to commit message like GitHub does
156- commit_msg = sh .git ("log" , "-1" , "--pretty=%B" )
157- # Get the original author and committer dates to preserve the commit hash
158- author_date = sh .git ("log" , "-1" , "--pretty=%aD" )
159- committer_date = sh .git ("log" , "-1" , "--pretty=%cD" )
160- lines = commit_msg .split ("\n " )
161- if lines :
162- # Add PR number to the subject line (first line)
163- subject = lines [0 ].rstrip ()
164- # Only add if not already present
165- pr_tag = f"(#{ pr_resolved .number } )"
166- if pr_tag not in subject :
167- subject = f"{ subject } { pr_tag } "
168- lines [0 ] = subject
169- new_msg = "\n " .join (lines )
170- # Preserve dates to keep the commit hash consistent
171- sh .git (
172- "commit" ,
173- "--amend" ,
174- "-F" ,
175- "-" ,
176- input = new_msg ,
177- env = {
178- "GIT_AUTHOR_DATE" : author_date ,
179- "GIT_COMMITTER_DATE" : committer_date ,
180- },
181- )
182-
183155 # All good! Push!
184156 maybe_force_arg = []
185157 if needs_force :
0 commit comments