git 4.0.1 → 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 +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +46 -0
- data/README.md +25 -0
- data/Rakefile +2 -2
- data/lib/git/base.rb +1 -1
- data/lib/git/diff.rb +4 -11
- data/lib/git/log.rb +36 -16
- data/lib/git/path.rb +1 -11
- data/lib/git/stash.rb +1 -10
- data/lib/git/stashes.rb +1 -1
- data/lib/git/version.rb +1 -1
- data/lib/git.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53b8b74b8c2b17a44030a715fa6d562e989189b2c2b1b6a3195d349ed4cab439
|
4
|
+
data.tar.gz: 504029d354e4def312a520cc93ed0ac5857d02093405f776897d50c7f979ffb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29db48811be6a98b1096bfab4f5347aac762fcc03b9e232246cfb17e574f32a8d5c9d8444e32c242c1b7a30a777cd89b1498d58a7a7fde0c313bfd045f6a8b72
|
7
|
+
data.tar.gz: a9d24b3d5aca3a7f63856ce74808d562626992c7c023f51bb01f6167cc1b9ed425ba57ad0aecce0d3c4f77fec5138efbe5a502d512dfcc26bccf6e6004969137
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,52 @@
|
|
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
|
+
|
41
|
+
## [4.0.2](https://github.com/ruby-git/ruby-git/compare/v4.0.1...v4.0.2) (2025-07-08)
|
42
|
+
|
43
|
+
|
44
|
+
### Bug Fixes
|
45
|
+
|
46
|
+
* Call Git::Index#new correctly from initialize_components ([07dfab5](https://github.com/ruby-git/ruby-git/commit/07dfab5804874cbc52469bd40203b6d0b08be7a1))
|
47
|
+
|
48
|
+
|
49
|
+
### Other Changes
|
50
|
+
|
51
|
+
* Announce that the project has adopted RuboCop ([3d6cac9](https://github.com/ruby-git/ruby-git/commit/3d6cac94b47b3c1b1915f5c37f9e811041210ddc))
|
52
|
+
* Update comment to be accurate ([3a87722](https://github.com/ruby-git/ruby-git/commit/3a87722760176db54dfef9631de6191b183ab223))
|
53
|
+
|
8
54
|
## [4.0.1](https://github.com/ruby-git/ruby-git/compare/v4.0.0...v4.0.1) (2025-07-06)
|
9
55
|
|
10
56
|
|
data/README.md
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
[](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
|
12
12
|
[](https://conventionalcommits.org)
|
13
13
|
|
14
|
+
- [📢 We Now Use RuboCop 📢](#-we-now-use-rubocop-)
|
14
15
|
- [📢 Default Branch Rename 📢](#-default-branch-rename-)
|
15
16
|
- [📢 We've Switched to Conventional Commits 📢](#-weve-switched-to-conventional-commits-)
|
16
17
|
- [Summary](#summary)
|
@@ -23,6 +24,30 @@
|
|
23
24
|
- [Ruby version support policy](#ruby-version-support-policy)
|
24
25
|
- [License](#license)
|
25
26
|
|
27
|
+
## 📢 We Now Use RuboCop 📢
|
28
|
+
|
29
|
+
To improve code consistency and maintainability, the `ruby-git` project has now
|
30
|
+
adopted [RuboCop](https://rubocop.org/) as our static code analyzer and formatter.
|
31
|
+
|
32
|
+
This integration is a key part of our ongoing commitment to making `ruby-git` a
|
33
|
+
high-quality, stable, and easy-to-contribute-to project. All new contributions will
|
34
|
+
be expected to adhere to the style guidelines enforced by our RuboCop configuration.
|
35
|
+
|
36
|
+
RuboCop can be run from the project's Rakefile:
|
37
|
+
|
38
|
+
```shell
|
39
|
+
rake rubocop
|
40
|
+
```
|
41
|
+
|
42
|
+
RuboCop is also run as part of the default rake task (by running `rake`) that is run
|
43
|
+
in our Continuous Integration workflow.
|
44
|
+
|
45
|
+
Going forward, any PRs that have any Robocop offenses will not be merged. In
|
46
|
+
certain rare cases, it might be acceptable to disable a RuboCop check for the most
|
47
|
+
limited scope possible.
|
48
|
+
|
49
|
+
If you have a problem fixing a RuboCop offense, don't be afraid to ask a contributor.
|
50
|
+
|
26
51
|
## 📢 Default Branch Rename 📢
|
27
52
|
|
28
53
|
On June 6th, 2025, the default branch was renamed from 'master' to 'main'.
|
data/Rakefile
CHANGED
@@ -14,9 +14,9 @@ task :test do
|
|
14
14
|
# You can run individual test files (or multiple files) from the command
|
15
15
|
# line with:
|
16
16
|
#
|
17
|
-
# $ bin/test
|
17
|
+
# $ bin/test test_archive.rb
|
18
18
|
#
|
19
|
-
# $ bin/test
|
19
|
+
# $ bin/test test_archive.rb test_object.rb
|
20
20
|
end
|
21
21
|
default_tasks << :test
|
22
22
|
|
data/lib/git/base.rb
CHANGED
@@ -851,7 +851,7 @@ module Git
|
|
851
851
|
def initialize_components(options)
|
852
852
|
@working_directory = Git::WorkingDirectory.new(options[:working_directory]) if options[:working_directory]
|
853
853
|
@repository = Git::Repository.new(options[:repository]) if options[:repository]
|
854
|
-
@index = Git::Index.new(options[:index], false) if options[:index]
|
854
|
+
@index = Git::Index.new(options[:index], must_exist: false) if options[:index]
|
855
855
|
end
|
856
856
|
|
857
857
|
# Normalize options before they are sent to Git::Base.new
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
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,
|
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,
|
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
data/lib/git/version.rb
CHANGED
data/lib/git.rb
CHANGED
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.
|
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.
|
285
|
-
documentation_uri: https://rubydoc.info/gems/git/4.0.
|
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:
|