git 5.0.1 → 5.0.3
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/.claude/commands/address-copilot-reviews.md +14 -0
- data/.claude/settings.json +16 -0
- data/.claude/skills +1 -0
- data/.github/copilot-instructions.md +0 -12
- data/.github/hooks/run-bin-setup-once.sh +9 -3
- data/.github/pull_request_template.md +2 -0
- data/.github/skills/command-implementation/REFERENCE.md +1 -1
- data/.github/skills/command-implementation/SKILL.md +2 -2
- data/.github/skills/facade-implementation/SKILL.md +2 -2
- data/.github/skills/rspec-unit-testing-standards/SKILL.md +52 -6
- data/.github/workflows/continuous_integration.yml +12 -0
- data/.gitignore +6 -0
- data/.release-please-manifest.json +1 -1
- data/.rspec +0 -1
- data/CHANGELOG.md +59 -0
- data/CLAUDE.md +11 -0
- data/CONTRIBUTING.md +295 -153
- data/README.md +8 -3
- data/Rakefile +2 -13
- data/git.gemspec +17 -5
- data/lib/git/commands/arguments.rb +2 -2
- data/lib/git/commands/remote/remove.rb +3 -5
- data/lib/git/commands/remote/rename.rb +7 -2
- data/lib/git/factories.rb +813 -0
- data/lib/git/parsers/diff.rb +2 -3
- data/lib/git/parsers/grep.rb +1 -1
- data/lib/git/path_resolver.rb +206 -0
- data/lib/git/repository.rb +0 -1
- data/lib/git/version.rb +1 -1
- data/lib/git.rb +2 -1
- data/tasks/rspec.rake +93 -30
- metadata +13 -9
- data/lib/git/repository/factories.rb +0 -814
- data/lib/git/repository/path_resolver.rb +0 -207
data/README.md
CHANGED
|
@@ -6,14 +6,19 @@
|
|
|
6
6
|
# The Git Gem
|
|
7
7
|
|
|
8
8
|
[](https://badge.fury.io/rb/git)
|
|
9
|
+
[](https://github.com/ruby-git/ruby-git/actions/workflows/continuous_integration.yml)
|
|
9
10
|
[](https://rubydoc.info/gems/git/)
|
|
10
11
|
[](https://rubydoc.info/gems/git/file/CHANGELOG.md)
|
|
12
|
-
[](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
|
|
14
13
|
[](https://conventionalcommits.org)
|
|
16
|
-
[](AI_POLICY.md)
|
|
16
|
+
[](LICENSE)
|
|
17
|
+
|
|
18
|
+
> **v5.0.0 is here.** This is a major release with a redesigned internal
|
|
19
|
+
> architecture, but most v4.x code runs unchanged thanks to compatibility
|
|
20
|
+
> shims. See [UPGRADING.md](UPGRADING.md) for the migration guide and
|
|
21
|
+
> [CHANGELOG.md](CHANGELOG.md) for full release notes.
|
|
17
22
|
|
|
18
23
|
- [Summary](#summary)
|
|
19
24
|
- [Install](#install)
|
data/Rakefile
CHANGED
|
@@ -9,19 +9,8 @@ default_tasks = %i[spec:unit spec:integration rubocop]
|
|
|
9
9
|
default_tasks << :yard if Rake::Task.task_defined?(:yard)
|
|
10
10
|
default_tasks << :build
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
default_tasks_parallel << :build
|
|
15
|
-
|
|
16
|
-
# Use parallel test execution for MRI where it cuts build times by 30-48%.
|
|
17
|
-
# JRuby and TruffleRuby are slower with parallel_tests because each worker
|
|
18
|
-
# process pays JVM/Truffle startup and warm-up overhead independently,
|
|
19
|
-
# resulting in 18-28% slower builds vs. serial execution.
|
|
20
|
-
parallel_supported = RUBY_ENGINE == 'ruby'
|
|
21
|
-
task default: parallel_supported ? default_tasks_parallel : default_tasks
|
|
22
|
-
|
|
23
|
-
desc 'Same as default but runs tests in parallel'
|
|
24
|
-
task 'default:parallel': default_tasks_parallel
|
|
12
|
+
desc 'Run all CI tasks (tests, linters, yard, and build)'
|
|
13
|
+
task default: default_tasks
|
|
25
14
|
|
|
26
15
|
module Rake
|
|
27
16
|
# Overload Rake::Task to add logging
|
data/git.gemspec
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
# Read the version out of lib/git/version.rb rather than requiring it.
|
|
4
|
+
#
|
|
5
|
+
# The Gemfile uses `gemspec`, so Bundler evaluates this file on every `bundle exec`.
|
|
6
|
+
# `require`ing lib/git/version.rb here would therefore load it before SimpleCov
|
|
7
|
+
# starts in spec_helper, leaving it invisible to the coverage report -- an
|
|
8
|
+
# unmeasured hole in the 100% coverage gate. See the "Test coverage policy" section
|
|
9
|
+
# of CONTRIBUTING.md.
|
|
10
|
+
#
|
|
11
|
+
# release-please rewrites the `VERSION = '...'` assignment in place (see
|
|
12
|
+
# `version-file` in .release-please-config.json), so matching on it stays correct
|
|
13
|
+
# across releases. If the match ever fails, the raise below stops the build
|
|
14
|
+
# immediately rather than letting a nil version reach the specification.
|
|
15
|
+
version = File.read(File.expand_path('lib/git/version.rb', __dir__))[/^\s*VERSION\s*=\s*['"]([^'"]+)['"]/, 1]
|
|
16
|
+
raise 'Could not determine Git::VERSION from lib/git/version.rb' if version.nil?
|
|
5
17
|
|
|
6
18
|
Gem::Specification.new do |spec|
|
|
7
19
|
spec.author = 'Scott Chacon and others'
|
|
@@ -17,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
|
17
29
|
including branching and merging, object inspection and manipulation, history, patch
|
|
18
30
|
generation and more.
|
|
19
31
|
DESCRIPTION
|
|
20
|
-
spec.version =
|
|
32
|
+
spec.version = version
|
|
21
33
|
|
|
22
34
|
spec.metadata['homepage_uri'] = spec.homepage
|
|
23
35
|
spec.metadata['source_code_uri'] = spec.homepage
|
|
@@ -41,9 +53,9 @@ Gem::Specification.new do |spec|
|
|
|
41
53
|
spec.add_development_dependency 'rake', '~> 13.3'
|
|
42
54
|
spec.add_development_dependency 'rspec', '~> 3.13'
|
|
43
55
|
spec.add_development_dependency 'rubocop', '~> 1.82'
|
|
44
|
-
spec.add_development_dependency 'simplecov', '~> 0
|
|
56
|
+
spec.add_development_dependency 'simplecov', '~> 1.0'
|
|
45
57
|
spec.add_development_dependency 'simplecov-lcov', '~> 0.9'
|
|
46
|
-
spec.add_development_dependency 'simplecov-rspec', '~>
|
|
58
|
+
spec.add_development_dependency 'simplecov-rspec', '~> 1.1'
|
|
47
59
|
|
|
48
60
|
if RUBY_ENGINE == 'truffleruby' && Gem::Version.new(RUBY_ENGINE_VERSION) < Gem::Version.new('34.0.0')
|
|
49
61
|
# i18n 1.15+ uses Fiber.[] (Ruby 3.2 Fiber storage) which TruffleRuby < 34.0.0 does not implement
|
|
@@ -2399,11 +2399,11 @@ module Git
|
|
|
2399
2399
|
build_option(args, entry[:name], @option_definitions[entry[:name]], normalized_opts[entry[:name]])
|
|
2400
2400
|
when :operand
|
|
2401
2401
|
build_single_positional(args, entry[:name], allocated_positionals)
|
|
2402
|
-
# :
|
|
2402
|
+
# simplecov:disable this case should be unreachable
|
|
2403
2403
|
else
|
|
2404
2404
|
raise ArgumentError, "unknown entry kind: #{entry[:kind].inspect}"
|
|
2405
2405
|
end
|
|
2406
|
-
# :
|
|
2406
|
+
# simplecov:enable
|
|
2407
2407
|
end
|
|
2408
2408
|
|
|
2409
2409
|
# Replace the END_OF_OPTIONS_MARKER with the stored `as:` value if any element
|
|
@@ -13,9 +13,9 @@ module Git
|
|
|
13
13
|
# remove = Git::Commands::Remote::Remove.new(execution_context)
|
|
14
14
|
# remove.call('origin')
|
|
15
15
|
#
|
|
16
|
-
# @
|
|
17
|
-
#
|
|
18
|
-
#
|
|
16
|
+
# @note No `end_of_options` boundary: `git remote remove` did not accept a `--`
|
|
17
|
+
# separator until git 2.38.0, so a name that looks like a flag (e.g. `-weird`)
|
|
18
|
+
# raises `ArgumentError` instead of being sent to git.
|
|
19
19
|
#
|
|
20
20
|
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
21
21
|
#
|
|
@@ -30,8 +30,6 @@ module Git
|
|
|
30
30
|
literal 'remote'
|
|
31
31
|
literal 'remove'
|
|
32
32
|
|
|
33
|
-
end_of_options
|
|
34
|
-
|
|
35
33
|
operand :name, required: true
|
|
36
34
|
end
|
|
37
35
|
|
|
@@ -22,6 +22,13 @@ module Git
|
|
|
22
22
|
# rename = Git::Commands::Remote::Rename.new(execution_context)
|
|
23
23
|
# rename.call('origin', 'upstream', no_progress: true)
|
|
24
24
|
#
|
|
25
|
+
# @note No `end_of_options` boundary despite `:progress` preceding the operands:
|
|
26
|
+
# `git remote rename` did not accept a `--` separator until git 2.36.0. Since
|
|
27
|
+
# the `old`/`new` operands are still validated (an operand is rejected as
|
|
28
|
+
# option-like whenever no `--` boundary exists anywhere in the definition),
|
|
29
|
+
# a name that looks like a flag (e.g. `-weird`) raises `ArgumentError` instead
|
|
30
|
+
# of ever reaching git, so omitting the boundary introduces no ambiguity.
|
|
31
|
+
#
|
|
25
32
|
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
26
33
|
#
|
|
27
34
|
# @see Git::Commands::Remote
|
|
@@ -36,8 +43,6 @@ module Git
|
|
|
36
43
|
literal 'rename'
|
|
37
44
|
flag_option :progress, negatable: true
|
|
38
45
|
|
|
39
|
-
end_of_options
|
|
40
|
-
|
|
41
46
|
operand :old, required: true
|
|
42
47
|
operand :new, required: true
|
|
43
48
|
end
|