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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58c406237f6e7ef96ad4a4e1ed1aa2ba3e4cb10145edd6d44bff791a8e37d5be
4
- data.tar.gz: 26b103713df3d7de9c1f9af49df079a2e9954b9b7e96a58bc8e3e203607e531d
3
+ metadata.gz: 257fa1110ac09e92f40eec180e4b1602845de9adf34bc7e4e247ce19ff9b613b
4
+ data.tar.gz: 3477d62343f0a30c9ed83c2b33ebbf8be94711615ae2cf946116ef035a4949df
5
5
  SHA512:
6
- metadata.gz: 01d186d7b5f87e5c3ef2be402eb758971ff4dec3626d2e2aed8d67d5fd6418d064687682176b509b038b39710e8c313279047e807e42d927c902e4b5bbee649e
7
- data.tar.gz: 63d5c29928e104484ce0f1c5ce6ef101a8909ed8727ae441c3a5bb81c9aaf6ecbfb46b7f4af69540f6665fc71ea8e9f9a73d1ea928371d3f8fb7a84b7077198c
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.2] - 2025-09-16
8
+ ## [0.4.3] - 2025-10-09
9
9
 
10
- ### Changed
10
+ ### Fixed
11
11
 
12
- - New version was never created after the last release.
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.2] - 2025-09-16
15
+ ## [0.4.3] - 2025-10-09
15
16
 
16
- ### Changed
17
+ ### Fixed
17
18
 
18
- - New version was never created after the last release.
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 messages with trailers, in reverse order (oldest first)
52
- output = `git log #{commit_range} --reverse --format=%B 2>/dev/null`
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 double newline to separate commits
56
- output.split(/\n\n+/)
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
- # Try to find the most recent tag
61
- tag = `git describe --tags --abbrev=0 2>/dev/null`.strip
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
- # Split commit into lines and look for trailers
70
- commit.lines.each do |line|
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
- result[section_name] << trailer_value
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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reissue
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reissue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay