#: * `release-notes` [`--markdown`] [] []: #: Output the merged pull requests on Homebrew/brew between two Git refs. #: If no is provided it defaults to the newest tag. #: If no is provided it defaults to `origin/master`. #: #: If `--markdown` is passed, output as a Markdown list. module Homebrew module_function def release_notes previous_tag = ARGV.named.first unless previous_tag previous_tag = Utils.popen_read("git tag --list --sort=-version:refname") .lines.first.chomp end odie "Could not find any previous tags!" unless previous_tag end_ref = ARGV.named[1] || "origin/master" [previous_tag, end_ref].each do |ref| next if quiet_system "git", "rev-parse", "--verify", "--quiet", ref odie "Ref #{ref} does not exist!" end output = Utils.popen_read("git log --pretty=format:'%s >> - %b%n' '#{previous_tag}'..'#{end_ref}'") .lines.grep(/Merge pull request/) output.map! do |s| s.gsub(%r{.*Merge pull request #(\d+) from ([^/]+)/[^>]*(>>)*}, "https://github.com/Homebrew/brew/pull/\\1 (@\\2)") end if ARGV.include?("--markdown") output.map! do |s| /(.*\d)+ \(@(.+)\) - (.*)/ =~ s "- [#{Regexp.last_match(3)}](#{Regexp.last_match(1)}) (@#{Regexp.last_match(2)})" end end puts "Release notes between #{previous_tag} and #{end_ref}:" puts output end end d=bf1972dc1e8ffbeaddfa53df1d49bc5a2177f09c'>refslogtreecommitdiffstats
blob: c64b34d13c48671c4b951cecbd07a90d1f17643d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99