git 5.4.0 → 5.5.0
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 +31 -0
- data/CONTRIBUTING.md +16 -12
- data/README.md +6 -5
- data/UPGRADING.md +199 -10
- data/lib/git/version.rb +1 -1
- data/lib/git.rb +18 -7
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8a27bcb58894e06dd36f368c545d7800e95b2106122d222f98e43e4776117d38
|
|
4
|
+
data.tar.gz: a59267db8db5a09e843914400be509c574670d824882b8c7a0c80f3e38945238
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c60016fdfb41208d18ab63e36fb24a26c5a4cbc73978d44bab657ffb4ee8395d9c774311a752ae91e474b36d3b11d9eafb0c5ce1f54d8202068057d50b6c1093
|
|
7
|
+
data.tar.gz: 24656d7407eeea1ae1f92a8748eee1e65cdba4bafb9409ca0a96a819cfe7e3e2be4d9838fa3369464ccf908d5a7313de884a2e11c750f23664d88fcaa157f3dd
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@
|
|
|
5
5
|
|
|
6
6
|
# Change Log
|
|
7
7
|
|
|
8
|
+
## [5.5.0](https://github.com/ruby-git/ruby-git/compare/v5.4.1...v5.5.0) (2026-09-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **export:** Warn when the :remote option is passed to Git.export ([55a9810](https://github.com/ruby-git/ruby-git/commit/55a9810b7681a510781e55b17026ec6e13dcbfa5)), closes [#1820](https://github.com/ruby-git/ruby-git/issues/1820)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **export:** Drop the redundant checkout that broke Git.export for tags ([5e8422d](https://github.com/ruby-git/ruby-git/commit/5e8422d2361bff43959a0bba2254118087907a2a)), closes [#1815](https://github.com/ruby-git/ruby-git/issues/1815)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Other Changes
|
|
22
|
+
|
|
23
|
+
* **export:** Document the deprecated :remote option to Git.export ([3806d2b](https://github.com/ruby-git/ruby-git/commit/3806d2b5a6fdb167006097df83c783573024a521)), closes [#1820](https://github.com/ruby-git/ruby-git/issues/1820)
|
|
24
|
+
* Name the 5.x maintenance branch alongside 4.x ([ad30718](https://github.com/ruby-git/ruby-git/commit/ad30718a61cb89c343c84c71feb1c94cf3995f28))
|
|
25
|
+
* Run the CI, commitlint, release, and cache workflows for the 5.x branch ([7c3fd13](https://github.com/ruby-git/ruby-git/commit/7c3fd13994104c2c6b6564cc41d1e3c4e614255a))
|
|
26
|
+
|
|
27
|
+
## [5.4.1](https://github.com/ruby-git/ruby-git/compare/v5.4.0...v5.4.1) (2026-09-04)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Other Changes
|
|
31
|
+
|
|
32
|
+
* Document the Git.clone option renames in UPGRADING.md ([0f8e5d8](https://github.com/ruby-git/ruby-git/commit/0f8e5d85eda89d2da802eebde5036c3f32b0f08e)), closes [#1763](https://github.com/ruby-git/ruby-git/issues/1763)
|
|
33
|
+
* **upgrading:** Document the Git::Log Enumerable and Commit#set_commit deprecations ([1d1c9bc](https://github.com/ruby-git/ruby-git/commit/1d1c9bcf33824ced13b13d61f7ce2f4cb1169e8d)), closes [#1764](https://github.com/ruby-git/ruby-git/issues/1764)
|
|
34
|
+
* **upgrading:** Document the Git::Repository method renames ([e1bb6e6](https://github.com/ruby-git/ruby-git/commit/e1bb6e6214340fed5b52acf0366488c860687f41)), closes [#1765](https://github.com/ruby-git/ruby-git/issues/1765)
|
|
35
|
+
* **upgrading:** Document the Git::Repository option renames ([0a2dfcb](https://github.com/ruby-git/ruby-git/commit/0a2dfcba94d9b5a0e89bdeaa9ec32de3ddc6dc59)), closes [#1766](https://github.com/ruby-git/ruby-git/issues/1766)
|
|
36
|
+
* **upgrading:** Document the module-level Git deprecations ([cd3a2ae](https://github.com/ruby-git/ruby-git/commit/cd3a2ae81af6f90bf9e65b3ac21bce722efd84fc)), closes [#1762](https://github.com/ruby-git/ruby-git/issues/1762)
|
|
37
|
+
* **upgrading:** Remove two misplaced rows from the configuration methods table ([61ad4c8](https://github.com/ruby-git/ruby-git/commit/61ad4c85763b1695618378b27d5f51e28bd0369d)), closes [#1761](https://github.com/ruby-git/ruby-git/issues/1761)
|
|
38
|
+
|
|
8
39
|
## [5.4.0](https://github.com/ruby-git/ruby-git/compare/v5.3.0...v5.4.0) (2026-09-04)
|
|
9
40
|
|
|
10
41
|
|
data/CONTRIBUTING.md
CHANGED
|
@@ -128,7 +128,7 @@ bin/setup
|
|
|
128
128
|
3. Run `npm install` (when npm is available) to install the Conventional Commit
|
|
129
129
|
`commit-msg` hook used by this project (Husky + commitlint). A separate
|
|
130
130
|
`pre-commit` hook is also installed that blocks direct commits to the
|
|
131
|
-
protected branches (`main`, `4.x`).
|
|
131
|
+
protected branches (`main`, `5.x`, `4.x`).
|
|
132
132
|
4. Verify the toolchain by running `bundle exec rake --tasks`.
|
|
133
133
|
|
|
134
134
|
`bin/setup` checks for [lychee](https://lychee.cli.rs) alongside Ruby, git, and
|
|
@@ -197,7 +197,7 @@ Once your pull request is ready for review, request a review from at least one
|
|
|
197
197
|
|
|
198
198
|
During the review process, you may need to make additional commits; squash them.
|
|
199
199
|
You will also need to rebase your branch onto the latest version of the target
|
|
200
|
-
branch (e.g., `main` or `4.x`) before merging.
|
|
200
|
+
branch (e.g., `main`, `5.x`, or `4.x`) before merging.
|
|
201
201
|
|
|
202
202
|
At least one approval from a project maintainer is required before your pull request
|
|
203
203
|
can be merged. The maintainer is responsible for ensuring that the pull request meets
|
|
@@ -219,11 +219,13 @@ first keeps the review cycle short.
|
|
|
219
219
|
|
|
220
220
|
## Branch strategy
|
|
221
221
|
|
|
222
|
-
This project maintains
|
|
222
|
+
This project maintains `main` plus one maintenance branch for each supported previous
|
|
223
|
+
major series:
|
|
223
224
|
|
|
224
225
|
- **`main`**: All development. It releases the next version of the gem, including
|
|
225
|
-
the next major version.
|
|
226
|
-
|
|
226
|
+
the next major version. Its next release is v6.0.0; every further v5.x release is
|
|
227
|
+
cut from `5.x`.
|
|
228
|
+
- **`5.x`** and **`4.x`**: The maintenance branches for the v5.x and v4.x series. Each
|
|
227
229
|
receives bug fixes and security fixes, and backward-compatible features at the
|
|
228
230
|
maintainers' discretion.
|
|
229
231
|
|
|
@@ -233,8 +235,10 @@ each major series is supported.
|
|
|
233
235
|
When submitting a pull request:
|
|
234
236
|
|
|
235
237
|
- **New features and breaking changes**: Target the `main` branch
|
|
236
|
-
- **Bug fixes**: Target `main`, and maintainers will backport to
|
|
237
|
-
|
|
238
|
+
- **Bug fixes**: Target `main`, and maintainers will backport to the maintenance
|
|
239
|
+
branches if applicable
|
|
240
|
+
- **Security fixes**: Target `main` and every affected maintenance branch, or only a
|
|
241
|
+
maintenance branch if the issue affects that series alone
|
|
238
242
|
|
|
239
243
|
Removing a deprecated API follows the
|
|
240
244
|
[deprecation policy](.github/skills/breaking-change-analysis/SKILL.md#step-4-deprecation-policy):
|
|
@@ -981,9 +985,9 @@ skill. Follow it when writing or reviewing specs under `spec/unit/`.
|
|
|
981
985
|
|
|
982
986
|
#### Test coverage policy
|
|
983
987
|
|
|
984
|
-
**Every pull request to `main` must keep `bundle exec rake spec:unit` at
|
|
985
|
-
coverage and 100% branch coverage of `lib/`.** CI fails the build when it
|
|
986
|
-
below either threshold.
|
|
988
|
+
**Every pull request to `main` or `5.x` must keep `bundle exec rake spec:unit` at
|
|
989
|
+
100% line coverage and 100% branch coverage of `lib/`.** CI fails the build when it
|
|
990
|
+
drops below either threshold.
|
|
987
991
|
|
|
988
992
|
This is enforceable without being onerous because unit coverage in this project is
|
|
989
993
|
deterministic: `lib/` has no Ruby-version, Ruby-engine, or platform conditionals, and
|
|
@@ -1088,8 +1092,8 @@ $ LIST_UNCOVERED_DETAIL=true bundle exec rake spec:unit
|
|
|
1088
1092
|
$ open coverage/index.html
|
|
1089
1093
|
```
|
|
1090
1094
|
|
|
1091
|
-
This policy applies to `main`
|
|
1092
|
-
not held to these thresholds.
|
|
1095
|
+
This policy applies to `main` and `5.x`. The `4.x` maintenance branch predates it and
|
|
1096
|
+
is not held to these thresholds.
|
|
1093
1097
|
|
|
1094
1098
|
#### Unit tests vs integration tests
|
|
1095
1099
|
|
data/README.md
CHANGED
|
@@ -447,12 +447,13 @@ are in [UPGRADING.md](UPGRADING.md#upgrading-to-v600). See
|
|
|
447
447
|
### Release support policy
|
|
448
448
|
|
|
449
449
|
All development happens on `main`, which releases the next version of the gem,
|
|
450
|
-
including the next major version.
|
|
450
|
+
including the next major version. The next release from `main` is v6.0.0. Every
|
|
451
|
+
further v5.x release is cut from `5.x`.
|
|
451
452
|
|
|
452
|
-
|
|
453
|
-
series, currently `4.x`.
|
|
454
|
-
backward-compatible features at the maintainers' discretion. Fixes land on
|
|
455
|
-
first and are backported, except a fix for a problem that exists only in
|
|
453
|
+
Each supported previous major series is maintained on a branch named for that
|
|
454
|
+
series, currently `5.x` and `4.x`. These branches receive bug fixes and security
|
|
455
|
+
fixes, and backward-compatible features at the maintainers' discretion. Fixes land on
|
|
456
|
+
`main` first and are backported, except a fix for a problem that exists only in a
|
|
456
457
|
maintenance branch, which targets that branch directly.
|
|
457
458
|
|
|
458
459
|
Support for a major series ends when the second major after it is released. v4.x is
|
data/UPGRADING.md
CHANGED
|
@@ -16,8 +16,11 @@ to update your code when upgrading from the preceding major version.
|
|
|
16
16
|
- [`Git::CommandLineResult` deprecated](#gitcommandlineresult-deprecated)
|
|
17
17
|
- [Deprecated methods](#deprecated-methods)
|
|
18
18
|
- [Facade method renames](#facade-method-renames)
|
|
19
|
+
- [`Git::Repository` method renames](#gitrepository-method-renames)
|
|
20
|
+
- [`Git::Repository` option renames](#gitrepository-option-renames)
|
|
19
21
|
- [v4.x-style configuration methods](#v4x-style-configuration-methods)
|
|
20
22
|
- [`Git` module mixin deprecations](#git-module-mixin-deprecations)
|
|
23
|
+
- [Module-level `Git` function deprecations](#module-level-git-function-deprecations)
|
|
21
24
|
- [`Git::Author` deprecated](#gitauthor-deprecated)
|
|
22
25
|
- [`Git::Branch#stashes` deprecated](#gitbranchstashes-deprecated)
|
|
23
26
|
- [Legacy stash API deprecated](#legacy-stash-api-deprecated)
|
|
@@ -28,6 +31,10 @@ to update your code when upgrading from the preceding major version.
|
|
|
28
31
|
- [`Git::Object::Tag` deprecated](#gitobjecttag-deprecated)
|
|
29
32
|
- [`Git::Status` deprecated](#gitstatus-deprecated)
|
|
30
33
|
- [`Git::Worktree` and `Git::Worktrees` deprecated](#gitworktree-and-gitworktrees-deprecated)
|
|
34
|
+
- [`Git.clone` option renames](#gitclone-option-renames)
|
|
35
|
+
- [`Git::Log` Enumerable interface deprecated](#gitlog-enumerable-interface-deprecated)
|
|
36
|
+
- [`Git::Object::Commit#set_commit` deprecated](#gitobjectcommitset_commit-deprecated)
|
|
37
|
+
- [`Git.export` `:remote` option deprecated](#gitexport-remote-option-deprecated)
|
|
31
38
|
|
|
32
39
|
## Upgrading to v6.0.0
|
|
33
40
|
|
|
@@ -354,18 +361,89 @@ The old names continue to work but emit deprecation warnings:
|
|
|
354
361
|
| `g.add_tag(name, ...)` | `g.tag_add(name, ...)` |
|
|
355
362
|
| `g.delete_tag(name)` | `g.tag_delete(name)` |
|
|
356
363
|
|
|
364
|
+
#### `Git::Repository` method renames
|
|
365
|
+
|
|
366
|
+
Seven more `Git::Repository` methods were renamed in v5.x. The old names continue
|
|
367
|
+
to work but emit deprecation warnings. Each old name returns exactly what its
|
|
368
|
+
replacement returns, except `branches_all`.
|
|
369
|
+
|
|
370
|
+
> **Return shape change:** `g.branches_all` returns an `Array` of 4-element
|
|
371
|
+
> tuples `[refname, current, worktree, symref]`, where `refname` is the short
|
|
372
|
+
> form (`main` or `remotes/origin/main`), `current` and `worktree` are booleans,
|
|
373
|
+
> and `symref` is the symbolic-ref target or `nil`. `g.branch_list` returns
|
|
374
|
+
> `Array<Git::BranchInfo>` with `refname` (always the full ref: `refs/heads/main`
|
|
375
|
+
> or `refs/remotes/origin/main`), `short_name`, `remote_name`, `remote?`,
|
|
376
|
+
> `current?`, `other_worktree?`, `symref`, `target_oid`, and `upstream`. This
|
|
377
|
+
> expression reproduces the legacy tuples:
|
|
378
|
+
>
|
|
379
|
+
> ```ruby
|
|
380
|
+
> g.branch_list.map do |i|
|
|
381
|
+
> refname = i.remote? ? "remotes/#{i.remote_name}/#{i.short_name}" : i.short_name
|
|
382
|
+
> [refname, i.current?, i.other_worktree?, i.symref]
|
|
383
|
+
> end
|
|
384
|
+
> ```
|
|
385
|
+
|
|
386
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
387
|
+
|-----------------------------------------------------|-------------|
|
|
388
|
+
| `g.empty?` | `g.no_commits?` — `true` when the repository has no commits |
|
|
389
|
+
| `g.reset_hard` | `g.reset(nil, hard: true)` — `reset` takes the commitish positionally, so pass `nil` before the options; returns git's stdout, as `reset_hard` did |
|
|
390
|
+
| `g.reset_hard(commitish)` | `g.reset(commitish, hard: true)` — `reset_hard` ignored any `:hard` option passed to it and always reset with `--hard` |
|
|
391
|
+
| `g.conflicts { \|file, yours, theirs\| ... }` | `g.each_conflict { \|file, yours, theirs\| ... }` — same block arguments; returns the unmerged paths |
|
|
392
|
+
| `g.is_local_branch?(name)` | `g.local_branch?(name)` |
|
|
393
|
+
| `g.is_remote_branch?(name)` | `g.remote_branch?(name)` |
|
|
394
|
+
| `g.is_branch?(name)` | `g.branch?(name)` |
|
|
395
|
+
| `g.branches_all` | `g.branch_list` — returns `Array<Git::BranchInfo>`; see the return shape change above |
|
|
396
|
+
|
|
397
|
+
#### `Git::Repository` option renames
|
|
398
|
+
|
|
399
|
+
Five methods accept a v4.x option or positional argument under its old name.
|
|
400
|
+
The old form still works in v5.x but emits a deprecation warning and is
|
|
401
|
+
translated to the v5.x form shown below.
|
|
402
|
+
|
|
403
|
+
> **`clean`:** `force: 2` runs `git clean -ff`, which also removes untracked
|
|
404
|
+
> nested git repositories. A `false` or `nil` value for `:ff` or `:force_force`
|
|
405
|
+
> still warns and has no effect; a value other than `true`, `false`, or `nil`
|
|
406
|
+
> raises `ArgumentError`. When the deprecated key is `true` and a valid
|
|
407
|
+
> `:force` is also given, `:force` is raised to `2` (a `:force` already at `2`
|
|
408
|
+
> is unchanged). An invalid `:force` value such as `0` is passed through
|
|
409
|
+
> unchanged and still raises `ArgumentError`; the deprecated key does not mask
|
|
410
|
+
> it.
|
|
411
|
+
|
|
412
|
+
> **`diff_path_status`:** `:path_limiter` accepts the same values as `:path`
|
|
413
|
+
> (a `String`, a `Pathname`, or an `Array` of them). When both keys are given,
|
|
414
|
+
> `:path_limiter` wins and no warning is emitted.
|
|
415
|
+
|
|
416
|
+
> **`set_working` and `set_index`:** `must_exist:` defaults to `true`. When
|
|
417
|
+
> both the positional argument and `must_exist:` are given, they are OR'ed so
|
|
418
|
+
> the more restrictive value wins.
|
|
419
|
+
|
|
420
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
421
|
+
|-----------------------------------------------------|-------------|
|
|
422
|
+
| `g.clean(ff: true)` | `g.clean(force: 2)` |
|
|
423
|
+
| `g.clean(force_force: true)` | `g.clean(force: 2)` |
|
|
424
|
+
| `g.diff_path_status(ref1, ref2, path: p)` | `g.diff_path_status(ref1, ref2, path_limiter: p)` |
|
|
425
|
+
| `g.commit(message, add_all: true)` | `g.commit(message, all: true)` — runs `git commit -a` |
|
|
426
|
+
| `g.set_working(dir, check)` | `g.set_working(dir, must_exist: check)` |
|
|
427
|
+
| `g.set_index(file, check)` | `g.set_index(file, must_exist: check)` |
|
|
428
|
+
|
|
357
429
|
#### v4.x-style configuration methods
|
|
358
430
|
|
|
359
431
|
The v4.x `config` and `global_config` methods accepted varying argument shapes
|
|
360
432
|
to read, write, or list configuration. These are replaced by separate,
|
|
361
|
-
purpose-named methods.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
>
|
|
433
|
+
purpose-named methods. The same applies to the module-level
|
|
434
|
+
`Git.global_config`, which is replaced by `Git.config_get`, `Git.config_set`,
|
|
435
|
+
and `Git.config_list` called with `global: true`.
|
|
436
|
+
|
|
437
|
+
> **Return type change:** The v4.x `g.config(name)` and `Git.global_config(name)`
|
|
438
|
+
> returned a `String`; `g.config` and `Git.global_config` returned a `Hash`. The
|
|
439
|
+
> v5.x replacements `config_get` and `config_list` return `Git::ConfigEntryInfo`
|
|
440
|
+
> (or `nil` when the key is not set) and `Array<Git::ConfigEntryInfo>`
|
|
366
441
|
> respectively. Use `.value` to get the String value:
|
|
367
442
|
> - `g.config_get(name)&.value` → String or nil
|
|
368
443
|
> - `g.config_list.to_h { |e| [e.key, e.value] }` → Hash (key → value)
|
|
444
|
+
>
|
|
445
|
+
> The setters `g.config(name, value)` and `Git.global_config(name, value)`
|
|
446
|
+
> returned the raw command result; `config_set` returns `nil`.
|
|
369
447
|
|
|
370
448
|
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
371
449
|
|-----------------------------------------------------|-------------|
|
|
@@ -375,8 +453,9 @@ purpose-named methods.
|
|
|
375
453
|
| `g.global_config(name)` | `g.config_get(name, global: true)` |
|
|
376
454
|
| `g.global_config` | `g.config_list(global: true)` |
|
|
377
455
|
| `g.global_config(name, value)` | `g.config_set(name, value, global: true)` |
|
|
378
|
-
| `
|
|
379
|
-
| `
|
|
456
|
+
| `Git.global_config(name)` | `Git.config_get(name, global: true)` — returns `Git::ConfigEntryInfo` or `nil`; use `.value` for the String |
|
|
457
|
+
| `Git.global_config` | `Git.config_list(global: true)` — returns `Array<Git::ConfigEntryInfo>` |
|
|
458
|
+
| `Git.global_config(name, value)` | `Git.config_set(name, value, global: true)` |
|
|
380
459
|
|
|
381
460
|
#### `Git` module mixin deprecations
|
|
382
461
|
|
|
@@ -385,13 +464,43 @@ as bare methods is deprecated:
|
|
|
385
464
|
|
|
386
465
|
| Deprecated usage | Replacement |
|
|
387
466
|
|-----------------|-------------|
|
|
388
|
-
| `include Git; config(name)` | `Git.
|
|
389
|
-
| `include Git; config(name, value)` | `Git.
|
|
390
|
-
| `include Git; config` | `Git.
|
|
467
|
+
| `include Git; config(name)` | `Git.config_get(name)` |
|
|
468
|
+
| `include Git; config(name, value)` | `Git.config_set(name, value)` |
|
|
469
|
+
| `include Git; config` | `Git.config_list` |
|
|
391
470
|
| `include Git; global_config(name)` | `Git.config_get(name, global: true)` |
|
|
392
471
|
| `include Git; global_config(name, value)` | `Git.config_set(name, value, global: true)` |
|
|
393
472
|
| `include Git; global_config` | `Git.config_list(global: true)` |
|
|
394
473
|
|
|
474
|
+
`Git.config_get`, `Git.config_set`, and `Git.config_list` run `git config` in
|
|
475
|
+
the current directory, which is what the mixin `config` method did. The
|
|
476
|
+
return types differ as described under
|
|
477
|
+
[v4.x-style configuration methods](#v4x-style-configuration-methods).
|
|
478
|
+
|
|
479
|
+
#### Module-level `Git` function deprecations
|
|
480
|
+
|
|
481
|
+
Two module-level functions on `Git` accept a legacy call shape or return a
|
|
482
|
+
legacy type that is deprecated:
|
|
483
|
+
|
|
484
|
+
- `Git.ls_remote` defaults its repository argument to `'.'`. Passing `nil`
|
|
485
|
+
explicitly still works but warns; omit the argument or pass `'.'`. The
|
|
486
|
+
options hash is positional, so when you pass options you must also pass the
|
|
487
|
+
repository: `Git.ls_remote('.', opts)`, not `Git.ls_remote(opts)`.
|
|
488
|
+
- `Git.binary_version` is replaced by `Git.git_version`, which keeps the
|
|
489
|
+
optional binary path argument.
|
|
490
|
+
|
|
491
|
+
> **Return type change:** `Git.binary_version` returned an `Array<Integer>` of
|
|
492
|
+
> `[major, minor, patch]`. `Git.git_version` returns a `Git::Version`, which
|
|
493
|
+
> supports comparison and exposes `major`, `minor`, and `patch`.
|
|
494
|
+
> `Git.git_version.to_a` reproduces the legacy array. The return value of
|
|
495
|
+
> `Git.ls_remote` is unchanged.
|
|
496
|
+
|
|
497
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
498
|
+
|-----------------------------------------------------|-------------|
|
|
499
|
+
| `Git.ls_remote(nil)` | `Git.ls_remote` or `Git.ls_remote('.')` |
|
|
500
|
+
| `Git.ls_remote(nil, opts)` | `Git.ls_remote('.', opts)` |
|
|
501
|
+
| `Git.binary_version` | `Git.git_version` — returns `Git::Version`; use `.to_a` for the `[major, minor, patch]` Array |
|
|
502
|
+
| `Git.binary_version(binary_path)` | `Git.git_version(binary_path)` |
|
|
503
|
+
|
|
395
504
|
#### `Git::Author` deprecated
|
|
396
505
|
|
|
397
506
|
Starting in v5.3.0, methods that return author, committer, or tagger data —
|
|
@@ -946,4 +1055,84 @@ is the `Git::WorktreeInfo` that replaces it.
|
|
|
946
1055
|
| `wt.full`, `wt.to_s` | `info.path` — or `"#{info.path} #{info.head}"` for the descriptor that entries from `g.worktrees` produced |
|
|
947
1056
|
| `wt.to_a` | `[info.path]` |
|
|
948
1057
|
|
|
1058
|
+
#### `Git.clone` option renames
|
|
1059
|
+
|
|
1060
|
+
Three `Git.clone` options were renamed in v5.x. The v4.x names still work. Each
|
|
1061
|
+
deprecated option present on a call emits its own deprecation warning, so a call
|
|
1062
|
+
that uses two of them warns twice. Each value is passed through to the
|
|
1063
|
+
replacement option, except that `:path` is dropped when `:chdir` is also given.
|
|
1064
|
+
|
|
1065
|
+
> **Precedence and value notes:**
|
|
1066
|
+
> - `:path` and `:chdir` both run `git clone` from inside the given directory.
|
|
1067
|
+
> When both are given, `:chdir` wins and `:path` is dropped.
|
|
1068
|
+
> - `:recursive` carries its value over to `:recurse_submodules` unchanged.
|
|
1069
|
+
> `:recurse_submodules` also accepts a pathspec `String` or `Array<String>`
|
|
1070
|
+
> to initialize only a subset of submodules, which `:recursive` never did.
|
|
1071
|
+
> - `:remote` and `:origin` have the same effect (`git clone --origin name`).
|
|
1072
|
+
|
|
1073
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
1074
|
+
|-----------------------------------------------------|-------------|
|
|
1075
|
+
| `Git.clone(url, dir, path: p)` | `Git.clone(url, dir, chdir: p)` |
|
|
1076
|
+
| `Git.clone(url, dir, recursive: true)` | `Git.clone(url, dir, recurse_submodules: true)` — or a pathspec `String` or `Array<String>` for a subset of submodules |
|
|
1077
|
+
| `Git.clone(url, dir, remote: name)` | `Git.clone(url, dir, origin: name)` |
|
|
1078
|
+
|
|
1079
|
+
#### `Git::Log` Enumerable interface deprecated
|
|
1080
|
+
|
|
1081
|
+
`Git::Log` is a query builder. Calling `each`, `size`, `to_s`, `first`, `last`, or
|
|
1082
|
+
`[]` directly on it runs the query and emits a deprecation warning; those methods
|
|
1083
|
+
are removed in v6.0.0. Call `Git::Log#execute` instead. It runs the query and
|
|
1084
|
+
returns a `Git::Log::Result`, which includes `Enumerable` and provides the same
|
|
1085
|
+
six methods. The chainable query methods on `Git::Log` (`since`, `author`,
|
|
1086
|
+
`between`, `path`, `max_count`, and so on) are unchanged.
|
|
1087
|
+
|
|
1088
|
+
`Git::Log` includes `Enumerable`, so every `Enumerable` method called on the
|
|
1089
|
+
builder (`map`, `select`, `count`, `to_a`, `include?`, and so on) goes through the
|
|
1090
|
+
deprecated `each` and emits its warning. Move those calls to the result as well,
|
|
1091
|
+
not only the six named methods.
|
|
1092
|
+
|
|
1093
|
+
> **Snapshot results:** `execute` returns a snapshot. The builder re-runs
|
|
1094
|
+
> `git log` only when a query method (`since`, `max_count`, and so on) has been
|
|
1095
|
+
> called since the last run, even with the same value as before, so calling
|
|
1096
|
+
> `execute` twice on an untouched builder returns equal results without a second
|
|
1097
|
+
> `git log`. Keep the result object when a chain of operations needs the same
|
|
1098
|
+
> commits rather than calling `g.log` again, which builds a new query.
|
|
1099
|
+
|
|
1100
|
+
In the table, `g` is a `Git::Repository`.
|
|
1101
|
+
|
|
1102
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
1103
|
+
|-----------------------------------------------------|-------------|
|
|
1104
|
+
| `g.log.each { \|c\| ... }` | `g.log.execute.each { \|c\| ... }` |
|
|
1105
|
+
| `g.log.size` | `g.log.execute.size` |
|
|
1106
|
+
| `g.log.to_s` | `g.log.execute.to_s` — commits joined with newlines, as before |
|
|
1107
|
+
| `g.log.first`, `g.log.last` | `g.log.execute.first`, `g.log.execute.last` |
|
|
1108
|
+
| `g.log[i]`, `g.log[range]` | `g.log.execute[i]`, `g.log.execute[range]` |
|
|
1109
|
+
| any other `Enumerable` method on the log (`map`, `select`, `count`, `to_a`, `include?`, ...) | the same method on `g.log.execute` |
|
|
1110
|
+
|
|
1111
|
+
#### `Git::Object::Commit#set_commit` deprecated
|
|
1112
|
+
|
|
1113
|
+
`Git::Object::Commit#set_commit` is deprecated and is removed in v6.0.0. Call
|
|
1114
|
+
`from_data` instead; it takes the same parsed commit data hash and has the same
|
|
1115
|
+
effect.
|
|
1116
|
+
|
|
1117
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
1118
|
+
|-----------------------------------------------------|-------------|
|
|
1119
|
+
| `commit.set_commit(data)` | `commit.from_data(data)` |
|
|
1120
|
+
|
|
1121
|
+
#### `Git.export` `:remote` option deprecated
|
|
1122
|
+
|
|
1123
|
+
`Git.export` has always dropped a `:remote` option before calling `Git.clone`
|
|
1124
|
+
without telling the caller. Passing it now emits a deprecation warning. The option
|
|
1125
|
+
is still dropped, so the export itself is unchanged, and it will be removed in a
|
|
1126
|
+
future major release. Once it is removed, passing `:remote` raises `ArgumentError`
|
|
1127
|
+
like any other unsupported option (see [Unsupported options raise
|
|
1128
|
+
`ArgumentError`](#unsupported-options-raise-argumenterror)).
|
|
1129
|
+
|
|
1130
|
+
There is no replacement option. `:remote` renamed the clone's remote, and
|
|
1131
|
+
`Git.export` deletes the `.git` directory before returning, so the name was never
|
|
1132
|
+
observable in the result. Delete the option from the call.
|
|
1133
|
+
|
|
1134
|
+
| Deprecated call (works in v5.x, removed in a future major release) | Replacement |
|
|
1135
|
+
|--------------------------------------------------------------------|-------------|
|
|
1136
|
+
| `Git.export(url, dir, remote: name)` | `Git.export(url, dir)` |
|
|
1137
|
+
|
|
949
1138
|
---
|
data/lib/git/version.rb
CHANGED
data/lib/git.rb
CHANGED
|
@@ -327,25 +327,36 @@ module Git
|
|
|
327
327
|
# Exports the current HEAD (or the specific branch given in <tt>options[:branch]</tt>)
|
|
328
328
|
# into the given `directory`. It then removes all traces of git from the directory.
|
|
329
329
|
#
|
|
330
|
-
# Takes the same options as {Git.clone} except that `:
|
|
331
|
-
#
|
|
330
|
+
# Takes the same options as {Git.clone} except that `:depth` defaults to 1 and
|
|
331
|
+
# `:remote` is ignored with a deprecation warning.
|
|
332
332
|
#
|
|
333
333
|
# @param repository_url [String, URI, Pathname] the repository to export from
|
|
334
334
|
#
|
|
335
335
|
# @param directory [String, Pathname, nil] the directory to export into; defaults to the
|
|
336
336
|
# repository basename
|
|
337
337
|
#
|
|
338
|
-
# @param options [Hash] options forwarded to {Git.clone} (`:
|
|
339
|
-
# `:depth` defaults to 1)
|
|
338
|
+
# @param options [Hash] options forwarded to {Git.clone} (`:depth` defaults to 1)
|
|
340
339
|
#
|
|
341
|
-
# @option options [String] :
|
|
340
|
+
# @option options [String] :remote deprecated and ignored; delete it from the call.
|
|
341
|
+
# Passing it emits a deprecation warning and it will be removed in a future
|
|
342
|
+
# major release.
|
|
343
|
+
#
|
|
344
|
+
# @option options [String] :branch the branch or tag to export instead of HEAD.
|
|
345
|
+
# Give the short name (`main`, `v1.0.0`); a full ref path such as
|
|
346
|
+
# `refs/tags/v1.0.0` or a commit SHA is not accepted. Use `:revision` to
|
|
347
|
+
# export a SHA.
|
|
342
348
|
#
|
|
343
349
|
# @return [void]
|
|
344
350
|
#
|
|
345
351
|
def self.export(repository_url, directory = nil, options = {})
|
|
346
|
-
options.
|
|
352
|
+
if options.key?(:remote)
|
|
353
|
+
Git::Deprecation.warn(
|
|
354
|
+
'The :remote option to Git.export is ignored, is deprecated, and will be removed in a future ' \
|
|
355
|
+
'major release. Delete it from the call.'
|
|
356
|
+
)
|
|
357
|
+
options.delete(:remote)
|
|
358
|
+
end
|
|
347
359
|
repo = clone(repository_url, directory, { depth: 1 }.merge(options))
|
|
348
|
-
repo.checkout("origin/#{options[:branch]}") if options[:branch]
|
|
349
360
|
FileUtils.rm_r File.join(repo.dir.to_s, '.git')
|
|
350
361
|
end
|
|
351
362
|
|
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: 5.
|
|
4
|
+
version: 5.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Chacon and others
|
|
@@ -548,8 +548,8 @@ licenses:
|
|
|
548
548
|
metadata:
|
|
549
549
|
homepage_uri: http://github.com/ruby-git/ruby-git
|
|
550
550
|
source_code_uri: http://github.com/ruby-git/ruby-git
|
|
551
|
-
changelog_uri: https://rubydoc.info/gems/git/5.
|
|
552
|
-
documentation_uri: https://rubydoc.info/gems/git/5.
|
|
551
|
+
changelog_uri: https://rubydoc.info/gems/git/5.5.0/file/CHANGELOG.md
|
|
552
|
+
documentation_uri: https://rubydoc.info/gems/git/5.5.0
|
|
553
553
|
rubygems_mfa_required: 'true'
|
|
554
554
|
rdoc_options: []
|
|
555
555
|
require_paths:
|