git 4.0.0 → 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/.gitignore +1 -0
- data/.release-please-manifest.json +1 -1
- data/.rubocop.yml +51 -0
- data/.rubocop_todo.yml +12 -0
- data/CHANGELOG.md +90 -0
- data/README.md +25 -0
- data/Rakefile +15 -3
- data/git.gemspec +35 -30
- data/lib/git/args_builder.rb +103 -0
- data/lib/git/author.rb +6 -5
- data/lib/git/base.rb +254 -165
- data/lib/git/branch.rb +14 -15
- data/lib/git/branches.rb +9 -13
- data/lib/git/command_line.rb +97 -55
- data/lib/git/config.rb +4 -6
- data/lib/git/diff.rb +73 -44
- data/lib/git/diff_path_status.rb +4 -3
- data/lib/git/diff_stats.rb +1 -1
- data/lib/git/errors.rb +8 -2
- data/lib/git/escaped_path.rb +1 -1
- data/lib/git/lib.rb +865 -557
- data/lib/git/log.rb +90 -206
- data/lib/git/object.rb +85 -66
- data/lib/git/path.rb +9 -9
- data/lib/git/remote.rb +3 -4
- data/lib/git/repository.rb +0 -2
- data/lib/git/stash.rb +5 -7
- data/lib/git/stashes.rb +6 -6
- data/lib/git/status.rb +108 -247
- data/lib/git/url.rb +3 -3
- data/lib/git/version.rb +1 -1
- data/lib/git/worktree.rb +4 -5
- data/lib/git/worktrees.rb +4 -6
- data/lib/git.rb +17 -16
- metadata +35 -3
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('
|
7
|
+
Deprecation = ActiveSupport::Deprecation.new('5.0.0', 'Git')
|
8
8
|
end
|
9
9
|
|
10
10
|
require 'git/author'
|
@@ -42,16 +42,16 @@ require 'git/worktrees'
|
|
42
42
|
# @author Scott Chacon (mailto:schacon@gmail.com)
|
43
43
|
#
|
44
44
|
module Git
|
45
|
-
#g.config('user.name', 'Scott Chacon') # sets value
|
46
|
-
#g.config('user.email', 'email@email.com') # sets value
|
47
|
-
#g.config('user.name') # returns 'Scott Chacon'
|
48
|
-
#g.config # returns whole config hash
|
45
|
+
# g.config('user.name', 'Scott Chacon') # sets value
|
46
|
+
# g.config('user.email', 'email@email.com') # sets value
|
47
|
+
# g.config('user.name') # returns 'Scott Chacon'
|
48
|
+
# g.config # returns whole config hash
|
49
49
|
def config(name = nil, value = nil)
|
50
50
|
lib = Git::Lib.new
|
51
|
-
if
|
51
|
+
if name && value
|
52
52
|
# set value
|
53
53
|
lib.config_set(name, value)
|
54
|
-
elsif
|
54
|
+
elsif name
|
55
55
|
# return value
|
56
56
|
lib.config_get(name)
|
57
57
|
else
|
@@ -191,7 +191,7 @@ module Git
|
|
191
191
|
# of the cloned local working copy or cloned repository.
|
192
192
|
#
|
193
193
|
def self.clone(repository_url, directory = nil, options = {})
|
194
|
-
clone_to_options = options.
|
194
|
+
clone_to_options = options.slice(:bare, :mirror)
|
195
195
|
directory ||= Git::URL.clone_to(repository_url, **clone_to_options)
|
196
196
|
Base.clone(repository_url, directory, options)
|
197
197
|
end
|
@@ -216,7 +216,8 @@ module Git
|
|
216
216
|
# @example with the logging option
|
217
217
|
# logger = Logger.new(STDOUT, level: Logger::INFO)
|
218
218
|
# Git.default_branch('.', log: logger) # => 'master'
|
219
|
-
# I, [2022-04-13T16:01:33.221596 #18415] INFO -- : git '-c' 'core.quotePath=true'
|
219
|
+
# I, [2022-04-13T16:01:33.221596 #18415] INFO -- : git '-c' 'core.quotePath=true'
|
220
|
+
# '-c' 'color.ui=false' ls-remote '--symref' '--' '.' 'HEAD' 2>&1
|
220
221
|
#
|
221
222
|
# @param repository [URI, Pathname, String] The (possibly remote) repository to get the default branch name for
|
222
223
|
#
|
@@ -245,23 +246,23 @@ module Git
|
|
245
246
|
# remote, 'origin.'
|
246
247
|
def self.export(repository, name, options = {})
|
247
248
|
options.delete(:remote)
|
248
|
-
repo = clone(repository, name, {:
|
249
|
+
repo = clone(repository, name, { depth: 1 }.merge(options))
|
249
250
|
repo.checkout("origin/#{options[:branch]}") if options[:branch]
|
250
251
|
FileUtils.rm_r File.join(repo.dir.to_s, '.git')
|
251
252
|
end
|
252
253
|
|
253
254
|
# Same as g.config, but forces it to be at the global level
|
254
255
|
#
|
255
|
-
#g.config('user.name', 'Scott Chacon') # sets value
|
256
|
-
#g.config('user.email', 'email@email.com') # sets value
|
257
|
-
#g.config('user.name') # returns 'Scott Chacon'
|
258
|
-
#g.config # returns whole config hash
|
256
|
+
# g.config('user.name', 'Scott Chacon') # sets value
|
257
|
+
# g.config('user.email', 'email@email.com') # sets value
|
258
|
+
# g.config('user.name') # returns 'Scott Chacon'
|
259
|
+
# g.config # returns whole config hash
|
259
260
|
def self.global_config(name = nil, value = nil)
|
260
261
|
lib = Git::Lib.new(nil, nil)
|
261
|
-
if
|
262
|
+
if name && value
|
262
263
|
# set value
|
263
264
|
lib.global_config_set(name, value)
|
264
|
-
elsif
|
265
|
+
elsif name
|
265
266
|
# return value
|
266
267
|
lib.global_config_get(name)
|
267
268
|
else
|
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
|
@@ -79,6 +79,20 @@ dependencies:
|
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '2.1'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: main_branch_shared_rubocop_config
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0.1'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.1'
|
82
96
|
- !ruby/object:Gem::Dependency
|
83
97
|
name: minitar
|
84
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,6 +135,20 @@ dependencies:
|
|
121
135
|
- - "~>"
|
122
136
|
- !ruby/object:Gem::Version
|
123
137
|
version: '13.2'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: rubocop
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '1.77'
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '1.77'
|
124
152
|
- !ruby/object:Gem::Dependency
|
125
153
|
name: test-unit
|
126
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,6 +232,8 @@ files:
|
|
204
232
|
- ".gitignore"
|
205
233
|
- ".husky/commit-msg"
|
206
234
|
- ".release-please-manifest.json"
|
235
|
+
- ".rubocop.yml"
|
236
|
+
- ".rubocop_todo.yml"
|
207
237
|
- ".yardopts"
|
208
238
|
- CHANGELOG.md
|
209
239
|
- CONTRIBUTING.md
|
@@ -214,6 +244,7 @@ files:
|
|
214
244
|
- Rakefile
|
215
245
|
- git.gemspec
|
216
246
|
- lib/git.rb
|
247
|
+
- lib/git/args_builder.rb
|
217
248
|
- lib/git/author.rb
|
218
249
|
- lib/git/base.rb
|
219
250
|
- lib/git/branch.rb
|
@@ -250,8 +281,9 @@ licenses:
|
|
250
281
|
metadata:
|
251
282
|
homepage_uri: http://github.com/ruby-git/ruby-git
|
252
283
|
source_code_uri: http://github.com/ruby-git/ruby-git
|
253
|
-
changelog_uri: https://rubydoc.info/gems/git/4.0.
|
254
|
-
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
|
+
rubygems_mfa_required: 'true'
|
255
287
|
rdoc_options: []
|
256
288
|
require_paths:
|
257
289
|
- lib
|