Skip to content
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

Update Changelog script to include changes in lib dependencies. #420

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

microbit-carlos
Copy link
Collaborator

It also changes the log format, as git shortlog groups the commits by author (or other options, but they always have to grouped) and that can get a bit verbose when also including commits from the other libraries.

Also, an advantage of not grouping by author is that the commits are listed historically.

As part of this PR I've also updated the changelog from v0.2.63, as this is the last tag used for MakeCode live, so it'll be useful to have this info when presenting MS the changelog for deployment.

@microbit-carlos microbit-carlos added this to the v0.2.67 milestone Apr 2, 2024
Comment on lines +52 to +55
def getCommitsBetween( tagA, tagB = "HEAD", dir=None):
if dir:
original_dir = os.getcwd()
os.chdir(dir)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be able to easily run this function in other directories I've added the dir parameter to temporarily change the current working directory.

if dir:
original_dir = os.getcwd()
os.chdir(dir)
commits = os.popen(f'git log --format="%s (by %an)" --no-merges --reverse {tagA}..{tagB}').read().strip().splitlines()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no way to change shortlog to not group commits, so I've replaced it with git log --no-merges. Reverse was needed because that's the order used by shortlog, which I guess makes sense with older commits first, as we read top to bottom.

The format includes the git author name at the end of the commit title, in case we wanted to still provide attribution.
%s -> commit title
%an -> commit author name

@lancaster-university lancaster-university deleted a comment from github-actions bot Apr 2, 2024
@lancaster-university lancaster-university deleted a comment from github-actions bot Apr 2, 2024
@lancaster-university lancaster-university deleted a comment from github-actions bot Apr 2, 2024
@microbit-carlos
Copy link
Collaborator Author

@JohnVidler if possible it'd be great to merge this before releasing the next tag, to be able to include this info in the changelog.

Copy link
Collaborator Author

@microbit-carlos microbit-carlos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in a call and good to merge 👍

@microbit-carlos microbit-carlos merged commit a3492c4 into master Apr 8, 2024
29 checks passed
@microbit-carlos microbit-carlos deleted the changelog-libs branch April 8, 2024 14:53
@microbit-carlos microbit-carlos self-assigned this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant