git 4.0.2 → 4.0.4

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: edf8c0ca68f2c4a5e2ecd4a72cfc49bf30edf8406bd7016ebd8e96e8bb016065
4
- data.tar.gz: 76c74e062482a50b780c3af13767e5bbd9d361f7fe4aad44c593d11de53a3acf
3
+ metadata.gz: 53b8b74b8c2b17a44030a715fa6d562e989189b2c2b1b6a3195d349ed4cab439
4
+ data.tar.gz: 504029d354e4def312a520cc93ed0ac5857d02093405f776897d50c7f979ffb7
5
5
  SHA512:
6
- metadata.gz: 49d11d3ae7d6a26365c594381f94d426130fa3d62c819d575b1b8868fa9af3f83b42ba81b0a9404e3aeedc422962f13d6f10203bdfd2074e9e9fbc36c1fc3422
7
- data.tar.gz: bf6e926d267120715fbfef1d2008dc3f4951130cdfe6266203caceb9fe63bd55c02282b0798a39c3917ea927af6215da805253eb85210a35a531bc066e62ed78
6
+ metadata.gz: 29db48811be6a98b1096bfab4f5347aac762fcc03b9e232246cfb17e574f32a8d5c9d8444e32c242c1b7a30a777cd89b1498d58a7a7fde0c313bfd045f6a8b72
7
+ data.tar.gz: a9d24b3d5aca3a7f63856ce74808d562626992c7c023f51bb01f6167cc1b9ed425ba57ad0aecce0d3c4f77fec5138efbe5a502d512dfcc26bccf6e6004969137
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "4.0.2"
2
+ ".": "4.0.4"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -5,6 +5,39 @@
5
5
 
6
6
  # Change Log
7
7
 
8
+ ## [4.0.4](https://github.com/ruby-git/ruby-git/compare/v4.0.3...v4.0.4) (2025-07-09)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Remove deprecation from Git::Path ([ab1e207](https://github.com/ruby-git/ruby-git/commit/ab1e20773c6a300b546841f79adf8dd6e707250e))
14
+ * Remove deprecation from Git::Stash ([9da1e91](https://github.com/ruby-git/ruby-git/commit/9da1e9112e38c0e964dd2bc638bda7aebe45ba91))
15
+
16
+
17
+ ### Other Changes
18
+
19
+ * Add tests for Git::Base#set_index including deprecation ([e6ccb11](https://github.com/ruby-git/ruby-git/commit/e6ccb11830a794f12235e47032235c3284c84cf6))
20
+ * Add tests for Git::Base#set_working including deprecation ([ee11137](https://github.com/ruby-git/ruby-git/commit/ee1113706a8e34e9631f0e2d89bd602bca87f05f))
21
+ * Add tests to verify Git::Object.new creates the right type of object ([ab17621](https://github.com/ruby-git/ruby-git/commit/ab17621d65a02b70844fde3127c9cbb219add7f5))
22
+ * Verify deprecated Git::Log methods emit a deprecation warning ([abb0efb](https://github.com/ruby-git/ruby-git/commit/abb0efbdb3b6bb49352d097b1fece708477d4362))
23
+
24
+ ## [4.0.3](https://github.com/ruby-git/ruby-git/compare/v4.0.2...v4.0.3) (2025-07-08)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * Correct the deprecation horizon for Git deprecations ([b7b7f38](https://github.com/ruby-git/ruby-git/commit/b7b7f38ccb88ba719e8ea7cb3fea14474b19a00c))
30
+ * Fix Rubocop Layout/EmptyLinesAroundClassBody offense ([1de27da](https://github.com/ruby-git/ruby-git/commit/1de27daabed18b47a42539fe69b735d8ee90cbbb))
31
+ * Internally create a Stash with non-deprecated initializer args ([8b9b9e2](https://github.com/ruby-git/ruby-git/commit/8b9b9e2f3b3fa525973785f642331317ade35936))
32
+ * Report correct line number in deprecation warnings ([cca0deb](https://github.com/ruby-git/ruby-git/commit/cca0debb4166c809af76f9dc586e4fd06e142d44))
33
+ * Un-deprecate Git::Diff methods ([761b6ff](https://github.com/ruby-git/ruby-git/commit/761b6ffcd363f4329a9cbafbf1379513a19ff174))
34
+
35
+
36
+ ### Other Changes
37
+
38
+ * Make tests that emit a deprecation warning fail ([7e211d7](https://github.com/ruby-git/ruby-git/commit/7e211d7b2b7cc8d9da4a860361bef52280a5e73b))
39
+ * Update all tests to not use deprecated features ([33ab0e2](https://github.com/ruby-git/ruby-git/commit/33ab0e255e229e22d84b14a4d4f5fb829c1fe37c))
40
+
8
41
  ## [4.0.2](https://github.com/ruby-git/ruby-git/compare/v4.0.1...v4.0.2) (2025-07-08)
9
42
 
10
43
 
data/lib/git/diff.rb CHANGED
@@ -38,38 +38,31 @@ module Git
38
38
  @full_diff_files.map { |file| file[1] }.each(&)
39
39
  end
40
40
 
41
+ def size
42
+ stats_provider.total[:files]
43
+ end
44
+
41
45
  #
42
46
  # DEPRECATED METHODS
43
47
  #
44
48
 
45
49
  def name_status
46
- Git::Deprecation.warn('Git::Diff#name_status is deprecated. Use Git::Base#diff_path_status instead.')
47
50
  path_status_provider.to_h
48
51
  end
49
52
 
50
- def size
51
- Git::Deprecation.warn('Git::Diff#size is deprecated. Use Git::Base#diff_stats(...).total[:files] instead.')
52
- stats_provider.total[:files]
53
- end
54
-
55
53
  def lines
56
- Git::Deprecation.warn('Git::Diff#lines is deprecated. Use Git::Base#diff_stats(...).lines instead.')
57
54
  stats_provider.lines
58
55
  end
59
56
 
60
57
  def deletions
61
- Git::Deprecation.warn('Git::Diff#deletions is deprecated. Use Git::Base#diff_stats(...).deletions instead.')
62
58
  stats_provider.deletions
63
59
  end
64
60
 
65
61
  def insertions
66
- Git::Deprecation.warn('Git::Diff#insertions is deprecated. Use Git::Base#diff_stats(...).insertions instead.')
67
62
  stats_provider.insertions
68
63
  end
69
64
 
70
65
  def stats
71
- Git::Deprecation.warn('Git::Diff#stats is deprecated. Use Git::Base#diff_stats instead.')
72
- # CORRECTED: Re-create the original hash structure for backward compatibility
73
66
  {
74
67
  files: stats_provider.files,
75
68
  total: stats_provider.total
data/lib/git/log.rb CHANGED
@@ -90,28 +90,56 @@ module Git
90
90
 
91
91
  # @deprecated Use {#execute} and call `each` on the result.
92
92
  def each(&)
93
- deprecate_and_run
93
+ Git::Deprecation.warn(
94
+ 'Calling Git::Log#each is deprecated. Call #execute and then #each on the result object.'
95
+ )
96
+ run_log_if_dirty
94
97
  @commits.each(&)
95
98
  end
96
99
 
97
100
  # @deprecated Use {#execute} and call `size` on the result.
98
101
  def size
99
- deprecate_and_run
102
+ Git::Deprecation.warn(
103
+ 'Calling Git::Log#size is deprecated. Call #execute and then #size on the result object.'
104
+ )
105
+ run_log_if_dirty
100
106
  @commits&.size
101
107
  end
102
108
 
103
109
  # @deprecated Use {#execute} and call `to_s` on the result.
104
110
  def to_s
105
- deprecate_and_run
111
+ Git::Deprecation.warn(
112
+ 'Calling Git::Log#to_s is deprecated. Call #execute and then #to_s on the result object.'
113
+ )
114
+ run_log_if_dirty
106
115
  @commits&.map(&:to_s)&.join("\n")
107
116
  end
108
117
 
109
118
  # @deprecated Use {#execute} and call the method on the result.
110
- %i[first last []].each do |method_name|
111
- define_method(method_name) do |*args|
112
- deprecate_and_run
113
- @commits&.public_send(method_name, *args)
114
- end
119
+ def first
120
+ Git::Deprecation.warn(
121
+ 'Calling Git::Log#first is deprecated. Call #execute and then #first on the result object.'
122
+ )
123
+ run_log_if_dirty
124
+ @commits&.first
125
+ end
126
+
127
+ # @deprecated Use {#execute} and call the method on the result.
128
+ def last
129
+ Git::Deprecation.warn(
130
+ 'Calling Git::Log#last is deprecated. Call #execute and then #last on the result object.'
131
+ )
132
+ run_log_if_dirty
133
+ @commits&.last
134
+ end
135
+
136
+ # @deprecated Use {#execute} and call the method on the result.
137
+ def [](index)
138
+ Git::Deprecation.warn(
139
+ 'Calling Git::Log#[] is deprecated. Call #execute and then #[] on the result object.'
140
+ )
141
+ run_log_if_dirty
142
+ @commits&.[](index)
115
143
  end
116
144
 
117
145
  # @!endgroup
@@ -131,13 +159,5 @@ module Git
131
159
  @commits = log_data.map { |c| Git::Object::Commit.new(@base, c['sha'], c) }
132
160
  @dirty = false
133
161
  end
134
-
135
- def deprecate_and_run(method = caller_locations(1, 1)[0].label)
136
- Git::Deprecation.warn(
137
- "Calling Git::Log##{method} is deprecated. " \
138
- "Call #execute and then ##{method} on the result object."
139
- )
140
- run_log_if_dirty
141
- end
142
162
  end
143
163
  end
data/lib/git/path.rb CHANGED
@@ -9,17 +9,7 @@ module Git
9
9
  class Path
10
10
  attr_accessor :path
11
11
 
12
- def initialize(path, check_path = nil, must_exist: nil)
13
- unless check_path.nil?
14
- Git::Deprecation.warn(
15
- 'The "check_path" argument is deprecated and ' \
16
- 'will be removed in a future version. Use "must_exist:" instead.'
17
- )
18
- end
19
-
20
- # default is true
21
- must_exist = must_exist.nil? && check_path.nil? ? true : must_exist || check_path
22
-
12
+ def initialize(path, must_exist: true)
23
13
  path = File.expand_path(path)
24
14
 
25
15
  raise ArgumentError, 'path does not exist', [path] if must_exist && !File.exist?(path)
data/lib/git/stash.rb CHANGED
@@ -3,16 +3,7 @@
3
3
  module Git
4
4
  # A stash in a Git repository
5
5
  class Stash
6
- def initialize(base, message, existing = nil, save: nil)
7
- unless existing.nil?
8
- Git::Deprecation.warn(
9
- 'The "existing" argument is deprecated and will be removed in a future version. Use "save:" instead.'
10
- )
11
- end
12
-
13
- # default is false
14
- save = existing.nil? && save.nil? ? false : save | existing
15
-
6
+ def initialize(base, message, save: false)
16
7
  @base = base
17
8
  @message = message
18
9
  self.save unless save
data/lib/git/stashes.rb CHANGED
@@ -12,7 +12,7 @@ module Git
12
12
 
13
13
  @base.lib.stashes_all.each do |indexed_message|
14
14
  _index, message = indexed_message
15
- @stashes.unshift(Git::Stash.new(@base, message, true))
15
+ @stashes.unshift(Git::Stash.new(@base, message, save: true))
16
16
  end
17
17
  end
18
18
 
data/lib/git/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module Git
4
4
  # The current gem version
5
5
  # @return [String] the current gem version.
6
- VERSION = '4.0.2'
6
+ VERSION = '4.0.4'
7
7
  end
data/lib/git.rb CHANGED
@@ -4,7 +4,7 @@ require 'active_support'
4
4
  require 'active_support/deprecation'
5
5
 
6
6
  module Git
7
- Deprecation = ActiveSupport::Deprecation.new('3.0', 'Git')
7
+ Deprecation = ActiveSupport::Deprecation.new('5.0.0', 'Git')
8
8
  end
9
9
 
10
10
  require 'git/author'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon and others
@@ -281,8 +281,8 @@ licenses:
281
281
  metadata:
282
282
  homepage_uri: http://github.com/ruby-git/ruby-git
283
283
  source_code_uri: http://github.com/ruby-git/ruby-git
284
- changelog_uri: https://rubydoc.info/gems/git/4.0.2/file/CHANGELOG.md
285
- documentation_uri: https://rubydoc.info/gems/git/4.0.2
284
+ changelog_uri: https://rubydoc.info/gems/git/4.0.4/file/CHANGELOG.md
285
+ documentation_uri: https://rubydoc.info/gems/git/4.0.4
286
286
  rubygems_mfa_required: 'true'
287
287
  rdoc_options: []
288
288
  require_paths: