git 5.4.0 → 5.4.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 +12 -0
- data/UPGRADING.md +181 -10
- data/lib/git/version.rb +1 -1
- 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: 3a2e69ae222061dc013d589215448053164f54e1b17c4e071b30d8fbe8035bcf
|
|
4
|
+
data.tar.gz: b9615131c7573796ca6feed9becd6381b8f2aa142ce2e419c9669055f184f770
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3b1b79895b947c9b3209204e634b6069677f8e4054839b7744ee50d10bb09e66350d4e3041988718671c16bf75aca70ec35a50cfcd540cc52e69e3fc011450d
|
|
7
|
+
data.tar.gz: 559b0e41cefa277f70c5e52ec8970b59b895f8ec8e808f2d207c49ea26592c45efe8c9d2b1233e3a1d3ed7ab77aae3ffa99d1802f51a842fce48a8f9fe81d3f3
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
# Change Log
|
|
7
7
|
|
|
8
|
+
## [5.4.1](https://github.com/ruby-git/ruby-git/compare/v5.4.0...v5.4.1) (2026-09-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Other Changes
|
|
12
|
+
|
|
13
|
+
* 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)
|
|
14
|
+
* **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)
|
|
15
|
+
* **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)
|
|
16
|
+
* **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)
|
|
17
|
+
* **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)
|
|
18
|
+
* **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)
|
|
19
|
+
|
|
8
20
|
## [5.4.0](https://github.com/ruby-git/ruby-git/compare/v5.3.0...v5.4.0) (2026-09-04)
|
|
9
21
|
|
|
10
22
|
|
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,9 @@ 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)
|
|
31
37
|
|
|
32
38
|
## Upgrading to v6.0.0
|
|
33
39
|
|
|
@@ -354,18 +360,89 @@ The old names continue to work but emit deprecation warnings:
|
|
|
354
360
|
| `g.add_tag(name, ...)` | `g.tag_add(name, ...)` |
|
|
355
361
|
| `g.delete_tag(name)` | `g.tag_delete(name)` |
|
|
356
362
|
|
|
363
|
+
#### `Git::Repository` method renames
|
|
364
|
+
|
|
365
|
+
Seven more `Git::Repository` methods were renamed in v5.x. The old names continue
|
|
366
|
+
to work but emit deprecation warnings. Each old name returns exactly what its
|
|
367
|
+
replacement returns, except `branches_all`.
|
|
368
|
+
|
|
369
|
+
> **Return shape change:** `g.branches_all` returns an `Array` of 4-element
|
|
370
|
+
> tuples `[refname, current, worktree, symref]`, where `refname` is the short
|
|
371
|
+
> form (`main` or `remotes/origin/main`), `current` and `worktree` are booleans,
|
|
372
|
+
> and `symref` is the symbolic-ref target or `nil`. `g.branch_list` returns
|
|
373
|
+
> `Array<Git::BranchInfo>` with `refname` (always the full ref: `refs/heads/main`
|
|
374
|
+
> or `refs/remotes/origin/main`), `short_name`, `remote_name`, `remote?`,
|
|
375
|
+
> `current?`, `other_worktree?`, `symref`, `target_oid`, and `upstream`. This
|
|
376
|
+
> expression reproduces the legacy tuples:
|
|
377
|
+
>
|
|
378
|
+
> ```ruby
|
|
379
|
+
> g.branch_list.map do |i|
|
|
380
|
+
> refname = i.remote? ? "remotes/#{i.remote_name}/#{i.short_name}" : i.short_name
|
|
381
|
+
> [refname, i.current?, i.other_worktree?, i.symref]
|
|
382
|
+
> end
|
|
383
|
+
> ```
|
|
384
|
+
|
|
385
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
386
|
+
|-----------------------------------------------------|-------------|
|
|
387
|
+
| `g.empty?` | `g.no_commits?` — `true` when the repository has no commits |
|
|
388
|
+
| `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 |
|
|
389
|
+
| `g.reset_hard(commitish)` | `g.reset(commitish, hard: true)` — `reset_hard` ignored any `:hard` option passed to it and always reset with `--hard` |
|
|
390
|
+
| `g.conflicts { \|file, yours, theirs\| ... }` | `g.each_conflict { \|file, yours, theirs\| ... }` — same block arguments; returns the unmerged paths |
|
|
391
|
+
| `g.is_local_branch?(name)` | `g.local_branch?(name)` |
|
|
392
|
+
| `g.is_remote_branch?(name)` | `g.remote_branch?(name)` |
|
|
393
|
+
| `g.is_branch?(name)` | `g.branch?(name)` |
|
|
394
|
+
| `g.branches_all` | `g.branch_list` — returns `Array<Git::BranchInfo>`; see the return shape change above |
|
|
395
|
+
|
|
396
|
+
#### `Git::Repository` option renames
|
|
397
|
+
|
|
398
|
+
Five methods accept a v4.x option or positional argument under its old name.
|
|
399
|
+
The old form still works in v5.x but emits a deprecation warning and is
|
|
400
|
+
translated to the v5.x form shown below.
|
|
401
|
+
|
|
402
|
+
> **`clean`:** `force: 2` runs `git clean -ff`, which also removes untracked
|
|
403
|
+
> nested git repositories. A `false` or `nil` value for `:ff` or `:force_force`
|
|
404
|
+
> still warns and has no effect; a value other than `true`, `false`, or `nil`
|
|
405
|
+
> raises `ArgumentError`. When the deprecated key is `true` and a valid
|
|
406
|
+
> `:force` is also given, `:force` is raised to `2` (a `:force` already at `2`
|
|
407
|
+
> is unchanged). An invalid `:force` value such as `0` is passed through
|
|
408
|
+
> unchanged and still raises `ArgumentError`; the deprecated key does not mask
|
|
409
|
+
> it.
|
|
410
|
+
|
|
411
|
+
> **`diff_path_status`:** `:path_limiter` accepts the same values as `:path`
|
|
412
|
+
> (a `String`, a `Pathname`, or an `Array` of them). When both keys are given,
|
|
413
|
+
> `:path_limiter` wins and no warning is emitted.
|
|
414
|
+
|
|
415
|
+
> **`set_working` and `set_index`:** `must_exist:` defaults to `true`. When
|
|
416
|
+
> both the positional argument and `must_exist:` are given, they are OR'ed so
|
|
417
|
+
> the more restrictive value wins.
|
|
418
|
+
|
|
419
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
420
|
+
|-----------------------------------------------------|-------------|
|
|
421
|
+
| `g.clean(ff: true)` | `g.clean(force: 2)` |
|
|
422
|
+
| `g.clean(force_force: true)` | `g.clean(force: 2)` |
|
|
423
|
+
| `g.diff_path_status(ref1, ref2, path: p)` | `g.diff_path_status(ref1, ref2, path_limiter: p)` |
|
|
424
|
+
| `g.commit(message, add_all: true)` | `g.commit(message, all: true)` — runs `git commit -a` |
|
|
425
|
+
| `g.set_working(dir, check)` | `g.set_working(dir, must_exist: check)` |
|
|
426
|
+
| `g.set_index(file, check)` | `g.set_index(file, must_exist: check)` |
|
|
427
|
+
|
|
357
428
|
#### v4.x-style configuration methods
|
|
358
429
|
|
|
359
430
|
The v4.x `config` and `global_config` methods accepted varying argument shapes
|
|
360
431
|
to read, write, or list configuration. These are replaced by separate,
|
|
361
|
-
purpose-named methods.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
>
|
|
432
|
+
purpose-named methods. The same applies to the module-level
|
|
433
|
+
`Git.global_config`, which is replaced by `Git.config_get`, `Git.config_set`,
|
|
434
|
+
and `Git.config_list` called with `global: true`.
|
|
435
|
+
|
|
436
|
+
> **Return type change:** The v4.x `g.config(name)` and `Git.global_config(name)`
|
|
437
|
+
> returned a `String`; `g.config` and `Git.global_config` returned a `Hash`. The
|
|
438
|
+
> v5.x replacements `config_get` and `config_list` return `Git::ConfigEntryInfo`
|
|
439
|
+
> (or `nil` when the key is not set) and `Array<Git::ConfigEntryInfo>`
|
|
366
440
|
> respectively. Use `.value` to get the String value:
|
|
367
441
|
> - `g.config_get(name)&.value` → String or nil
|
|
368
442
|
> - `g.config_list.to_h { |e| [e.key, e.value] }` → Hash (key → value)
|
|
443
|
+
>
|
|
444
|
+
> The setters `g.config(name, value)` and `Git.global_config(name, value)`
|
|
445
|
+
> returned the raw command result; `config_set` returns `nil`.
|
|
369
446
|
|
|
370
447
|
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
371
448
|
|-----------------------------------------------------|-------------|
|
|
@@ -375,8 +452,9 @@ purpose-named methods.
|
|
|
375
452
|
| `g.global_config(name)` | `g.config_get(name, global: true)` |
|
|
376
453
|
| `g.global_config` | `g.config_list(global: true)` |
|
|
377
454
|
| `g.global_config(name, value)` | `g.config_set(name, value, global: true)` |
|
|
378
|
-
| `
|
|
379
|
-
| `
|
|
455
|
+
| `Git.global_config(name)` | `Git.config_get(name, global: true)` — returns `Git::ConfigEntryInfo` or `nil`; use `.value` for the String |
|
|
456
|
+
| `Git.global_config` | `Git.config_list(global: true)` — returns `Array<Git::ConfigEntryInfo>` |
|
|
457
|
+
| `Git.global_config(name, value)` | `Git.config_set(name, value, global: true)` |
|
|
380
458
|
|
|
381
459
|
#### `Git` module mixin deprecations
|
|
382
460
|
|
|
@@ -385,13 +463,43 @@ as bare methods is deprecated:
|
|
|
385
463
|
|
|
386
464
|
| Deprecated usage | Replacement |
|
|
387
465
|
|-----------------|-------------|
|
|
388
|
-
| `include Git; config(name)` | `Git.
|
|
389
|
-
| `include Git; config(name, value)` | `Git.
|
|
390
|
-
| `include Git; config` | `Git.
|
|
466
|
+
| `include Git; config(name)` | `Git.config_get(name)` |
|
|
467
|
+
| `include Git; config(name, value)` | `Git.config_set(name, value)` |
|
|
468
|
+
| `include Git; config` | `Git.config_list` |
|
|
391
469
|
| `include Git; global_config(name)` | `Git.config_get(name, global: true)` |
|
|
392
470
|
| `include Git; global_config(name, value)` | `Git.config_set(name, value, global: true)` |
|
|
393
471
|
| `include Git; global_config` | `Git.config_list(global: true)` |
|
|
394
472
|
|
|
473
|
+
`Git.config_get`, `Git.config_set`, and `Git.config_list` run `git config` in
|
|
474
|
+
the current directory, which is what the mixin `config` method did. The
|
|
475
|
+
return types differ as described under
|
|
476
|
+
[v4.x-style configuration methods](#v4x-style-configuration-methods).
|
|
477
|
+
|
|
478
|
+
#### Module-level `Git` function deprecations
|
|
479
|
+
|
|
480
|
+
Two module-level functions on `Git` accept a legacy call shape or return a
|
|
481
|
+
legacy type that is deprecated:
|
|
482
|
+
|
|
483
|
+
- `Git.ls_remote` defaults its repository argument to `'.'`. Passing `nil`
|
|
484
|
+
explicitly still works but warns; omit the argument or pass `'.'`. The
|
|
485
|
+
options hash is positional, so when you pass options you must also pass the
|
|
486
|
+
repository: `Git.ls_remote('.', opts)`, not `Git.ls_remote(opts)`.
|
|
487
|
+
- `Git.binary_version` is replaced by `Git.git_version`, which keeps the
|
|
488
|
+
optional binary path argument.
|
|
489
|
+
|
|
490
|
+
> **Return type change:** `Git.binary_version` returned an `Array<Integer>` of
|
|
491
|
+
> `[major, minor, patch]`. `Git.git_version` returns a `Git::Version`, which
|
|
492
|
+
> supports comparison and exposes `major`, `minor`, and `patch`.
|
|
493
|
+
> `Git.git_version.to_a` reproduces the legacy array. The return value of
|
|
494
|
+
> `Git.ls_remote` is unchanged.
|
|
495
|
+
|
|
496
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
497
|
+
|-----------------------------------------------------|-------------|
|
|
498
|
+
| `Git.ls_remote(nil)` | `Git.ls_remote` or `Git.ls_remote('.')` |
|
|
499
|
+
| `Git.ls_remote(nil, opts)` | `Git.ls_remote('.', opts)` |
|
|
500
|
+
| `Git.binary_version` | `Git.git_version` — returns `Git::Version`; use `.to_a` for the `[major, minor, patch]` Array |
|
|
501
|
+
| `Git.binary_version(binary_path)` | `Git.git_version(binary_path)` |
|
|
502
|
+
|
|
395
503
|
#### `Git::Author` deprecated
|
|
396
504
|
|
|
397
505
|
Starting in v5.3.0, methods that return author, committer, or tagger data —
|
|
@@ -946,4 +1054,67 @@ is the `Git::WorktreeInfo` that replaces it.
|
|
|
946
1054
|
| `wt.full`, `wt.to_s` | `info.path` — or `"#{info.path} #{info.head}"` for the descriptor that entries from `g.worktrees` produced |
|
|
947
1055
|
| `wt.to_a` | `[info.path]` |
|
|
948
1056
|
|
|
1057
|
+
#### `Git.clone` option renames
|
|
1058
|
+
|
|
1059
|
+
Three `Git.clone` options were renamed in v5.x. The v4.x names still work. Each
|
|
1060
|
+
deprecated option present on a call emits its own deprecation warning, so a call
|
|
1061
|
+
that uses two of them warns twice. Each value is passed through to the
|
|
1062
|
+
replacement option, except that `:path` is dropped when `:chdir` is also given.
|
|
1063
|
+
|
|
1064
|
+
> **Precedence and value notes:**
|
|
1065
|
+
> - `:path` and `:chdir` both run `git clone` from inside the given directory.
|
|
1066
|
+
> When both are given, `:chdir` wins and `:path` is dropped.
|
|
1067
|
+
> - `:recursive` carries its value over to `:recurse_submodules` unchanged.
|
|
1068
|
+
> `:recurse_submodules` also accepts a pathspec `String` or `Array<String>`
|
|
1069
|
+
> to initialize only a subset of submodules, which `:recursive` never did.
|
|
1070
|
+
> - `:remote` and `:origin` have the same effect (`git clone --origin name`).
|
|
1071
|
+
|
|
1072
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
1073
|
+
|-----------------------------------------------------|-------------|
|
|
1074
|
+
| `Git.clone(url, dir, path: p)` | `Git.clone(url, dir, chdir: p)` |
|
|
1075
|
+
| `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 |
|
|
1076
|
+
| `Git.clone(url, dir, remote: name)` | `Git.clone(url, dir, origin: name)` |
|
|
1077
|
+
|
|
1078
|
+
#### `Git::Log` Enumerable interface deprecated
|
|
1079
|
+
|
|
1080
|
+
`Git::Log` is a query builder. Calling `each`, `size`, `to_s`, `first`, `last`, or
|
|
1081
|
+
`[]` directly on it runs the query and emits a deprecation warning; those methods
|
|
1082
|
+
are removed in v6.0.0. Call `Git::Log#execute` instead. It runs the query and
|
|
1083
|
+
returns a `Git::Log::Result`, which includes `Enumerable` and provides the same
|
|
1084
|
+
six methods. The chainable query methods on `Git::Log` (`since`, `author`,
|
|
1085
|
+
`between`, `path`, `max_count`, and so on) are unchanged.
|
|
1086
|
+
|
|
1087
|
+
`Git::Log` includes `Enumerable`, so every `Enumerable` method called on the
|
|
1088
|
+
builder (`map`, `select`, `count`, `to_a`, `include?`, and so on) goes through the
|
|
1089
|
+
deprecated `each` and emits its warning. Move those calls to the result as well,
|
|
1090
|
+
not only the six named methods.
|
|
1091
|
+
|
|
1092
|
+
> **Snapshot results:** `execute` returns a snapshot. The builder re-runs
|
|
1093
|
+
> `git log` only when a query method (`since`, `max_count`, and so on) has been
|
|
1094
|
+
> called since the last run, even with the same value as before, so calling
|
|
1095
|
+
> `execute` twice on an untouched builder returns equal results without a second
|
|
1096
|
+
> `git log`. Keep the result object when a chain of operations needs the same
|
|
1097
|
+
> commits rather than calling `g.log` again, which builds a new query.
|
|
1098
|
+
|
|
1099
|
+
In the table, `g` is a `Git::Repository`.
|
|
1100
|
+
|
|
1101
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
1102
|
+
|-----------------------------------------------------|-------------|
|
|
1103
|
+
| `g.log.each { \|c\| ... }` | `g.log.execute.each { \|c\| ... }` |
|
|
1104
|
+
| `g.log.size` | `g.log.execute.size` |
|
|
1105
|
+
| `g.log.to_s` | `g.log.execute.to_s` — commits joined with newlines, as before |
|
|
1106
|
+
| `g.log.first`, `g.log.last` | `g.log.execute.first`, `g.log.execute.last` |
|
|
1107
|
+
| `g.log[i]`, `g.log[range]` | `g.log.execute[i]`, `g.log.execute[range]` |
|
|
1108
|
+
| any other `Enumerable` method on the log (`map`, `select`, `count`, `to_a`, `include?`, ...) | the same method on `g.log.execute` |
|
|
1109
|
+
|
|
1110
|
+
#### `Git::Object::Commit#set_commit` deprecated
|
|
1111
|
+
|
|
1112
|
+
`Git::Object::Commit#set_commit` is deprecated and is removed in v6.0.0. Call
|
|
1113
|
+
`from_data` instead; it takes the same parsed commit data hash and has the same
|
|
1114
|
+
effect.
|
|
1115
|
+
|
|
1116
|
+
| Deprecated call (works in v5.x, removed in v6.0.0) | Replacement |
|
|
1117
|
+
|-----------------------------------------------------|-------------|
|
|
1118
|
+
| `commit.set_commit(data)` | `commit.from_data(data)` |
|
|
1119
|
+
|
|
949
1120
|
---
|
data/lib/git/version.rb
CHANGED
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.
|
|
4
|
+
version: 5.4.1
|
|
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.4.
|
|
552
|
-
documentation_uri: https://rubydoc.info/gems/git/5.4.
|
|
551
|
+
changelog_uri: https://rubydoc.info/gems/git/5.4.1/file/CHANGELOG.md
|
|
552
|
+
documentation_uri: https://rubydoc.info/gems/git/5.4.1
|
|
553
553
|
rubygems_mfa_required: 'true'
|
|
554
554
|
rdoc_options: []
|
|
555
555
|
require_paths:
|