git 4.4.1 → 4.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a24c04e4ade577716464aaf17cdac3f1e1d7e860e60dcd9ed964eb8f0f503b4b
4
- data.tar.gz: 7913679e60e68c2f51d9189c150dbf8310244afd71a38a0a7ff88845e58d2d96
3
+ metadata.gz: 5edd3d97d763864b53bf259e67da06224fe1af8700e6229402af735395c48694
4
+ data.tar.gz: 0be5c354b15762008e8b83208aaa900d8bdadc4bf2e9b953526a112caad9b1c7
5
5
  SHA512:
6
- metadata.gz: 3e768e8f510d5919d7bacae8095da345e8446546e39e0567aaa2b242700fc4a2045bd6328bd8c5bfa0876375380b679f07aaa33992ebf4828b5298999e033201
7
- data.tar.gz: a80276c4a8d613aae86a1adfdaa5f39aabfd3f85e9b4f3dc703612a4fea7afc452f37b9b5d4f3a6d632a2a1e8d12427a5f6f35697ed8daa16e8b2aaebfca5d29
6
+ metadata.gz: ba7c8e11c635383c3b502eeebe74f6bd8a38baf84c55375c623f24b90376c7a7012119770dfc32e87427970e9d613f25cb80ddeda4d315dd5058b64e37b284c4
7
+ data.tar.gz: 9fed231ffd42c844f736e19c286a968005050cbf84f2c64a2d3d68fa75982728534590c0ae482d9044b814ed9a631d95f458d82a65edc37ab2f36c2ba9532399
data/.gitignore CHANGED
@@ -12,3 +12,4 @@ node_modules
12
12
  package-lock.json
13
13
  ai-prompt.erb
14
14
  rubocop-report.json
15
+ git-versions/
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "4.4.1"
2
+ ".": "4.4.3"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@
5
5
 
6
6
  # Change Log
7
7
 
8
+ ## [4.4.3](https://github.com/ruby-git/ruby-git/compare/v4.4.2...v4.4.3) (2026-08-30)
9
+
10
+
11
+ ### Other Changes
12
+
13
+ * **deps:** Update process_executer to ~> 4.1 ([6f41964](https://github.com/ruby-git/ruby-git/commit/6f41964e400c7fa5a79ef9ec848144aaf56e8d06))
14
+ * Fix rubocop offenses on the 4.x branch ([0361cf5](https://github.com/ruby-git/ruby-git/commit/0361cf521895fb722cd3e1fdb42006ce6d0a6d3c))
15
+ * Ignore the git-versions directory ([2cc1bf5](https://github.com/ruby-git/ruby-git/commit/2cc1bf5f2cca6854d647634d2fef58e681fd90e3))
16
+ * Name maintainer and contributors in the LICENSE copyright notice ([9d0ac3c](https://github.com/ruby-git/ruby-git/commit/9d0ac3ca56c49e1d78deb6e869aaddcb30362cb6))
17
+ * Skip the rubocop rake task on JRuby and TruffleRuby ([da527c2](https://github.com/ruby-git/ruby-git/commit/da527c2314d5a81441b2590609cdadce9d394e17))
18
+
19
+ ## [4.4.2](https://github.com/ruby-git/ruby-git/compare/v4.4.1...v4.4.2) (2026-08-19)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * Run the Git.open bootstrap commands without redirecting stdin ([65de0fe](https://github.com/ruby-git/ruby-git/commit/65de0fe88bca34ad3de366ee9a212653de37fc6d)), closes [#840](https://github.com/ruby-git/ruby-git/issues/840)
25
+
8
26
  ## [4.4.1](https://github.com/ruby-git/ruby-git/compare/v4.4.0...v4.4.1) (2026-08-09)
9
27
 
10
28
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2008 Scott Chacon
3
+ Copyright (c) 2008 Scott Chacon, 2020 James Couball, and the ruby-git contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/git.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency 'activesupport', '>= 5.0'
33
33
  spec.add_dependency 'addressable', '~> 2.8'
34
- spec.add_dependency 'process_executer', '~> 4.0'
34
+ spec.add_dependency 'process_executer', '~> 4.1'
35
35
  spec.add_dependency 'rchardet', '~> 1.9'
36
36
 
37
37
  spec.add_development_dependency 'create_github_release', '~> 2.1'
data/lib/git/base.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'logger'
4
- require 'open3'
5
4
 
6
5
  module Git
7
6
  # The main public interface for interacting with Git commands
@@ -41,21 +40,14 @@ module Git
41
40
  end
42
41
 
43
42
  def self.binary_version(binary_path)
44
- result, status = execute_git_version(binary_path)
45
-
46
- raise "Failed to get git version: #{status}\n#{result}" unless status.success?
47
-
48
- parse_version_string(result)
43
+ parse_version_string(execute_git_version(binary_path))
49
44
  end
50
45
 
51
46
  private_class_method def self.execute_git_version(binary_path)
52
- Open3.capture2e(
53
- binary_path,
54
- '-c', 'core.quotePath=true',
55
- '-c', 'color.ui=false',
56
- 'version'
57
- )
58
- rescue Errno::ENOENT
47
+ bootstrap_command_line(binary_path).run('version', merge: true).stdout
48
+ rescue Git::CommandLineError => e
49
+ raise "Failed to get git version: #{e.result.status}\n#{e.result.stdout}"
50
+ rescue Errno::ENOENT, ProcessExecuter::SpawnError
59
51
  raise "Failed to get git version: #{binary_path} not found"
60
52
  end
61
53
 
@@ -98,26 +90,45 @@ module Git
98
90
  def self.root_of_worktree(working_dir)
99
91
  raise ArgumentError, "'#{working_dir}' does not exist" unless Dir.exist?(working_dir)
100
92
 
101
- result, status = execute_rev_parse_toplevel(working_dir)
102
- process_rev_parse_result(result, status, working_dir)
93
+ execute_rev_parse_toplevel(working_dir)
103
94
  end
104
95
 
105
96
  private_class_method def self.execute_rev_parse_toplevel(working_dir)
106
- Open3.capture2e(
107
- Git::Base.config.binary_path,
108
- '-c', 'core.quotePath=true',
109
- '-c', 'color.ui=false',
110
- 'rev-parse', '--show-toplevel',
111
- chdir: File.expand_path(working_dir)
112
- )
113
- rescue Errno::ENOENT
97
+ bootstrap_command_line(Git::Base.config.binary_path).run(
98
+ 'rev-parse', '--show-toplevel', chdir: File.expand_path(working_dir), merge: true, chomp: true
99
+ ).stdout
100
+ rescue Git::CommandLineError
101
+ raise ArgumentError, "'#{working_dir}' is not in a git working tree"
102
+ rescue Errno::ENOENT, ProcessExecuter::SpawnError
114
103
  raise ArgumentError, 'Failed to find the root of the worktree: git binary not found'
115
104
  end
116
105
 
117
- private_class_method def self.process_rev_parse_result(result, status, working_dir)
118
- raise ArgumentError, "'#{working_dir}' is not in a git working tree" unless status.success?
119
-
120
- result.chomp
106
+ # A command line for the git commands that run before a repository is known
107
+ #
108
+ # `Open3` is deliberately not used here. Windows has no fork, so
109
+ # `Process.spawn` implements a redirect of the child's stdin by redirecting
110
+ # the *parent's* stdin and restoring it afterward, which replaces the
111
+ # process's stdin handle. That leaves a console REPL such as irb or pry
112
+ # unable to read input for the rest of the session. `Git::CommandLine`
113
+ # redirects only stdout and stderr, so stdin is never disturbed.
114
+ #
115
+ # @see https://github.com/ruby-git/ruby-git/issues/840 issue 840
116
+ #
117
+ # @param binary_path [String] the path to the git binary to run
118
+ #
119
+ # @return [Git::CommandLine] a command line that runs `binary_path` with
120
+ # `-c core.quotePath=true -c color.ui=false`
121
+ #
122
+ # Those are the options the `Open3` calls this replaced passed, kept as they were
123
+ # so these two commands behave exactly as before. Neither `git version` nor
124
+ # `git rev-parse --show-toplevel` emits colored output, so the remaining `color.*`
125
+ # settings in {Git::Lib}'s `STATIC_GLOBAL_OPTS` are not needed here.
126
+ #
127
+ # @api private
128
+ #
129
+ private_class_method def self.bootstrap_command_line(binary_path)
130
+ Git::CommandLine.new({}, binary_path, ['-c', 'core.quotePath=true', '-c', 'color.ui=false'],
131
+ Logger.new(nil))
121
132
  end
122
133
 
123
134
  # (see Git.open)
@@ -295,6 +306,7 @@ module Git
295
306
  branch_names.include?(branch)
296
307
  end
297
308
 
309
+ # @deprecated Use {#local_branch?} instead
298
310
  def is_local_branch?(branch) # rubocop:disable Naming/PredicatePrefix
299
311
  Git::Deprecation.warn(
300
312
  'Git::Base#is_local_branch? is deprecated and will be removed in a future version. ' \
@@ -309,6 +321,7 @@ module Git
309
321
  branch_names.include?(branch)
310
322
  end
311
323
 
324
+ # @deprecated Use {#remote_branch?} instead
312
325
  def is_remote_branch?(branch) # rubocop:disable Naming/PredicatePrefix
313
326
  Git::Deprecation.warn(
314
327
  'Git::Base#is_remote_branch? is deprecated and will be removed in a future version. ' \
@@ -323,6 +336,7 @@ module Git
323
336
  branch_names.include?(branch)
324
337
  end
325
338
 
339
+ # @deprecated Use {#branch?} instead
326
340
  def is_branch?(branch) # rubocop:disable Naming/PredicatePrefix
327
341
  Git::Deprecation.warn(
328
342
  'Git::Base#is_branch? is deprecated and will be removed in a future version. ' \
@@ -699,11 +713,9 @@ module Git
699
713
  # @example Check specific objects
700
714
  # result = git.fsck('abc1234', 'def5678')
701
715
  #
702
- # rubocop:disable Style/ArgumentsForwarding
703
- def fsck(*objects, **opts)
704
- lib.fsck(*objects, **opts)
716
+ def fsck(*objects, **opts) # rubocop:disable Style/ArgumentsForwarding
717
+ lib.fsck(*objects, **opts) # rubocop:disable Style/ArgumentsForwarding
705
718
  end
706
- # rubocop:enable Style/ArgumentsForwarding
707
719
 
708
720
  def apply(file)
709
721
  return unless File.exist?(file)
data/lib/git/lib.rb CHANGED
@@ -11,7 +11,6 @@ require 'process_executer'
11
11
  require 'stringio'
12
12
  require 'tempfile'
13
13
  require 'zlib'
14
- require 'open3'
15
14
 
16
15
  module Git
17
16
  # Internal git operations
@@ -799,7 +798,7 @@ module Git
799
798
  end
800
799
 
801
800
  def branch_contains(commit, branch_name = '')
802
- command('branch', branch_name, '--contains', commit)
801
+ command('branch', branch_name, '--contains', commit)
803
802
  end
804
803
 
805
804
  GREP_OPTION_MAP = [
data/lib/git/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module Git
4
4
  # The current gem version
5
5
  # @return [String] the current gem version.
6
- VERSION = '4.4.1'
6
+ VERSION = '4.4.3'
7
7
  end
data/tasks/rubocop.rake CHANGED
@@ -1,5 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubocop/rake_task'
3
+ # RuboCop analyzes source text, so its verdict is fixed by TargetRubyVersion in
4
+ # .rubocop.yml, not by the host Ruby. Skipping it on JRuby and TruffleRuby loses no
5
+ # coverage (the MRI matrix jobs lint the same files) and avoids RuboCop internal
6
+ # cop errors on TruffleRuby.
7
+ #
8
+ unless RUBY_PLATFORM == 'java' || RUBY_ENGINE == 'truffleruby'
9
+ require 'rubocop/rake_task'
4
10
 
5
- RuboCop::RakeTask.new
11
+ RuboCop::RakeTask.new
12
+ end
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.4.1
4
+ version: 4.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon and others
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '4.0'
46
+ version: '4.1'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '4.0'
53
+ version: '4.1'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: rchardet
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -310,8 +310,8 @@ licenses:
310
310
  metadata:
311
311
  homepage_uri: http://github.com/ruby-git/ruby-git
312
312
  source_code_uri: http://github.com/ruby-git/ruby-git
313
- changelog_uri: https://rubydoc.info/gems/git/4.4.1/file/CHANGELOG.md
314
- documentation_uri: https://rubydoc.info/gems/git/4.4.1
313
+ changelog_uri: https://rubydoc.info/gems/git/4.4.3/file/CHANGELOG.md
314
+ documentation_uri: https://rubydoc.info/gems/git/4.4.3
315
315
  rubygems_mfa_required: 'true'
316
316
  rdoc_options: []
317
317
  require_paths: