release-notes: clarify help text and minor refactor

This commit is contained in:
Rylan Polster 2020-12-28 11:34:29 -05:00
parent 80d8b419de
commit 6d0899f298
3 changed files with 7 additions and 6 deletions

View File

@ -18,7 +18,7 @@ module Homebrew
If no <previous_tag> is provided it defaults to the latest tag. If no <previous_tag> is provided it defaults to the latest tag.
If no <end_ref> is provided it defaults to `origin/master`. If no <end_ref> is provided it defaults to `origin/master`.
If `--markdown` and a <previous_tag> are passed, an extra line containg If `--markdown` and a <previous_tag> are passed, an extra line containing
a link to the Homebrew blog will be adding to the output. Additionally, a link to the Homebrew blog will be adding to the output. Additionally,
a warning will be shown if the latest minor release was less than one month ago. a warning will be shown if the latest minor release was less than one month ago.
EOS EOS
@ -35,11 +35,12 @@ module Homebrew
previous_tag = args.named.first previous_tag = args.named.first
if previous_tag.present? if previous_tag.present?
most_recent_major_minor_tag = previous_tag.sub(/\d+$/, "0")
one_month_ago = Date.today << 1
previous_tag_date = Date.parse Utils.popen_read( previous_tag_date = Date.parse Utils.popen_read(
"git", "-C", HOMEBREW_REPOSITORY, "log", "-1", "--format=%aI", previous_tag.sub(/\d+$/, "0") "git", "-C", HOMEBREW_REPOSITORY, "log", "-1", "--format=%aI", most_recent_major_minor_tag
) )
opoo "The latest major/minor release was less than one month ago." if previous_tag_date > (Date.today << 1) opoo "The latest major/minor release was less than one month ago." if previous_tag_date > one_month_ago
end end
previous_tag ||= Utils.popen_read( previous_tag ||= Utils.popen_read(

View File

@ -1197,7 +1197,7 @@ Print the merged pull requests on Homebrew/brew between two Git refs.
If no *`previous_tag`* is provided it defaults to the latest tag. If no *`previous_tag`* is provided it defaults to the latest tag.
If no *`end_ref`* is provided it defaults to `origin/master`. If no *`end_ref`* is provided it defaults to `origin/master`.
If `--markdown` and a *`previous_tag`* are passed, an extra line containg If `--markdown` and a *`previous_tag`* are passed, an extra line containing
a link to the Homebrew blog will be adding to the output. Additionally, a link to the Homebrew blog will be adding to the output. Additionally,
a warning will be shown if the latest minor release was less than one month ago. a warning will be shown if the latest minor release was less than one month ago.

View File

@ -1673,7 +1673,7 @@ Use \fBstackprof\fR instead of \fBruby\-prof\fR (the default)\.
Print the merged pull requests on Homebrew/brew between two Git refs\. If no \fIprevious_tag\fR is provided it defaults to the latest tag\. If no \fIend_ref\fR is provided it defaults to \fBorigin/master\fR\. Print the merged pull requests on Homebrew/brew between two Git refs\. If no \fIprevious_tag\fR is provided it defaults to the latest tag\. If no \fIend_ref\fR is provided it defaults to \fBorigin/master\fR\.
. .
.P .P
If \fB\-\-markdown\fR and a \fIprevious_tag\fR are passed, an extra line containg a link to the Homebrew blog will be adding to the output\. Additionally, a warning will be shown if the latest minor release was less than one month ago\. If \fB\-\-markdown\fR and a \fIprevious_tag\fR are passed, an extra line containing a link to the Homebrew blog will be adding to the output\. Additionally, a warning will be shown if the latest minor release was less than one month ago\.
. .
.TP .TP
\fB\-\-markdown\fR \fB\-\-markdown\fR