git 2.3.0 → 2.3.1
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/CHANGELOG.md +14 -0
- data/CONTRIBUTING.md +93 -8
- data/lib/git/base.rb +14 -0
- data/lib/git/lib.rb +4 -2
- data/lib/git/version.rb +1 -1
- data/lib/git.rb +11 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b62df99d178044fd3fe000a27475819f27bcede65dd96bbc884e1a9eb766df86
|
4
|
+
data.tar.gz: 37330af1ce4f2b8f0ea372cbb36fe32991ab93f5243dbe91589a045f7c5073cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a10a88c4cc04970184c9f5e1eda87dfc4778366498a867931be7196de1a0d882b5d9a7c552249d384ad46e7e1dee2c1077aff1d3ea31e5b53254dbe099e781b
|
7
|
+
data.tar.gz: 76d10cc88dfd8150daaf6f53f1af46077345fa35a64b71c8f6276e388503f1f15fee173dca322ae49c7fb511ebe5d44dc43dd84b15a9a234e2b06aea627e7032
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,20 @@
|
|
5
5
|
|
6
6
|
# Change Log
|
7
7
|
|
8
|
+
## v2.3.1 (2024-10-23)
|
9
|
+
|
10
|
+
[Full Changelog](https://github.com/ruby-git/ruby-git/compare/v2.3.0..v2.3.1)
|
11
|
+
|
12
|
+
Changes since v2.3.0:
|
13
|
+
|
14
|
+
* e236007 test: allow bin/test-in-docker to accept the test file(s) to run on command line
|
15
|
+
* f4747e1 test: rename bin/tests to bin/test-in-docker
|
16
|
+
* 51f781c test: remove duplicate test from test_stashes.rb
|
17
|
+
* 2e79dbe Fixed "unbranched" stash message support:
|
18
|
+
* da6fa6e Conatinerised the test suite with Docker:
|
19
|
+
* 2e23d47 Update instructions for building a specific version of Git
|
20
|
+
* 70565e3 Add Git.binary_version to return the version of the git command line
|
21
|
+
|
8
22
|
## v2.3.0 (2024-09-01)
|
9
23
|
|
10
24
|
[Full Changelog](https://github.com/ruby-git/ruby-git/compare/v2.2.0..v2.3.0)
|
data/CONTRIBUTING.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
# @title How To Contribute
|
4
4
|
-->
|
5
5
|
|
6
|
+
# Contributing to the git gem
|
7
|
+
|
8
|
+
* [Summary](#summary)
|
6
9
|
* [How to contribute](#how-to-contribute)
|
7
10
|
* [How to report an issue or request a feature](#how-to-report-an-issue-or-request-a-feature)
|
8
11
|
* [How to submit a code or documentation change](#how-to-submit-a-code-or-documentation-change)
|
@@ -18,10 +21,14 @@
|
|
18
21
|
* [Unit tests](#unit-tests)
|
19
22
|
* [Continuous integration](#continuous-integration)
|
20
23
|
* [Documentation](#documentation)
|
24
|
+
* [Building a specific version of the Git command-line](#building-a-specific-version-of-the-git-command-line)
|
25
|
+
* [Install pre-requisites](#install-pre-requisites)
|
26
|
+
* [Obtain Git source code](#obtain-git-source-code)
|
27
|
+
* [Build git](#build-git)
|
28
|
+
* [Use the new Git version](#use-the-new-git-version)
|
21
29
|
* [Licensing](#licensing)
|
22
30
|
|
23
|
-
|
24
|
-
# Contributing to the git gem
|
31
|
+
## Summary
|
25
32
|
|
26
33
|
Thank you for your interest in contributing to the `ruby-git` project.
|
27
34
|
|
@@ -172,22 +179,100 @@ $ bin/test test_object test_archive
|
|
172
179
|
|
173
180
|
# run all unit tests:
|
174
181
|
$ bin/test
|
182
|
+
|
183
|
+
# run unit tests with a different version of the git command line:
|
184
|
+
$ GIT_PATH=/Users/james/Downloads/git-2.30.2/bin-wrappers bin/test
|
175
185
|
```
|
176
186
|
|
177
187
|
### Continuous integration
|
178
188
|
|
179
|
-
All tests must pass in the project's [GitHub Continuous Integration
|
189
|
+
All tests must pass in the project's [GitHub Continuous Integration
|
190
|
+
build](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI) before the
|
191
|
+
pull request will be merged.
|
180
192
|
|
181
|
-
The [Continuous Integration
|
193
|
+
The [Continuous Integration
|
194
|
+
workflow](https://github.com/ruby-git/ruby-git/blob/master/.github/workflows/continuous_integration.yml)
|
195
|
+
runs both `bundle exec rake default` and `bundle exec rake test:gem` from the
|
196
|
+
project's [Rakefile](https://github.com/ruby-git/ruby-git/blob/master/Rakefile).
|
182
197
|
|
183
198
|
### Documentation
|
184
199
|
|
185
|
-
New and updated public methods must include [YARD](https://yardoc.org/)
|
200
|
+
New and updated public methods must include [YARD](https://yardoc.org/)
|
201
|
+
documentation.
|
202
|
+
|
203
|
+
New and updated public-facing features should be documented in the project's
|
204
|
+
[README.md](README.md).
|
205
|
+
|
206
|
+
## Building a specific version of the Git command-line
|
207
|
+
|
208
|
+
To test with a specific version of the Git command-line, you may need to build that
|
209
|
+
version from source code. The following instructions are adapted from Atlassian’s
|
210
|
+
[How to install Git](https://www.atlassian.com/git/tutorials/install-git) page for
|
211
|
+
building Git on macOS.
|
212
|
+
|
213
|
+
### Install pre-requisites
|
214
|
+
|
215
|
+
Prerequisites only need to be installed if they are not already present.
|
216
|
+
|
217
|
+
From your terminal, install Xcode’s Command Line Tools:
|
218
|
+
|
219
|
+
```shell
|
220
|
+
xcode-select --install
|
221
|
+
```
|
222
|
+
|
223
|
+
Install [Homebrew](http://brew.sh/) by following the instructions on the Homebrew
|
224
|
+
page.
|
225
|
+
|
226
|
+
Using Homebrew, install OpenSSL:
|
227
|
+
|
228
|
+
```shell
|
229
|
+
brew install openssl
|
230
|
+
```
|
231
|
+
|
232
|
+
### Obtain Git source code
|
233
|
+
|
234
|
+
Download and extract the source tarball for the desired Git version from [this source
|
235
|
+
code mirror](https://mirrors.edge.kernel.org/pub/software/scm/git/).
|
236
|
+
|
237
|
+
### Build git
|
238
|
+
|
239
|
+
From your terminal, change to the root directory of the extracted source code and run
|
240
|
+
the build with following command:
|
241
|
+
|
242
|
+
```shell
|
243
|
+
NO_GETTEXT=1 make CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib"
|
244
|
+
```
|
245
|
+
|
246
|
+
The build script will place the newly compiled Git executables in the `bin-wrappers`
|
247
|
+
directory (e.g., `bin-wrappers/git`).
|
248
|
+
|
249
|
+
### Use the new Git version
|
250
|
+
|
251
|
+
To configure programs that use the Git gem to utilize the newly built version, do the
|
252
|
+
following:
|
253
|
+
|
254
|
+
```ruby
|
255
|
+
require 'git'
|
256
|
+
|
257
|
+
# Set the binary path
|
258
|
+
Git.configure { |c| c.binary_path = '/Users/james/Downloads/git-2.30.2/bin-wrappers/git' }
|
259
|
+
|
260
|
+
# Validate the version (if desired)
|
261
|
+
assert_equal([2, 30, 2], Git.binary_version)
|
262
|
+
```
|
263
|
+
|
264
|
+
Tests can be run using the newly built Git version as follows:
|
265
|
+
|
266
|
+
```shell
|
267
|
+
GIT_PATH=/Users/james/Downloads/git-2.30.2/bin-wrappers bin/test
|
268
|
+
```
|
186
269
|
|
187
|
-
|
270
|
+
Note: `GIT_PATH` refers to the directory containing the `git` executable.
|
188
271
|
|
189
272
|
## Licensing
|
190
273
|
|
191
|
-
`ruby-git` uses [the MIT license](https://choosealicense.com/licenses/mit/) as
|
274
|
+
`ruby-git` uses [the MIT license](https://choosealicense.com/licenses/mit/) as
|
275
|
+
declared in the [LICENSE](LICENSE) file.
|
192
276
|
|
193
|
-
Licensing is critical to open-source projects as it ensures the software remains
|
277
|
+
Licensing is critical to open-source projects as it ensures the software remains
|
278
|
+
available under the terms desired by the author.
|
data/lib/git/base.rb
CHANGED
@@ -36,6 +36,20 @@ module Git
|
|
36
36
|
@@config ||= Config.new
|
37
37
|
end
|
38
38
|
|
39
|
+
def self.binary_version(binary_path)
|
40
|
+
git_cmd = "#{binary_path} -c core.quotePath=true -c color.ui=false version 2>&1"
|
41
|
+
result, status = Open3.capture2(git_cmd)
|
42
|
+
result = result.chomp
|
43
|
+
|
44
|
+
if status.success?
|
45
|
+
version = result[/\d+(\.\d+)+/]
|
46
|
+
version_parts = version.split('.').collect { |i| i.to_i }
|
47
|
+
version_parts.fill(0, version_parts.length...3)
|
48
|
+
else
|
49
|
+
raise RuntimeError, "Failed to get git version: #{status}\n#{result}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
39
53
|
# (see Git.init)
|
40
54
|
def self.init(directory = '.', options = {})
|
41
55
|
normalize_paths(options, default_working_directory: directory, default_repository: directory, bare: options[:bare])
|
data/lib/git/lib.rb
CHANGED
@@ -1134,8 +1134,10 @@ module Git
|
|
1134
1134
|
if File.exist?(filename)
|
1135
1135
|
File.open(filename) do |f|
|
1136
1136
|
f.each_with_index do |line, i|
|
1137
|
-
|
1138
|
-
|
1137
|
+
_, msg = line.split("\t")
|
1138
|
+
# NOTE this logic may be removed/changed in 3.x
|
1139
|
+
m = msg.match(/^[^:]+:(.*)$/)
|
1140
|
+
arr << [i, (m ? m[1] : msg).strip]
|
1139
1141
|
end
|
1140
1142
|
end
|
1141
1143
|
end
|
data/lib/git/version.rb
CHANGED
data/lib/git.rb
CHANGED
@@ -381,4 +381,15 @@ module Git
|
|
381
381
|
def self.open(working_dir, options = {})
|
382
382
|
Base.open(working_dir, options)
|
383
383
|
end
|
384
|
+
|
385
|
+
# Return the version of the git binary
|
386
|
+
#
|
387
|
+
# @example
|
388
|
+
# Git.binary_version # => [2, 46, 0]
|
389
|
+
#
|
390
|
+
# @return [Array<Integer>] the version of the git binary
|
391
|
+
#
|
392
|
+
def self.binary_version(binary_path = Git::Base.config.binary_path)
|
393
|
+
Base.binary_version(binary_path)
|
394
|
+
end
|
384
395
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
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-
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -243,8 +243,8 @@ licenses:
|
|
243
243
|
metadata:
|
244
244
|
homepage_uri: http://github.com/ruby-git/ruby-git
|
245
245
|
source_code_uri: http://github.com/ruby-git/ruby-git
|
246
|
-
changelog_uri: https://rubydoc.info/gems/git/2.3.
|
247
|
-
documentation_uri: https://rubydoc.info/gems/git/2.3.
|
246
|
+
changelog_uri: https://rubydoc.info/gems/git/2.3.1/file/CHANGELOG.md
|
247
|
+
documentation_uri: https://rubydoc.info/gems/git/2.3.1
|
248
248
|
post_install_message:
|
249
249
|
rdoc_options: []
|
250
250
|
require_paths:
|
@@ -261,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
261
|
version: '0'
|
262
262
|
requirements:
|
263
263
|
- git 2.28.0 or greater
|
264
|
-
rubygems_version: 3.5.
|
264
|
+
rubygems_version: 3.5.16
|
265
265
|
signing_key:
|
266
266
|
specification_version: 4
|
267
267
|
summary: An API to create, read, and manipulate Git repositories
|