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.
data/README.md CHANGED
@@ -6,14 +6,19 @@
6
6
  # The Git Gem
7
7
 
8
8
  [![Gem Version](https://badge.fury.io/rb/git.svg)](https://badge.fury.io/rb/git)
9
+ [![Build Status](https://github.com/ruby-git/ruby-git/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/ruby-git/ruby-git/actions/workflows/continuous_integration.yml)
9
10
  [![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/git/)
10
11
  [![Change
11
12
  Log](https://img.shields.io/badge/CHANGELOG-Latest-green)](https://rubydoc.info/gems/git/file/CHANGELOG.md)
12
- [![Build
13
- Status](https://github.com/ruby-git/ruby-git/workflows/CI/badge.svg?branch=main)](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
14
13
  [![Conventional
15
14
  Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
16
- [![AI Policy](https://img.shields.io/badge/AI%20Policy-Required-blue)](AI_POLICY.md)
15
+ [![AI Policy](https://img.shields.io/badge/AI%20Policy-Doc-blue)](AI_POLICY.md)
16
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- default_tasks_parallel = %w[spec:unit:parallel spec:integration:parallel rubocop]
13
- default_tasks_parallel << :yard if Rake::Task.task_defined?(:yard)
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
- $LOAD_PATH.unshift File.expand_path('lib', __dir__)
4
- require 'git/version'
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 = Git::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.22'
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', '~> 0.4'
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
- # :nocov: this case should be unreachable
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
- # :nocov:
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
- # @example Remove a remote with a name that looks like a flag
17
- # remove = Git::Commands::Remote::Remove.new(execution_context)
18
- # remove.call('-weirdremote')
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