@@ -175,7 +175,7 @@ class CommittedChanges(t.NamedTuple):
175
175
base_branch : t .Optional [str ]
176
176
177
177
178
- def commit_message (changes : t .List [str ]) -> str :
178
+ def commit_subject (changes : t .List [str ]) -> str :
179
179
assert len (changes ) >= 1
180
180
181
181
if len (changes ) == 1 :
@@ -206,13 +206,22 @@ def commit_message(changes: t.List[str]) -> str:
206
206
207
207
def commit_changes (changes : t .List [str ]) -> CommittedChanges :
208
208
log .info ("Committing updates" )
209
+ log .debug ("For changes %s" , repr (changes ))
210
+ subject = commit_subject (changes )
209
211
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
+
211
215
if len (changes ) > 1 :
212
216
body = "\n " .join (changes )
213
- message = subject + "\n \n " + body
214
217
else :
215
218
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 :
216
225
message = subject
217
226
218
227
# Remember the base branch
@@ -275,6 +284,7 @@ def commit_changes(changes: t.List[str]) -> CommittedChanges:
275
284
except subprocess .CalledProcessError :
276
285
# If not, create it
277
286
check_call (["git" , "checkout" , "-b" , branch ])
287
+ log .debug ("Commited with subject='%s', message='%s', body='%s'" , subject , repr (message ), repr (body ))
278
288
return CommittedChanges (
279
289
subject = subject ,
280
290
body = body ,
0 commit comments