git 1.19.1 → 2.0.0

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.
data/lib/git/object.rb CHANGED
@@ -1,16 +1,18 @@
1
+ require 'git/author'
2
+ require 'git/diff'
3
+ require 'git/errors'
4
+ require 'git/log'
5
+
1
6
  module Git
2
-
3
- class GitTagNameDoesNotExist< StandardError
4
- end
5
-
7
+
6
8
  # represents a git object
7
9
  class Object
8
-
10
+
9
11
  class AbstractObject
10
12
  attr_accessor :objectish, :type, :mode
11
13
 
12
14
  attr_writer :size
13
-
15
+
14
16
  def initialize(base, objectish)
15
17
  @base = base
16
18
  @objectish = objectish.to_s
@@ -23,11 +25,11 @@ module Git
23
25
  def sha
24
26
  @sha ||= @base.lib.revparse(@objectish)
25
27
  end
26
-
28
+
27
29
  def size
28
30
  @size ||= @base.lib.object_size(@objectish)
29
31
  end
30
-
32
+
31
33
  # Get the object's contents.
32
34
  # If no block is given, the contents are cached in memory and returned as a string.
33
35
  # If a block is given, it yields an IO object (via IO::popen) which could be used to
@@ -41,108 +43,108 @@ module Git
41
43
  @contents ||= @base.lib.object_contents(@objectish)
42
44
  end
43
45
  end
44
-
46
+
45
47
  def contents_array
46
48
  self.contents.split("\n")
47
49
  end
48
-
50
+
49
51
  def to_s
50
52
  @objectish
51
53
  end
52
-
54
+
53
55
  def grep(string, path_limiter = nil, opts = {})
54
56
  opts = {:object => sha, :path_limiter => path_limiter}.merge(opts)
55
57
  @base.lib.grep(string, opts)
56
58
  end
57
-
59
+
58
60
  def diff(objectish)
59
61
  Git::Diff.new(@base, @objectish, objectish)
60
62
  end
61
-
63
+
62
64
  def log(count = 30)
63
65
  Git::Log.new(@base, count).object(@objectish)
64
66
  end
65
-
67
+
66
68
  # creates an archive of this object (tree)
67
69
  def archive(file = nil, opts = {})
68
70
  @base.lib.archive(@objectish, file, opts)
69
71
  end
70
-
72
+
71
73
  def tree?; false; end
72
-
74
+
73
75
  def blob?; false; end
74
-
76
+
75
77
  def commit?; false; end
76
78
 
77
79
  def tag?; false; end
78
-
80
+
79
81
  end
80
-
81
-
82
+
83
+
82
84
  class Blob < AbstractObject
83
-
85
+
84
86
  def initialize(base, sha, mode = nil)
85
87
  super(base, sha)
86
88
  @mode = mode
87
89
  end
88
-
90
+
89
91
  def blob?
90
92
  true
91
93
  end
92
94
 
93
95
  end
94
-
96
+
95
97
  class Tree < AbstractObject
96
-
98
+
97
99
  def initialize(base, sha, mode = nil)
98
100
  super(base, sha)
99
101
  @mode = mode
100
102
  @trees = nil
101
103
  @blobs = nil
102
104
  end
103
-
105
+
104
106
  def children
105
107
  blobs.merge(subtrees)
106
108
  end
107
-
109
+
108
110
  def blobs
109
111
  @blobs ||= check_tree[:blobs]
110
112
  end
111
113
  alias_method :files, :blobs
112
-
114
+
113
115
  def trees
114
116
  @trees ||= check_tree[:trees]
115
117
  end
116
118
  alias_method :subtrees, :trees
117
119
  alias_method :subdirectories, :trees
118
-
120
+
119
121
  def full_tree
120
122
  @base.lib.full_tree(@objectish)
121
123
  end
122
-
124
+
123
125
  def depth
124
126
  @base.lib.tree_depth(@objectish)
125
127
  end
126
-
128
+
127
129
  def tree?
128
130
  true
129
131
  end
130
-
132
+
131
133
  private
132
134
 
133
135
  # actually run the git command
134
136
  def check_tree
135
137
  @trees = {}
136
138
  @blobs = {}
137
-
139
+
138
140
  data = @base.lib.ls_tree(@objectish)
139
141
 
140
- data['tree'].each do |key, tree|
141
- @trees[key] = Git::Object::Tree.new(@base, tree[:sha], tree[:mode])
142
+ data['tree'].each do |key, tree|
143
+ @trees[key] = Git::Object::Tree.new(@base, tree[:sha], tree[:mode])
142
144
  end
143
-
144
- data['blob'].each do |key, blob|
145
- @blobs[key] = Git::Object::Blob.new(@base, blob[:sha], blob[:mode])
145
+
146
+ data['blob'].each do |key, blob|
147
+ @blobs[key] = Git::Object::Blob.new(@base, blob[:sha], blob[:mode])
146
148
  end
147
149
 
148
150
  {
@@ -150,11 +152,11 @@ module Git
150
152
  :blobs => @blobs
151
153
  }
152
154
  end
153
-
155
+
154
156
  end
155
-
157
+
156
158
  class Commit < AbstractObject
157
-
159
+
158
160
  def initialize(base, sha, init = nil)
159
161
  super(base, sha)
160
162
  @tree = nil
@@ -166,48 +168,48 @@ module Git
166
168
  set_commit(init)
167
169
  end
168
170
  end
169
-
171
+
170
172
  def message
171
173
  check_commit
172
174
  @message
173
175
  end
174
-
176
+
175
177
  def name
176
178
  @base.lib.namerev(sha)
177
179
  end
178
-
180
+
179
181
  def gtree
180
182
  check_commit
181
183
  Tree.new(@base, @tree)
182
184
  end
183
-
185
+
184
186
  def parent
185
187
  parents.first
186
188
  end
187
-
189
+
188
190
  # array of all parent commits
189
191
  def parents
190
192
  check_commit
191
- @parents
193
+ @parents
192
194
  end
193
-
195
+
194
196
  # git author
195
- def author
197
+ def author
196
198
  check_commit
197
199
  @author
198
200
  end
199
-
201
+
200
202
  def author_date
201
203
  author.date
202
204
  end
203
-
205
+
204
206
  # git author
205
207
  def committer
206
208
  check_commit
207
209
  @committer
208
210
  end
209
-
210
- def committer_date
211
+
212
+ def committer_date
211
213
  committer.date
212
214
  end
213
215
  alias_method :date, :committer_date
@@ -215,7 +217,7 @@ module Git
215
217
  def diff_parent
216
218
  diff(parent)
217
219
  end
218
-
220
+
219
221
  def set_commit(data)
220
222
  @sha ||= data['sha']
221
223
  @committer = Git::Author.new(data['committer'])
@@ -224,26 +226,26 @@ module Git
224
226
  @parents = data['parent'].map{ |sha| Git::Object::Commit.new(@base, sha) }
225
227
  @message = data['message'].chomp
226
228
  end
227
-
229
+
228
230
  def commit?
229
231
  true
230
232
  end
231
233
 
232
234
  private
233
-
235
+
234
236
  # see if this object has been initialized and do so if not
235
237
  def check_commit
236
238
  return if @tree
237
-
239
+
238
240
  data = @base.lib.commit_data(@objectish)
239
241
  set_commit(data)
240
242
  end
241
-
243
+
242
244
  end
243
-
245
+
244
246
  class Tag < AbstractObject
245
247
  attr_accessor :name
246
-
248
+
247
249
  def initialize(base, sha, name)
248
250
  super(base, sha)
249
251
  @name = name
@@ -259,7 +261,7 @@ module Git
259
261
  check_tag()
260
262
  return @message
261
263
  end
262
-
264
+
263
265
  def tag?
264
266
  true
265
267
  end
@@ -274,7 +276,7 @@ module Git
274
276
  def check_tag
275
277
  return if @loaded
276
278
 
277
- if !self.annotated?
279
+ if !self.annotated?
278
280
  @message = @tagger = nil
279
281
  else
280
282
  tdata = @base.lib.tag_data(@name)
@@ -284,29 +286,29 @@ module Git
284
286
 
285
287
  @loaded = true
286
288
  end
287
-
289
+
288
290
  end
289
-
291
+
290
292
  # if we're calling this, we don't know what type it is yet
291
293
  # so this is our little factory method
292
294
  def self.new(base, objectish, type = nil, is_tag = false)
293
295
  if is_tag
294
296
  sha = base.lib.tag_sha(objectish)
295
297
  if sha == ''
296
- raise Git::GitTagNameDoesNotExist.new(objectish)
298
+ raise Git::UnexpectedResultError.new("Tag '#{objectish}' does not exist.")
297
299
  end
298
300
  return Git::Object::Tag.new(base, sha, objectish)
299
301
  end
300
-
302
+
301
303
  type ||= base.lib.object_type(objectish)
302
304
  klass =
303
305
  case type
304
- when /blob/ then Blob
306
+ when /blob/ then Blob
305
307
  when /commit/ then Commit
306
308
  when /tree/ then Tree
307
309
  end
308
310
  klass.new(base, objectish)
309
311
  end
310
-
312
+
311
313
  end
312
314
  end
data/lib/git/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  # The current gem version
3
3
  # @return [String] the current gem version.
4
- VERSION='1.19.1'
4
+ VERSION='2.0.0'
5
5
  end
data/lib/git.rb CHANGED
@@ -1,19 +1,21 @@
1
- # Add the directory containing this file to the start of the load path if it
2
- # isn't there already.
3
- $:.unshift(File.dirname(__FILE__)) unless
4
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
1
+ require 'active_support'
2
+ require 'active_support/deprecation'
3
+
4
+ module Git
5
+ Deprecation = ActiveSupport::Deprecation.new('3.0', 'Git')
6
+ end
5
7
 
6
8
  require 'git/author'
7
9
  require 'git/base'
8
10
  require 'git/branch'
9
11
  require 'git/branches'
10
12
  require 'git/command_line_result'
13
+ require 'git/command_line'
11
14
  require 'git/config'
12
15
  require 'git/diff'
13
16
  require 'git/encoding_utils'
17
+ require 'git/errors'
14
18
  require 'git/escaped_path'
15
- require 'git/failed_error'
16
- require 'git/git_execute_error'
17
19
  require 'git/index'
18
20
  require 'git/lib'
19
21
  require 'git/log'
@@ -21,7 +23,6 @@ require 'git/object'
21
23
  require 'git/path'
22
24
  require 'git/remote'
23
25
  require 'git/repository'
24
- require 'git/signaled_error'
25
26
  require 'git/status'
26
27
  require 'git/stash'
27
28
  require 'git/stashes'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon and others
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-13 00:00:00.000000000 Z
11
+ date: 2024-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: addressable
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,47 +39,47 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: '2.8'
27
41
  - !ruby/object:Gem::Dependency
28
- name: rchardet
42
+ name: process_executer
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '1.8'
47
+ version: '1.1'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '1.8'
54
+ version: '1.1'
41
55
  - !ruby/object:Gem::Dependency
42
- name: bump
56
+ name: rchardet
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '0.10'
48
- type: :development
61
+ version: '1.8'
62
+ type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '0.10'
68
+ version: '1.8'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: create_github_release
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0.2'
75
+ version: '1.4'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0.2'
82
+ version: '1.4'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: minitar
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,42 +114,42 @@ dependencies:
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '13.0'
117
+ version: '13.1'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: '13.0'
124
+ version: '13.1'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: test-unit
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
129
  - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: '3.3'
131
+ version: '3.6'
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: '3.3'
138
+ version: '3.6'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: redcarpet
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
143
  - - "~>"
130
144
  - !ruby/object:Gem::Version
131
- version: '3.5'
145
+ version: '3.6'
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
- version: '3.5'
152
+ version: '3.6'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: yard
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -181,18 +195,17 @@ executables: []
181
195
  extensions: []
182
196
  extra_rdoc_files: []
183
197
  files:
184
- - ".github/stale.yml"
198
+ - ".github/issue_template.md"
199
+ - ".github/pull_request_template.md"
185
200
  - ".github/workflows/continuous_integration.yml"
201
+ - ".github/workflows/experimental_continuous_integration.yml"
186
202
  - ".gitignore"
187
203
  - ".yardopts"
188
204
  - CHANGELOG.md
189
205
  - CONTRIBUTING.md
190
- - Dockerfile.changelog-rs
191
206
  - Gemfile
192
- - ISSUE_TEMPLATE.md
193
207
  - LICENSE
194
208
  - MAINTAINERS.md
195
- - PULL_REQUEST_TEMPLATE.md
196
209
  - README.md
197
210
  - RELEASING.md
198
211
  - Rakefile
@@ -203,13 +216,13 @@ files:
203
216
  - lib/git/base/factory.rb
204
217
  - lib/git/branch.rb
205
218
  - lib/git/branches.rb
219
+ - lib/git/command_line.rb
206
220
  - lib/git/command_line_result.rb
207
221
  - lib/git/config.rb
208
222
  - lib/git/diff.rb
209
223
  - lib/git/encoding_utils.rb
224
+ - lib/git/errors.rb
210
225
  - lib/git/escaped_path.rb
211
- - lib/git/failed_error.rb
212
- - lib/git/git_execute_error.rb
213
226
  - lib/git/index.rb
214
227
  - lib/git/lib.rb
215
228
  - lib/git/log.rb
@@ -217,7 +230,6 @@ files:
217
230
  - lib/git/path.rb
218
231
  - lib/git/remote.rb
219
232
  - lib/git/repository.rb
220
- - lib/git/signaled_error.rb
221
233
  - lib/git/stash.rb
222
234
  - lib/git/stashes.rb
223
235
  - lib/git/status.rb
@@ -232,8 +244,8 @@ licenses:
232
244
  metadata:
233
245
  homepage_uri: http://github.com/ruby-git/ruby-git
234
246
  source_code_uri: http://github.com/ruby-git/ruby-git
235
- changelog_uri: https://rubydoc.info/gems/git/1.19.1/file/CHANGELOG.md
236
- documentation_uri: https://rubydoc.info/gems/git/1.19.1
247
+ changelog_uri: https://rubydoc.info/gems/git/2.0.0/file/CHANGELOG.md
248
+ documentation_uri: https://rubydoc.info/gems/git/2.0.0
237
249
  post_install_message:
238
250
  rdoc_options: []
239
251
  require_paths:
@@ -242,15 +254,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
254
  requirements:
243
255
  - - ">="
244
256
  - !ruby/object:Gem::Version
245
- version: '2.3'
257
+ version: 3.0.0
246
258
  required_rubygems_version: !ruby/object:Gem::Requirement
247
259
  requirements:
248
260
  - - ">="
249
261
  - !ruby/object:Gem::Version
250
262
  version: '0'
251
263
  requirements:
252
- - git 1.6.0.0, or greater
253
- rubygems_version: 3.5.3
264
+ - git 2.28.0 or greater
265
+ rubygems_version: 3.5.9
254
266
  signing_key:
255
267
  specification_version: 4
256
268
  summary: An API to create, read, and manipulate Git repositories
data/.github/stale.yml DELETED
@@ -1,25 +0,0 @@
1
- # Probot: Stale
2
- # https://github.com/probot/stale
3
-
4
- # Number of days of inactivity before an issue becomes stale
5
- daysUntilStale: 60
6
-
7
- # Number of days of inactivity before a stale issue is closed
8
- # Set to false to disable. If disabled, issues still need to be closed
9
- # manually, but will remain marked as stale.
10
- daysUntilClose: false
11
-
12
- # Issues with these labels will never be considered stale
13
- exemptLabels:
14
- - pinned
15
- - security
16
-
17
- # Label to use when marking an issue as stale
18
- staleLabel: stale
19
-
20
- # Comment to post when marking an issue as stale. Set to `false` to disable
21
- markComment: >
22
- A friendly reminder that this issue had no activity for 60 days.
23
-
24
- # Comment to post when closing a stale issue. Set to `false` to disable
25
- closeComment: false
@@ -1,12 +0,0 @@
1
- FROM rust
2
-
3
- # Build the docker image (from this project's root directory):
4
- # docker build --file Dockerfile.changelog-rs --tag changelog-rs .
5
- #
6
- # Use this image to output a changelog (from this project's root directory):
7
- # docker run --rm --volume "$PWD:/worktree" changelog-rs v1.9.1 v1.10.0
8
-
9
- RUN cargo install changelog-rs
10
- WORKDIR /worktree
11
-
12
- ENTRYPOINT ["/usr/local/cargo/bin/changelog-rs", "/worktree"]
@@ -1,9 +0,0 @@
1
- ### Your checklist for this pull request
2
- 🚨Please review the [guidelines for contributing](https://github.com/ruby-git/ruby-git/blob/master/CONTRIBUTING.md) to this repository.
3
-
4
- - [ ] Ensure all commits include DCO sign-off.
5
- - [ ] Ensure that your contributions pass unit testing.
6
- - [ ] Ensure that your contributions contain documentation if applicable.
7
-
8
- ### Description
9
- Please describe your pull request.