prism-merge 1.0.0 → 1.0.1
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +17 -1
- data/README.md +1 -1
- data/lib/prism/merge/conflict_resolver.rb +23 -10
- data/lib/prism/merge/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0befc378c1d1327b7fc85602de26936828c6420473d09f1775971594f76fb66b
|
|
4
|
+
data.tar.gz: bb38bf548e627ae00dc77f6b5f2745bdc7cbe0e05e4e5aea380eb992c2521dcb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e4a4fddfdba58791bab748377fbb8ae7ba68f806f9c68c3f81ab5aa2d826508d7c16e7c9178ad282ed00a82873ca1592c106a9e2d9e7f7e1b27569b5f9a7c32
|
|
7
|
+
data.tar.gz: 8f38c2209fbe7de1b60c63dc0c94b5073db50ecd5ef356e18a3eab79cdc8c6c61474ad222c03bb811ec226b6fc0796fd5d78c95c9b4df7d51757787f58c175a8
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,20 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [1.0.1] - 2025-12-03
|
|
34
|
+
|
|
35
|
+
- TAG: [v1.0.1][1.0.1t]
|
|
36
|
+
- COVERAGE: 95.48% -- 613/642 lines in 7 files
|
|
37
|
+
- BRANCH COVERAGE: 81.39% -- 188/231 branches in 7 files
|
|
38
|
+
- 100.00% documented
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- `SmartMerger` now correctly handles merge conflicts that involve `kettle-dev:freeze` blocks
|
|
43
|
+
- Entire freeze block from destination is preserved
|
|
44
|
+
- Still allows template-only nodes to be added
|
|
45
|
+
- Resolves an issue where template-only nodes were dropped if destination contained a freeze block
|
|
46
|
+
|
|
33
47
|
## [1.0.0] - 2025-12-03
|
|
34
48
|
|
|
35
49
|
- TAG: [v1.0.0][1.0.0t]
|
|
@@ -41,6 +55,8 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
41
55
|
|
|
42
56
|
- Initial release
|
|
43
57
|
|
|
44
|
-
[Unreleased]: https://github.com/kettle-rb/prism-merge/compare/v1.0.
|
|
58
|
+
[Unreleased]: https://github.com/kettle-rb/prism-merge/compare/v1.0.1...HEAD
|
|
59
|
+
[1.0.1]: https://github.com/kettle-rb/prism-merge/compare/v1.0.0...v1.0.1
|
|
60
|
+
[1.0.1t]: https://github.com/kettle-rb/prism-merge/releases/tag/v1.0.1
|
|
45
61
|
[1.0.0]: https://github.com/kettle-rb/prism-merge/compare/71fcddaa659cd6e9e94053e67524e5a400423ced...v1.0.0
|
|
46
62
|
[1.0.0t]: https://github.com/kettle-rb/prism-merge/tags/v1.0.0
|
data/README.md
CHANGED
|
@@ -965,7 +965,7 @@ Thanks for RTFM. ☺️
|
|
|
965
965
|
[📌gitmoji]: https://gitmoji.dev
|
|
966
966
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
967
967
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
968
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
|
968
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.642-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
969
969
|
[🔐security]: SECURITY.md
|
|
970
970
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
971
971
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
|
@@ -71,7 +71,9 @@ module Prism
|
|
|
71
71
|
@add_template_only_nodes = add_template_only_nodes
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
# Resolve a boundary by deciding which content to keep
|
|
74
|
+
# Resolve a boundary by deciding which content to keep.
|
|
75
|
+
# If the boundary contains a `kettle-dev:freeze` block, the entire
|
|
76
|
+
# block from the destination is preserved.
|
|
75
77
|
# @param boundary [FileAligner::Boundary] Boundary to resolve
|
|
76
78
|
# @param result [MergeResult] Result object to populate
|
|
77
79
|
def resolve(boundary, result)
|
|
@@ -79,12 +81,6 @@ module Prism
|
|
|
79
81
|
template_content = extract_boundary_content(@template_analysis, boundary.template_range)
|
|
80
82
|
dest_content = extract_boundary_content(@dest_analysis, boundary.dest_range)
|
|
81
83
|
|
|
82
|
-
# If destination is in freeze block, always keep destination
|
|
83
|
-
if boundary.dest_range && dest_content[:has_freeze_block]
|
|
84
|
-
add_content_to_result(dest_content, result, :destination, MergeResult::DECISION_FREEZE_BLOCK)
|
|
85
|
-
return
|
|
86
|
-
end
|
|
87
|
-
|
|
88
84
|
# If both sides are empty, nothing to do
|
|
89
85
|
return if template_content[:lines].empty? && dest_content[:lines].empty?
|
|
90
86
|
|
|
@@ -153,12 +149,29 @@ module Prism
|
|
|
153
149
|
template_nodes = template_content[:nodes]
|
|
154
150
|
dest_nodes = dest_content[:nodes]
|
|
155
151
|
|
|
156
|
-
# Build signature map for destination nodes
|
|
157
|
-
dest_sig_map = build_signature_map(dest_nodes)
|
|
158
|
-
|
|
159
152
|
# Track which dest nodes have been matched
|
|
160
153
|
matched_dest_indices = Set.new
|
|
161
154
|
|
|
155
|
+
# Handle freeze blocks first
|
|
156
|
+
if dest_content[:has_freeze_block]
|
|
157
|
+
line_in_freeze = dest_content[:line_range].find { |ln| @dest_analysis.in_freeze_block?(ln) }
|
|
158
|
+
if line_in_freeze
|
|
159
|
+
freeze_block = @dest_analysis.freeze_block_at(line_in_freeze)
|
|
160
|
+
freeze_content = extract_boundary_content(@dest_analysis, freeze_block[:line_range])
|
|
161
|
+
add_content_to_result(freeze_content, result, :destination, MergeResult::DECISION_FREEZE_BLOCK)
|
|
162
|
+
|
|
163
|
+
# Mark all nodes within the freeze block as matched
|
|
164
|
+
dest_nodes.each do |d_node_info|
|
|
165
|
+
if freeze_block[:line_range].cover?(d_node_info[:line_range].begin)
|
|
166
|
+
matched_dest_indices << d_node_info[:index]
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Build signature map for destination nodes
|
|
173
|
+
dest_sig_map = build_signature_map(dest_nodes)
|
|
174
|
+
|
|
162
175
|
# Build a set of line numbers that are covered by leading comments of nodes
|
|
163
176
|
# so we don't duplicate them when processing non-node lines
|
|
164
177
|
leading_comment_lines = Set.new
|
data/lib/prism/merge/version.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: prism-merge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -263,10 +263,10 @@ licenses:
|
|
|
263
263
|
- MIT
|
|
264
264
|
metadata:
|
|
265
265
|
homepage_uri: https://prism-merge.galtzo.com/
|
|
266
|
-
source_code_uri: https://github.com/kettle-rb/prism-merge/tree/v1.0.
|
|
267
|
-
changelog_uri: https://github.com/kettle-rb/prism-merge/blob/v1.0.
|
|
266
|
+
source_code_uri: https://github.com/kettle-rb/prism-merge/tree/v1.0.1
|
|
267
|
+
changelog_uri: https://github.com/kettle-rb/prism-merge/blob/v1.0.1/CHANGELOG.md
|
|
268
268
|
bug_tracker_uri: https://github.com/kettle-rb/prism-merge/issues
|
|
269
|
-
documentation_uri: https://www.rubydoc.info/gems/prism-merge/1.0.
|
|
269
|
+
documentation_uri: https://www.rubydoc.info/gems/prism-merge/1.0.1
|
|
270
270
|
funding_uri: https://github.com/sponsors/pboling
|
|
271
271
|
wiki_uri: https://github.com/kettle-rb/prism-merge/wiki
|
|
272
272
|
news_uri: https://www.railsbling.com/tags/prism-merge
|
metadata.gz.sig
CHANGED
|
Binary file
|