You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This retrieves [co-authors](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors) from comment.
208
+
Each line will be associated with a Commit object and counted
209
+
to its co-author's "account".
210
+
Whether empty lines are counted is determined by the
211
+
count_empty_lines configuration option.
212
+
213
+
git log -1 <sha> will produce output like the following
214
+
for each line in a file:
215
+
216
+
When a commit does not contain co-authors:
217
+
commit ca8b32b24af1ce97fb29c5139b2f80e0c2ad9d1c
218
+
Author: John Doe <jdoe@john.com>
219
+
Date: Sun Dec 22 11:10:32 2019 +0100
220
+
221
+
add plugin skeleton
222
+
223
+
When a commit contains co-authors:
224
+
commit ca8b32b24af1ce97fb29c5139b2f80e0c2ad9d1c
225
+
Author: John Doe <jdoe@john.com>
226
+
Date: Sun Dec 22 11:10:32 2019 +0100
227
+
228
+
add plugin skeleton
229
+
230
+
Co-authored-by: John Doe <jdoe@john.com>
231
+
Co-authored-by: Rock Smith <rsmith@smith.com>
232
+
233
+
In this case we skip the original author as redundant using email address to detect it.
234
+
235
+
Args:
236
+
sha: the SHA of the commit to process
237
+
Returns:
238
+
--- (this method works through side effects)
239
+
"""
240
+
241
+
args= []
242
+
args.append("-1") # Only existing sha
243
+
args.append(sha)
244
+
cmd=GitCommand("log", args)
245
+
cmd.run()
246
+
247
+
lines=cmd.stdout()
248
+
249
+
# in case of empty, non-committed files, raise error
repo.git.commit(message="co-authors commit\nCo-authored-by: Test Person <testtest@gmail.com>\nCo-authored-by: John Doe <jdoe@john.com>", author=author)
0 commit comments