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
Adjust make-changelog to work with projects hosted on pagure #28
Conversation
…ctly Currently make-changelog could not retrieve the pull-requests from pagure since there are most often no merge commit. To circumvent this situation, we get the date of the first commit in the series and get all the pull-request that have been merged since then. As the updated_on field might be missing, we drop back to date_created in these cases. This also gives the opportunity to adjust the script more broadly for github vs pagure.
|
||
print start | ||
print "-" * len(start) | ||
|
||
if pagure: | ||
pulls.extend(get_pull_request_pagure(project, commits[0])) |
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.
This looks odd. Why commits[0]
?
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.
I want the date of the first commit after the last tag, so we get only the pull-request merged after that commit
return title, author, link | ||
|
||
|
||
def get_pull_request_pagure(project, commit): |
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.
if this returns more than one pull request, it needs to be called get_pull_requests_pagure
. Plural to indicate that it returns a collection.
commits = [] | ||
for line in output: | ||
line = line.split(None, 4) | ||
commits.append([line[0], ' '.join(line[1:4]), line[4]]) |
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.
To make this more readable, could you add an extra line? Something like this:
line = line.split(None, 4)
foo, bar, baz = line[0], ' '.join(line[1:4]), line[4]
commits.append([foo, bar, baz])
Otherwise the reader is left guessing about what those three things are.
Nice! 👍 |
Adjust make-changelog to work with projects hosted on pagure
No description provided.