@@ -175,7 +175,7 @@ class CommittedChanges(t.NamedTuple):
175175 base_branch : t .Optional [str ]
176176
177177
178- def commit_message (changes : t .List [str ]) -> str :
178+ def commit_subject (changes : t .List [str ]) -> str :
179179 assert len (changes ) >= 1
180180
181181 if len (changes ) == 1 :
@@ -206,13 +206,22 @@ def commit_message(changes: t.List[str]) -> str:
206206
207207def commit_changes (changes : t .List [str ]) -> CommittedChanges :
208208 log .info ("Committing updates" )
209+ log .debug ("For changes %s" , repr (changes ))
210+ subject = commit_subject (changes )
209211 body : t .Optional [str ]
210- subject = commit_message (changes )
212+ # message will be the git-style combination of subject and message
213+ # we'll still need the parts for PR creation later
214+
211215 if len (changes ) > 1 :
212216 body = "\n " .join (changes )
213- message = subject + "\n \n " + body
214217 else :
215218 body = None
219+ # move the changelog url from subject to body
220+ if "\n " in subject :
221+ subject , body = subject .split ("\n " , maxsplit = 1 )
222+ if body :
223+ message = subject + "\n \n " + body
224+ else :
216225 message = subject
217226
218227 # Remember the base branch
@@ -275,6 +284,7 @@ def commit_changes(changes: t.List[str]) -> CommittedChanges:
275284 except subprocess .CalledProcessError :
276285 # If not, create it
277286 check_call (["git" , "checkout" , "-b" , branch ])
287+ log .debug ("Commited with subject='%s', message='%s', body='%s'" , subject , repr (message ), repr (body ))
278288 return CommittedChanges (
279289 subject = subject ,
280290 body = body ,
0 commit comments