reissue 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -6
- data/lib/reissue/fragment_handler/git_fragment_handler.rb +39 -9
- data/lib/reissue/rake.rb +12 -0
- data/lib/reissue/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 257fa1110ac09e92f40eec180e4b1602845de9adf34bc7e4e247ce19ff9b613b
|
4
|
+
data.tar.gz: 3477d62343f0a30c9ed83c2b33ebbf8be94711615ae2cf946116ef035a4949df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 836ef10dadf66cc909e2618b6dcb5d581dcba31ce6906fe61b80d1e6b797e438c00375476ce9dde7b10f1cddee6fb592f413d4acc353d829081417a10ca11ed1
|
7
|
+
data.tar.gz: b6144fa67c35c8761df0564ff8a1df2dad64a3c70670e5941153a4f7e5d9935b33cb579264ca6e56397a0b55b846b7962609bf485c45d9c829d205589f8f77c8
|
data/CHANGELOG.md
CHANGED
@@ -5,14 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
7
|
|
8
|
-
## [0.4.
|
8
|
+
## [0.4.3] - 2025-10-09
|
9
9
|
|
10
|
-
###
|
10
|
+
### Fixed
|
11
11
|
|
12
|
-
-
|
12
|
+
- Version handling for releases to pull the changelog updates considers version format. (65dd067)
|
13
|
+
- Bug handling version tags in order when generating changelog. (baf6518)
|
13
14
|
|
14
|
-
## [0.4.
|
15
|
+
## [0.4.3] - 2025-10-09
|
15
16
|
|
16
|
-
###
|
17
|
+
### Fixed
|
17
18
|
|
18
|
-
-
|
19
|
+
- Version handling for releases to pull the changelog updates considers version format. (65dd067)
|
20
|
+
- Bug handling version tags in order when generating changelog. (baf6518)
|
@@ -27,6 +27,14 @@ module Reissue
|
|
27
27
|
nil
|
28
28
|
end
|
29
29
|
|
30
|
+
# Get the last version tag used for comparison
|
31
|
+
#
|
32
|
+
# @return [String, nil] The most recent version tag or nil if no tags found
|
33
|
+
def last_tag
|
34
|
+
return nil unless git_available? && in_git_repo?
|
35
|
+
find_last_tag
|
36
|
+
end
|
37
|
+
|
30
38
|
private
|
31
39
|
|
32
40
|
def git_available?
|
@@ -48,17 +56,35 @@ module Reissue
|
|
48
56
|
"HEAD"
|
49
57
|
end
|
50
58
|
|
51
|
-
# Get commit
|
52
|
-
|
59
|
+
# Get commit hash and message using format specifiers
|
60
|
+
# %h = short hash, %x00 = null byte separator, %B = commit body
|
61
|
+
output = `git log #{commit_range} --reverse --format='%h%x00%B%x00' 2>/dev/null`
|
53
62
|
return [] if output.empty?
|
54
63
|
|
55
|
-
# Split by
|
56
|
-
output.split(
|
64
|
+
# Split by null bytes and group into pairs of (hash, message)
|
65
|
+
parts = output.split("\x00")
|
66
|
+
commits = []
|
67
|
+
|
68
|
+
# Process pairs: hash, message, (empty from double null), repeat
|
69
|
+
i = 0
|
70
|
+
while i < parts.length - 1
|
71
|
+
sha = parts[i].strip
|
72
|
+
message = parts[i + 1] || ""
|
73
|
+
|
74
|
+
if !sha.empty?
|
75
|
+
commits << {sha: sha, message: message}
|
76
|
+
end
|
77
|
+
|
78
|
+
i += 2
|
79
|
+
end
|
80
|
+
|
81
|
+
commits
|
57
82
|
end
|
58
83
|
|
59
84
|
def find_last_tag
|
60
|
-
#
|
61
|
-
|
85
|
+
# Find the most recent semantic version tag (v*.*.*) by tag creation date across all branches
|
86
|
+
# This ensures we exclude commits that are already in ANY tagged release, not just the current branch
|
87
|
+
tag = `git for-each-ref --sort=-creatordate --format='%(refname:short)' 'refs/tags/v[0-9]*.[0-9]*.[0-9]*' --count=1 2>/dev/null`.strip
|
62
88
|
tag.empty? ? nil : tag
|
63
89
|
end
|
64
90
|
|
@@ -66,8 +92,11 @@ module Reissue
|
|
66
92
|
result = {}
|
67
93
|
|
68
94
|
commits.each do |commit|
|
69
|
-
|
70
|
-
|
95
|
+
sha = commit[:sha]
|
96
|
+
message = commit[:message]
|
97
|
+
|
98
|
+
# Split commit message into lines and look for trailers
|
99
|
+
message.lines.each do |line|
|
71
100
|
line = line.strip
|
72
101
|
next if line.empty?
|
73
102
|
|
@@ -76,7 +105,8 @@ module Reissue
|
|
76
105
|
trailer_value = match[2].strip
|
77
106
|
|
78
107
|
result[section_name] ||= []
|
79
|
-
|
108
|
+
# Append the short SHA in parentheses
|
109
|
+
result[section_name] << "#{trailer_value} (#{sha})"
|
80
110
|
end
|
81
111
|
end
|
82
112
|
end
|
data/lib/reissue/rake.rb
CHANGED
@@ -238,6 +238,18 @@ module Reissue
|
|
238
238
|
if fragment
|
239
239
|
require_relative "fragment_handler"
|
240
240
|
handler = Reissue::FragmentHandler.for(fragment)
|
241
|
+
|
242
|
+
# Show comparison tag for git trailers
|
243
|
+
if fragment == :git && handler.respond_to?(:last_tag)
|
244
|
+
last_tag = handler.last_tag
|
245
|
+
if last_tag
|
246
|
+
puts "Comparing against: #{last_tag}"
|
247
|
+
puts " (Run 'git fetch --tags' if this seems out of date)\n\n"
|
248
|
+
else
|
249
|
+
puts "No version tags found (comparing against all commits)\n\n"
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
241
253
|
entries = handler.read
|
242
254
|
|
243
255
|
if entries.empty?
|
data/lib/reissue/version.rb
CHANGED