-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: change commit message #2829
Changes from 4 commits
68d3054
7aa4828
f2cdc7b
99ee537
15c14f5
5f01dc1
febc7f9
d6969ff
b785d96
3ba3c3b
e5cf618
57cb16b
6b51265
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,19 +47,24 @@ def format_commit_message(commits: Dict[Commit, str], is_monorepo: bool) -> List | |
messages.append(formatted_message) | ||
else: | ||
messages.append(message_line) | ||
all_commits.extend(wrap_nested_commit(messages)) | ||
all_commits.extend(wrap_nested_commit(commit, messages)) | ||
return all_commits | ||
|
||
|
||
def wrap_nested_commit(messages: List[str]) -> List[str]: | ||
def wrap_nested_commit(commit: Commit, messages: List[str]) -> List[str]: | ||
""" | ||
Wrap message between `BEGIN_NESTED_COMMIT` and `BEGIN_NESTED_COMMIT`. | ||
|
||
:param commit: a GitHub commit. | ||
:param messages: a (multi-line) commit message, one line per item. | ||
:return: wrapped messages. | ||
""" | ||
short_sha = commit.hexsha[:7] | ||
result = ["BEGIN_NESTED_COMMIT"] | ||
result.extend(messages) | ||
result.append( | ||
f"Source Link: [googleapis/googleapis@{short_sha}](https://github.com/googleapis/googleapis/commit/{commit.hexsha})" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional nit: FWIW Github will automatically format the link if you just write the link in plain text. That way we make the logic simple at the cost of relying on the service (is it stable?). E.G. pasting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion, though I don't want to depends on github. |
||
) | ||
result.append("END_NESTED_COMMIT") | ||
return result | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make these two commit a link too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.