rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.72k stars 309 forks source link

prepare v0.12.0 release #802

Closed jswrenn closed 11 months ago

jswrenn commented 11 months ago

UPDATE: Changelog complete!

~Still need to write changelog.~ Is there any way to easily get all PRs merged after a date/tag? Running this:

git log v0.11.0.. --reverse --merges --oneline --grep='Merge #' | cut -d' ' -f3 | sort -n

Only turned up merge commits for:

But we have plenty more PRs that were merged without merge commits: https://github.com/rust-itertools/itertools/milestone/5?closed=1

I'm quite tempted to adopt a squash-before-merging approach before our next release to simplify this (so we could just list off all commits without too much noise).

Philippe-Cholet commented 11 months ago

git is an awesome command line tool but it can't have all the informations that github has. So I would look at the github API instead. ...Merged PRs since 2023-06-22 (date for v0.11.0):

And after a quick search, an helpful git log --tags --simplify-by-decoration --pretty="format:%cs %d" | grep v0.11.0. (Or with %cI) It could be used to merge this with the curl|jq command.

jswrenn commented 11 months ago

Thanks! Coming at this from a slightly different angle, running this:

git log v0.11.0.. --reverse --oneline \
  | cut -d' ' -f1 \
  | xargs -I {} gh pr list --search {} --state merged --json number \
  | jq '.[] | .number' \
  | sort -nu

...gives:

...which is also 52 PRs! That sounds about right. I'll start putting together the changelog.

Philippe-Cholet commented 11 months ago

I dived into jq to nicely sort merged PRs by the merged_at key and came with two git aliases:

pulls-after-date = "!f() { curl -H 'Accept: application/vnd.github+json' 'https://api.github.com/search/issues?per_page=100&q=repo:rust-itertools/itertools+type:pr+merged:>'$1 | jq '.items | sort_by(.pull_request.merged_at) | .[].number'; }; f"
pulls-after-tag = "!f() { git pulls-after-date $(git log -1 --format=%as $1); }; f"
# %aI would be more precise than %as but it contains a "+" that messes with the github url.

Usage: git pulls-after-date 2023-06-22 or simply git pulls-after-tag v0.11.0.

Aliases v2: any github repo ; use more precise date with %aI instead of %as but url-escape the contained + to %2B.

# e.g.  rust-itertools/itertools
get-repo = "!f() { url=$(git remote get-url upstream); url=${url#'https://github.com/'}; url=${url%'.git'}; echo ${url}; }; f"
# List (up to 100) merged PRs for the current GitHub repo.
pulls-after-date = "!f() { date_for_url=${1/+/%2B}; curl -H 'Accept: application/vnd.github+json' 'https://api.github.com/search/issues?per_page=100&q=repo:'$(git get-repo)'+type:pr+merged:>'$date_for_url | jq '.items | sort_by(.pull_request.merged_at) | .[].number'; }; f"
# Get the date for a given tag, then call the main alias.
pulls-after-tag = "!f() { git pulls-after-date $(git log -1 --format=%aI $1); }; f"
Philippe-Cholet commented 11 months ago

@jswrenn There is #![doc(html_root_url = "https://docs.rs/itertools/0.11/")] in lib.rs.

jswrenn commented 11 months ago

Whoops, I thought we deleted that.