git 5.1.0 → 5.3.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 +78 -0
- data/CONTRIBUTING.md +202 -169
- data/LICENSE +1 -1
- data/README.md +192 -151
- data/UPGRADING.md +287 -1
- data/git.gemspec +35 -3
- data/lib/git/author.rb +11 -0
- data/lib/git/author_info.rb +66 -0
- data/lib/git/branch.rb +210 -15
- data/lib/git/branch_info.rb +1 -1
- data/lib/git/branches.rb +35 -7
- data/lib/git/command_line/base.rb +1 -2
- data/lib/git/commands/base.rb +1 -1
- data/lib/git/commands/cat_file/raw.rb +62 -7
- data/lib/git/object.rb +13 -7
- data/lib/git/parsers/stash.rb +50 -17
- data/lib/git/parsers/tag.rb +54 -8
- data/lib/git/remote.rb +37 -7
- data/lib/git/remote_info.rb +67 -10
- data/lib/git/repository/branching.rb +190 -6
- data/lib/git/repository/merging.rb +96 -2
- data/lib/git/repository/remote_operations.rb +57 -0
- data/lib/git/repository/shared_private.rb +67 -0
- data/lib/git/stash_info.rb +32 -34
- data/lib/git/tag_info.rb +21 -29
- data/lib/git/version.rb +1 -1
- data/lib/git.rb +1 -0
- metadata +6 -94
- data/.claude/commands/address-copilot-reviews.md +0 -14
- data/.claude/settings.json +0 -16
- data/.claude/skills +0 -1
- data/.commitlintrc.yml +0 -38
- data/.dockerignore +0 -27
- data/.github/copilot-instructions.md +0 -30
- data/.github/hooks/bin-setup-on-worktree.json +0 -11
- data/.github/hooks/run-bin-setup-once.sh +0 -20
- data/.github/issue_template.md +0 -15
- data/.github/prompts/iteratively-address-copilot-reviews.prompt.md +0 -188
- data/.github/pull_request_template.md +0 -21
- data/.github/skills/breaking-change-analysis/SKILL.md +0 -99
- data/.github/skills/ci-cd-troubleshooting/SKILL.md +0 -264
- data/.github/skills/command-implementation/REFERENCE.md +0 -994
- data/.github/skills/command-implementation/SKILL.md +0 -230
- data/.github/skills/command-test-conventions/SKILL.md +0 -664
- data/.github/skills/command-yard-documentation/SKILL.md +0 -434
- data/.github/skills/dependency-management/SKILL.md +0 -72
- data/.github/skills/development-workflow/SKILL.md +0 -512
- data/.github/skills/facade-implementation/REFERENCE.md +0 -837
- data/.github/skills/facade-implementation/SKILL.md +0 -269
- data/.github/skills/facade-test-conventions/SKILL.md +0 -391
- data/.github/skills/facade-yard-documentation/SKILL.md +0 -435
- data/.github/skills/make-skill-template/SKILL.md +0 -226
- data/.github/skills/pr-readiness-review/SKILL.md +0 -205
- data/.github/skills/project-context/SKILL.md +0 -306
- data/.github/skills/pull-request-review/SKILL.md +0 -168
- data/.github/skills/rebase/SKILL.md +0 -148
- data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +0 -131
- data/.github/skills/release-management/SKILL.md +0 -125
- data/.github/skills/resolve-feedback/SKILL.md +0 -288
- data/.github/skills/review-arguments-dsl/CHECKLIST.md +0 -788
- data/.github/skills/review-arguments-dsl/SKILL.md +0 -214
- data/.github/skills/review-cross-command-consistency/SKILL.md +0 -139
- data/.github/skills/reviewing-skills/SKILL.md +0 -214
- data/.github/skills/rspec-unit-testing-standards/SKILL.md +0 -685
- data/.github/skills/tdd-refactor-step/SKILL.md +0 -236
- data/.github/skills/test-debugging/SKILL.md +0 -161
- data/.github/skills/yard-documentation/SKILL.md +0 -981
- data/.github/skills/yard-documentation/element-rules.md +0 -162
- data/.github/skills-deprecated/README.md +0 -21
- data/.github/skills-deprecated/extract-command-from-lib/SKILL.md +0 -487
- data/.github/skills-deprecated/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -22
- data/.github/skills-deprecated/extract-facade-from-base-lib/SKILL.md +0 -600
- data/.github/skills-deprecated/review-backward-compatibility/SKILL.md +0 -275
- data/.github/workflows/continuous_integration.yml +0 -358
- data/.github/workflows/enforce_conventional_commits.yml +0 -35
- data/.github/workflows/experimental_continuous_integration.yml +0 -59
- data/.github/workflows/release.yml +0 -52
- data/.github/workflows/warm_bundler_caches.yml +0 -82
- data/.gitignore +0 -30
- data/.husky/commit-msg +0 -1
- data/.husky/pre-commit +0 -13
- data/.release-please-config.json +0 -36
- data/.release-please-manifest.json +0 -3
- data/.rspec +0 -2
- data/.rubocop.yml +0 -44
- data/.rubocop_todo.yml +0 -30
- data/.yard-lint.yml +0 -75
- data/CLAUDE.md +0 -11
- data/Gemfile +0 -22
- data/Rakefile +0 -41
- data/docker/test/Dockerfile +0 -32
- data/docker/test/docker-compose.yml +0 -0
- data/package.json +0 -10
- data/redesign/1_architecture_existing.md +0 -102
- data/redesign/2_architecture_redesign.md +0 -449
- data/redesign/3_architecture_implementation.md +0 -1623
- data/redesign/Phase 4 - Step A.md +0 -366
- data/redesign/Phase 4 - Step B.md +0 -921
- data/redesign/Phase 4 - Step C.md +0 -833
- data/redesign/beta_release.md +0 -107
- data/redesign/branch_parse_refactor_plan.md +0 -163
- data/redesign/c1a-public-api-scope.tsv +0 -256
- data/redesign/c1c2_audit.md +0 -566
- data/redesign/c1c2_bucket6_lib_orphans.md +0 -626
- data/redesign/config_design.rb +0 -501
- data/redesign/index.md +0 -34
- data/redesign/info_object_migration_plan.md +0 -126
- data/redesign/integration_test_analysis.md +0 -521
- data/redesign/phase-4-step-b-test-audit.tsv +0 -485
- data/redesign/remote_refactor_plan.md +0 -164
- data/redesign/reverse_dependencies.sql +0 -44
- data/tasks/gem_tasks.rake +0 -14
- data/tasks/npm_tasks.rake +0 -7
- data/tasks/rspec.rake +0 -111
- data/tasks/rubocop.rake +0 -5
- data/tasks/test_gem.rake +0 -12
- data/tasks/yard.rake +0 -57
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/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# @title README
|
|
4
4
|
-->
|
|
5
5
|
|
|
6
|
-
# The
|
|
6
|
+
# The git gem
|
|
7
7
|
|
|
8
8
|
[](https://badge.fury.io/rb/git)
|
|
9
9
|
[](https://github.com/ruby-git/ruby-git/actions/workflows/continuous_integration.yml)
|
|
@@ -22,33 +22,36 @@ Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?log
|
|
|
22
22
|
|
|
23
23
|
- [Summary](#summary)
|
|
24
24
|
- [Install](#install)
|
|
25
|
-
- [Quick
|
|
25
|
+
- [Quick start](#quick-start)
|
|
26
26
|
- [Examples](#examples)
|
|
27
|
-
- [Gem
|
|
28
|
-
- [Git
|
|
27
|
+
- [Gem configuration](#gem-configuration)
|
|
28
|
+
- [Git configuration](#git-configuration)
|
|
29
29
|
- [Full API](#full-api)
|
|
30
|
-
- [Errors
|
|
31
|
-
- [Specifying and
|
|
30
|
+
- [Errors raised by this gem](#errors-raised-by-this-gem)
|
|
31
|
+
- [Specifying and handling timeouts](#specifying-and-handling-timeouts)
|
|
32
32
|
- [Deprecations](#deprecations)
|
|
33
|
-
- [Platform
|
|
34
|
-
- [Regex
|
|
35
|
-
- [Project
|
|
36
|
-
- [Ruby
|
|
37
|
-
- [Git
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [2025-
|
|
33
|
+
- [Platform limitations](#platform-limitations)
|
|
34
|
+
- [Regex metacharacters on Git for Windows](#regex-metacharacters-on-git-for-windows)
|
|
35
|
+
- [Project policies](#project-policies)
|
|
36
|
+
- [Ruby version support policy](#ruby-version-support-policy)
|
|
37
|
+
- [Git version support policy](#git-version-support-policy)
|
|
38
|
+
- [Deprecation policy](#deprecation-policy)
|
|
39
|
+
- [Release support policy](#release-support-policy)
|
|
40
|
+
- [Project announcements](#project-announcements)
|
|
41
|
+
- [2026-08-23: v5.x deprecations and the v6.0.0 roadmap](#2026-08-23-v5x-deprecations-and-the-v600-roadmap)
|
|
42
|
+
- [2026-07-28: v5.0.0 released](#2026-07-28-v500-released)
|
|
43
|
+
- [2026-01-07: AI policy introduced](#2026-01-07-ai-policy-introduced)
|
|
44
|
+
- [2025-07-09: Architectural redesign](#2025-07-09-architectural-redesign)
|
|
45
|
+
- [2025-07-07: We now use RuboCop](#2025-07-07-we-now-use-rubocop)
|
|
46
|
+
- [2025-06-06: Default branch rename](#2025-06-06-default-branch-rename)
|
|
47
|
+
- [2025-05-15: We've switched to Conventional Commits](#2025-05-15-weve-switched-to-conventional-commits)
|
|
45
48
|
|
|
46
49
|
## Summary
|
|
47
50
|
|
|
48
51
|
The [git gem](https://rubygems.org/gems/git) provides a Ruby interface to the `git`
|
|
49
52
|
command line.
|
|
50
53
|
|
|
51
|
-
Get
|
|
54
|
+
Get a repository object by:
|
|
52
55
|
|
|
53
56
|
- opening an existing working copy with
|
|
54
57
|
[Git.open](https://rubydoc.info/gems/git/Git#open-class_method)
|
|
@@ -57,14 +60,14 @@ Get started by obtaining a repository object by:
|
|
|
57
60
|
- cloning a repository with
|
|
58
61
|
[Git.clone](https://rubydoc.info/gems/git/Git#clone-class_method)
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
[Git::Repository](https://rubydoc.info/gems/git/Git/Repository) documents the
|
|
64
|
+
methods you can call on a repository object.
|
|
62
65
|
|
|
63
66
|
## Install
|
|
64
67
|
|
|
65
68
|
This gem is a wrapper around the `git` command line, so a `git` executable (version
|
|
66
|
-
2.28.0 or greater) must be installed and on your `PATH`. See the [Git
|
|
67
|
-
|
|
69
|
+
2.28.0 or greater) must be installed and on your `PATH`. See the [Git version support
|
|
70
|
+
policy](#git-version-support-policy) for details.
|
|
68
71
|
|
|
69
72
|
Install the gem and add to the application's Gemfile by executing:
|
|
70
73
|
|
|
@@ -72,21 +75,21 @@ Install the gem and add to the application's Gemfile by executing:
|
|
|
72
75
|
bundle add git
|
|
73
76
|
```
|
|
74
77
|
|
|
75
|
-
If
|
|
78
|
+
If you are not using bundler to manage dependencies, install the gem by executing:
|
|
76
79
|
|
|
77
80
|
```shell
|
|
78
81
|
gem install git
|
|
79
82
|
```
|
|
80
83
|
|
|
81
|
-
## Quick
|
|
84
|
+
## Quick start
|
|
82
85
|
|
|
83
86
|
All functionality for this gem starts with the top-level
|
|
84
|
-
[`Git`](https://rubydoc.info/gems/git/Git) module.
|
|
85
|
-
|
|
87
|
+
[`Git`](https://rubydoc.info/gems/git/Git) module. Use this module to run non-repo
|
|
88
|
+
scoped `git` commands such as `config`.
|
|
86
89
|
|
|
87
90
|
The `Git` module also has factory methods such as `open`, `clone`, and `init` which
|
|
88
|
-
return a [`Git::Repository`](https://rubydoc.info/gems/git/Git/Repository) object.
|
|
89
|
-
`Git::Repository` object
|
|
91
|
+
return a [`Git::Repository`](https://rubydoc.info/gems/git/Git/Repository) object. Use
|
|
92
|
+
the `Git::Repository` object to run repo-specific `git` commands such as `add`,
|
|
90
93
|
`commit`, `push`, and `log`.
|
|
91
94
|
|
|
92
95
|
Clone, read status, and log:
|
|
@@ -125,7 +128,7 @@ repo.commit('initial commit')
|
|
|
125
128
|
These examples cover configuring the gem and git itself. For the full set of
|
|
126
129
|
repository operations, see [Full API](#full-api) below.
|
|
127
130
|
|
|
128
|
-
### Gem
|
|
131
|
+
### Gem configuration
|
|
129
132
|
|
|
130
133
|
Configure the git gem:
|
|
131
134
|
|
|
@@ -141,7 +144,7 @@ Git.config.binary_path = '/usr/local/bin/git'
|
|
|
141
144
|
Git.config.git_ssh = 'ssh -i ~/.ssh/id_rsa'
|
|
142
145
|
```
|
|
143
146
|
|
|
144
|
-
|
|
147
|
+
How SSH configuration is determined:
|
|
145
148
|
|
|
146
149
|
- If `git_ssh` is not specified in the API call, the global config (`Git.configure {
|
|
147
150
|
|c| c.git_ssh = ... }`) is used.
|
|
@@ -167,7 +170,7 @@ git = Git.init('new-repo', git_ssh: 'ssh -i /path/to/private_key')
|
|
|
167
170
|
This is especially useful in multi-threaded applications where different repositories
|
|
168
171
|
require different SSH credentials.
|
|
169
172
|
|
|
170
|
-
### Git
|
|
173
|
+
### Git configuration
|
|
171
174
|
|
|
172
175
|
Read and set `git` configuration values (via `git config`):
|
|
173
176
|
|
|
@@ -188,21 +191,21 @@ repo.config_set('user.email', 'anotheruser@example.com')
|
|
|
188
191
|
|
|
189
192
|
### Full API
|
|
190
193
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
`Git::
|
|
197
|
-
|
|
194
|
+
The quick start and the configuration sections above cover the most common setup.
|
|
195
|
+
The [`Git::Repository`](https://rubydoc.info/gems/git/Git/Repository) reference
|
|
196
|
+
covers everything else: reading history, diffs, branches, remotes, worktrees,
|
|
197
|
+
staging, and low-level index and tree work. It documents every method and the object
|
|
198
|
+
type each one returns (such as `Git::Log`, `Git::Object::Commit`, `Git::Diff`,
|
|
199
|
+
`Git::Branch`, and `Git::Worktree`), so you can follow the links from a method to
|
|
200
|
+
the full API of its result.
|
|
198
201
|
|
|
199
|
-
## Errors
|
|
202
|
+
## Errors raised by this gem
|
|
200
203
|
|
|
201
|
-
The git gem
|
|
202
|
-
|
|
204
|
+
The git gem raises only `ArgumentError` or errors that subclass `Git::Error`. It
|
|
205
|
+
does not explicitly raise any other types of errors.
|
|
203
206
|
|
|
204
|
-
|
|
205
|
-
|
|
207
|
+
Rescue `Git::Error` to catch any runtime error raised by this gem, unless you need
|
|
208
|
+
more specific error handling.
|
|
206
209
|
|
|
207
210
|
```ruby
|
|
208
211
|
begin
|
|
@@ -214,27 +217,25 @@ end
|
|
|
214
217
|
|
|
215
218
|
See [`Git::Error`](https://rubydoc.info/gems/git/Git/Error) for more information.
|
|
216
219
|
|
|
217
|
-
## Specifying and
|
|
220
|
+
## Specifying and handling timeouts
|
|
218
221
|
|
|
219
|
-
|
|
220
|
-
|
|
222
|
+
Set a timeout for git command line operations either globally or per method call for
|
|
223
|
+
methods that accept a `:timeout` parameter.
|
|
221
224
|
|
|
222
|
-
The timeout value must be a real, non-negative `Numeric` value that specifies
|
|
223
|
-
number of seconds a `git` command
|
|
224
|
-
signal. This library may hang if the `git` command does not terminate after
|
|
225
|
-
the KILL signal.
|
|
225
|
+
The timeout value must be a real, non-negative `Numeric` value that specifies the
|
|
226
|
+
number of seconds a `git` command is given to complete before being sent a KILL
|
|
227
|
+
signal. This library may hang if the `git` command does not terminate after
|
|
228
|
+
receiving the KILL signal.
|
|
226
229
|
|
|
227
|
-
When a command times out,
|
|
228
|
-
`Git::TimeoutError
|
|
229
|
-
`Git::Error`.
|
|
230
|
+
When a command times out, the gem kills it with the `SIGKILL` signal and raises a
|
|
231
|
+
`Git::TimeoutError`. This error derives from `Git::SignaledError` and `Git::Error`.
|
|
230
232
|
|
|
231
|
-
If the timeout value is `0` or `nil`, no timeout
|
|
233
|
+
If the timeout value is `0` or `nil`, no timeout is enforced.
|
|
232
234
|
|
|
233
|
-
If a method accepts a `:timeout` parameter and
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
value is.
|
|
235
|
+
If a method accepts a `:timeout` parameter and receives a non-nil value, that value
|
|
236
|
+
overrides the global timeout. In this context, a value of `nil`, which is usually
|
|
237
|
+
the default, uses the global timeout value, and a value of `0` turns off timeout
|
|
238
|
+
enforcement for that method call no matter what the global value is.
|
|
238
239
|
|
|
239
240
|
To set a global timeout, use the `Git.config` object:
|
|
240
241
|
|
|
@@ -254,7 +255,7 @@ Git.clone(repo_url, timeout: 0) # Do not enforce a timeout
|
|
|
254
255
|
Git.clone(repo_url, timeout: 10.5) # Timeout after 10.5 seconds raising Git::TimeoutError
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
If the command takes too long,
|
|
258
|
+
If the command takes too long, the gem raises `Git::TimeoutError`:
|
|
258
259
|
|
|
259
260
|
```ruby
|
|
260
261
|
begin
|
|
@@ -297,22 +298,22 @@ See [the Active Support Deprecation
|
|
|
297
298
|
documentation](https://api.rubyonrails.org/classes/ActiveSupport/Deprecation.html)
|
|
298
299
|
for more details.
|
|
299
300
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
Before upgrading the git gem to the next major version, follow the upgrade procedure
|
|
302
|
+
in [UPGRADING.md](UPGRADING.md#upgrading-to-v600). It turns the warnings into errors so
|
|
303
|
+
that you cannot miss one.
|
|
303
304
|
|
|
304
305
|
For the full list of deprecated methods and their replacements, see
|
|
305
306
|
[UPGRADING.md](UPGRADING.md).
|
|
306
307
|
|
|
307
|
-
## Platform
|
|
308
|
+
## Platform limitations
|
|
308
309
|
|
|
309
|
-
### Regex
|
|
310
|
+
### Regex metacharacters on Git for Windows
|
|
310
311
|
|
|
311
312
|
On Git for Windows, git's regex engine matches **bytes** rather than characters. A
|
|
312
313
|
metacharacter such as `.`, or a POSIX character class such as `[[:alpha:]]`, therefore
|
|
313
314
|
never matches a whole multi-byte character. The same call matches on Linux and macOS.
|
|
314
315
|
|
|
315
|
-
The failure is silent
|
|
316
|
+
The failure is silent. Nothing raises, and the result is indistinguishable from a
|
|
316
317
|
pattern that genuinely does not occur:
|
|
317
318
|
|
|
318
319
|
```ruby
|
|
@@ -340,9 +341,10 @@ repo.full_log_commits(grep: '^.PFEL', perl_regexp: true)
|
|
|
340
341
|
|
|
341
342
|
Two caveats:
|
|
342
343
|
|
|
343
|
-
- **PCRE is a different dialect
|
|
344
|
-
expressions
|
|
345
|
-
|
|
344
|
+
- **PCRE is a different dialect.** Git's other modes are POSIX basic regular
|
|
345
|
+
expressions (the default) and POSIX extended regular expressions (selected
|
|
346
|
+
explicitly). Selecting PCRE is a deliberate choice by the caller, so the gem does
|
|
347
|
+
not substitute it automatically based on the host.
|
|
346
348
|
- **PCRE must be compiled in.** Git for Windows and the mainstream Linux and macOS
|
|
347
349
|
packages ship it, but git built without `USE_LIBPCRE` fails with `cannot use
|
|
348
350
|
Perl-compatible regexes...`.
|
|
@@ -353,23 +355,23 @@ regular expressions with no PCRE mode, so `config_get`, `config_get_all`,
|
|
|
353
355
|
match a metacharacter against a non-ASCII character on Git for Windows. Match on ASCII
|
|
354
356
|
text or an exact value instead.
|
|
355
357
|
|
|
356
|
-
`config_replace_all` deserves particular care, because there the failure is
|
|
357
|
-
empty result. When the value pattern selects nothing, `git config --replace-all`
|
|
358
|
-
the new value as an additional entry rather than replacing one, and exits zero:
|
|
358
|
+
`config_replace_all` deserves particular care, because there the failure is worse than
|
|
359
|
+
an empty result. When the value pattern selects nothing, `git config --replace-all`
|
|
360
|
+
*adds* the new value as an additional entry rather than replacing one, and exits zero:
|
|
359
361
|
|
|
360
362
|
```ruby
|
|
361
363
|
# Existing value of test.desc is 'ÄPFEL sind gut'
|
|
362
364
|
repo.config_replace_all('test.desc', 'NEW', '^.PFEL')
|
|
363
365
|
|
|
364
366
|
repo.config_get_all('test.desc').map(&:value)
|
|
365
|
-
# => ["NEW"] elsewhere
|
|
366
|
-
# => ["ÄPFEL sind gut", "NEW"] on Windows
|
|
367
|
+
# => ["NEW"] elsewhere, replaced as intended
|
|
368
|
+
# => ["ÄPFEL sind gut", "NEW"] on Windows, original kept and duplicate added
|
|
367
369
|
```
|
|
368
370
|
|
|
369
371
|
So a replace can silently leave the original value in place and add a second entry beside
|
|
370
372
|
it. Confirm with `config_get_all` when the key must end up single-valued.
|
|
371
373
|
|
|
372
|
-
## Project
|
|
374
|
+
## Project policies
|
|
373
375
|
|
|
374
376
|
These documents set expectations for behavior, contribution workflows, AI-assisted
|
|
375
377
|
changes, decision making, maintainer roles, and licensing. Please review them before
|
|
@@ -382,11 +384,13 @@ opening issues or pull requests.
|
|
|
382
384
|
| [AI_POLICY](AI_POLICY.md) | AI-assisted contributions are welcome. Contributors are expected to read and apply the AI Policy, and ensure any AI-assisted work meets our quality, security, and licensing standards. |
|
|
383
385
|
| [Ruby version support policy](#ruby-version-support-policy) | Supported Ruby runtimes and platforms; bump decisions and CI coverage expectations. |
|
|
384
386
|
| [Git version support policy](#git-version-support-policy) | Minimum supported git version and how version bumps are communicated and enforced. |
|
|
387
|
+
| [Deprecation policy](#deprecation-policy) | When an API may be removed, what a deprecation warning says, and how to upgrade across a major version. |
|
|
388
|
+
| [Release support policy](#release-support-policy) | Which branch releases what, and how long each major series is supported. |
|
|
385
389
|
| [GOVERNANCE](GOVERNANCE.md) | Principles-first governance defining maintainer/project lead roles, least-privilege access, consensus/majority decisions, and nomination/emeritus steps. |
|
|
386
390
|
| [MAINTAINERS](MAINTAINERS.md) | Lists active maintainers (Project Lead noted) and emeritus alumni with links; see governance for role scope. |
|
|
387
391
|
| [LICENSE](LICENSE) | MIT License terms for using, modifying, and redistributing this project. |
|
|
388
392
|
|
|
389
|
-
### Ruby
|
|
393
|
+
### Ruby version support policy
|
|
390
394
|
|
|
391
395
|
This gem is expected to function correctly on:
|
|
392
396
|
|
|
@@ -395,18 +399,18 @@ This gem is expected to function correctly on:
|
|
|
395
399
|
- The latest version of JRuby 9.4+ on Linux
|
|
396
400
|
- The latest version of TruffleRuby 24+ on Linux
|
|
397
401
|
|
|
398
|
-
|
|
402
|
+
This project intends to support the latest version of JRuby on Windows once
|
|
399
403
|
the [process_executer](https://github.com/main-branch/process_executer) gem properly
|
|
400
404
|
supports subprocess status reporting on JRuby for Windows (see
|
|
401
405
|
[main-branch/process_executer#156](https://github.com/main-branch/process_executer/issues/156)).
|
|
402
406
|
|
|
403
|
-
### Git
|
|
407
|
+
### Git version support policy
|
|
404
408
|
|
|
405
409
|
This gem requires git version 2.28.0 or greater as specified in the gemspec. This
|
|
406
410
|
requirement reflects:
|
|
407
411
|
|
|
408
412
|
- The minimum git version necessary to support all features provided by this gem
|
|
409
|
-
- A reasonable balance between supporting older systems and
|
|
413
|
+
- A reasonable balance between supporting older systems and using modern git
|
|
410
414
|
capabilities
|
|
411
415
|
- The practical limitations of testing across multiple git versions in CI
|
|
412
416
|
|
|
@@ -416,16 +420,68 @@ guaranteed. Users on older git versions should upgrade to at least 2.28.0.
|
|
|
416
420
|
|
|
417
421
|
The supported git version may be increased in future major or minor releases of this
|
|
418
422
|
gem as new git features are adopted or as maintaining backward compatibility becomes
|
|
419
|
-
impractical. Such changes will be
|
|
420
|
-
notes.
|
|
423
|
+
impractical. Such changes will be documented in the CHANGELOG and release notes.
|
|
421
424
|
|
|
422
|
-
|
|
425
|
+
### Deprecation policy
|
|
423
426
|
|
|
424
|
-
|
|
427
|
+
This gem removes an API only in a major release, and only after a normal release
|
|
428
|
+
deprecated it with a runtime warning and documented its replacement in
|
|
429
|
+
[UPGRADING.md](UPGRADING.md). A normal release is one that is not a pre-release. The
|
|
430
|
+
warning names the major release that removes the API once that is decided. Until then
|
|
431
|
+
it says the API will be removed in a future major release.
|
|
425
432
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
433
|
+
The recommended way to upgrade across a major version:
|
|
434
|
+
|
|
435
|
+
1. Upgrade to the latest release of the major series you are on.
|
|
436
|
+
2. Set `GIT_DEPRECATION_BEHAVIOR=raise` (or `Git::Deprecation.behavior = :raise`) in
|
|
437
|
+
your test suite and, if possible, staging.
|
|
438
|
+
3. Fix each deprecation using the entries in [UPGRADING.md](UPGRADING.md) until the
|
|
439
|
+
suite is clean.
|
|
440
|
+
4. Upgrade to the next major release.
|
|
441
|
+
|
|
442
|
+
Because every deprecation warning is present in the last release of a major series,
|
|
443
|
+
this procedure finds every change the next major requires. The version-specific steps
|
|
444
|
+
are in [UPGRADING.md](UPGRADING.md#upgrading-to-v600). See
|
|
445
|
+
[Deprecations](#deprecations) for how to configure the warnings.
|
|
446
|
+
|
|
447
|
+
### Release support policy
|
|
448
|
+
|
|
449
|
+
All development happens on `main`, which releases the next version of the gem,
|
|
450
|
+
including the next major version.
|
|
451
|
+
|
|
452
|
+
The most recent previous major series is maintained on a branch named for that
|
|
453
|
+
series, currently `4.x`. It receives bug fixes and security fixes, and
|
|
454
|
+
backward-compatible features at the maintainers' discretion. Fixes land on `main`
|
|
455
|
+
first and are backported, except a fix for a problem that exists only in the
|
|
456
|
+
maintenance branch, which targets that branch directly.
|
|
457
|
+
|
|
458
|
+
Support for a major series ends when the second major after it is released. v4.x is
|
|
459
|
+
supported until v6.0.0 ships, and v5.x until v7.0.0.
|
|
460
|
+
|
|
461
|
+
## Project announcements
|
|
462
|
+
|
|
463
|
+
### 2026-08-23: v5.x deprecations and the v6.0.0 roadmap
|
|
464
|
+
|
|
465
|
+
The road to v6.0.0 is now planned and public. The remaining ActiveRecord-style
|
|
466
|
+
classes (`Git::Branch`, `Git::Remote`, `Git::Stash`, `Git::Worktree`,
|
|
467
|
+
`Git::Object::Tag`, `Git::Status`, `Git::Author`, and their collections) will be
|
|
468
|
+
deprecated during the v5.x series in favor of the immutable `*Info` value-object
|
|
469
|
+
APIs. v6.0.0 will remove each deprecated class once a normal v5.x release has carried
|
|
470
|
+
its deprecation warning and UPGRADING.md entry, per the
|
|
471
|
+
[Deprecation policy](#deprecation-policy). v6.0.0 will not ship until every planned
|
|
472
|
+
deprecation has shipped that way. v6.0.0 also raises the version floors: git ≥ 2.42.0,
|
|
473
|
+
Ruby ≥ 3.4.
|
|
474
|
+
|
|
475
|
+
[Issue #1717](https://github.com/ruby-git/ruby-git/issues/1717) is the living
|
|
476
|
+
roadmap, tracking scope, sequencing, and status. If your code uses the classes
|
|
477
|
+
above, you can start migrating now. Each deprecation names its replacement, and
|
|
478
|
+
[UPGRADING.md](UPGRADING.md) carries the migration guide as releases ship.
|
|
479
|
+
|
|
480
|
+
### 2026-07-28: v5.0.0 released
|
|
481
|
+
|
|
482
|
+
We have published [`git v5.0.0`](https://rubygems.org/gems/git/versions/5.0.0), the
|
|
483
|
+
first stable release of the v5.x series, after five public beta releases in June and
|
|
484
|
+
July 2026.
|
|
429
485
|
|
|
430
486
|
**v5.0.0 is a major release with breaking changes.** See
|
|
431
487
|
[UPGRADING.md](UPGRADING.md) for the complete migration guide.
|
|
@@ -442,100 +498,85 @@ Or:
|
|
|
442
498
|
gem install git
|
|
443
499
|
```
|
|
444
500
|
|
|
445
|
-
Most v4.x code requires
|
|
446
|
-
|
|
447
|
-
v6.0.0.
|
|
501
|
+
Most v4.x code requires no changes. Compatibility shims keep the old API working
|
|
502
|
+
while emitting deprecation warnings that tell you what to migrate before v6.0.0.
|
|
448
503
|
|
|
449
|
-
### 2026-01-07: AI
|
|
504
|
+
### 2026-01-07: AI policy introduced
|
|
450
505
|
|
|
451
506
|
We have adopted a formal [AI Policy](AI_POLICY.md) to clarify expectations for
|
|
452
507
|
AI-assisted contributions. Please review it before opening a PR to ensure your
|
|
453
508
|
changes are fully understood, meet our quality bar, and respect licensing
|
|
454
509
|
requirements.
|
|
455
510
|
|
|
456
|
-
We chose a principles-based policy to respect contributors
|
|
457
|
-
quick to read
|
|
458
|
-
setting clear expectations.
|
|
459
|
-
|
|
460
|
-
### 2025-07-09: Architectural Redesign
|
|
461
|
-
|
|
462
|
-
The git gem is undergoing a significant architectural redesign for the upcoming
|
|
463
|
-
v5.0.0 release. The current architecture has several design challenges that make it
|
|
464
|
-
difficult to maintain and evolve. This redesign aims to address these issues by
|
|
465
|
-
introducing a clearer, more robust, and more testable structure.
|
|
511
|
+
We chose a principles-based policy to respect contributors' time and expertise. It
|
|
512
|
+
is quick to read and easy to remember, and it still sets clear expectations.
|
|
466
513
|
|
|
467
|
-
|
|
468
|
-
architecture and the proposed changes. We encourage our community and contributors to
|
|
469
|
-
review them:
|
|
514
|
+
### 2025-07-09: Architectural redesign
|
|
470
515
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
3. [Implementation Plan](redesign/3_architecture_implementation.md): The step-by-step
|
|
476
|
-
plan for implementing the redesign.
|
|
516
|
+
On this date we announced an architectural redesign of the git gem. The architecture
|
|
517
|
+
at the time was difficult to maintain and evolve; the redesign replaced it with a
|
|
518
|
+
clearer, more testable three-layer structure of commands, parsers, and a
|
|
519
|
+
`Git::Repository` facade.
|
|
477
520
|
|
|
478
|
-
|
|
479
|
-
|
|
521
|
+
**The redesign shipped in v5.0.0 and is complete.** `Git::Base` and `Git::Lib` are
|
|
522
|
+
gone, along with the `g.lib` accessor. See [UPGRADING.md](UPGRADING.md) for what
|
|
523
|
+
changed and how to migrate.
|
|
480
524
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
documented methods like `g.commit`, `g.add`, and `g.status` should find the
|
|
486
|
-
transition to v5.0.0 straightforward.
|
|
487
|
-
>
|
|
488
|
-
> The breaking changes will primarily affect users who have been relying on the
|
|
489
|
-
internal g.lib accessor, which will be removed as part of this cleanup. For more
|
|
490
|
-
details, please see the "Impact on Users" section in [the redesign
|
|
491
|
-
document](redesign/2_architecture_redesign.md).
|
|
525
|
+
The three documents written to plan it are kept as a historical record in
|
|
526
|
+
[`archive/v5-redesign/`](archive/v5-redesign/). They describe the state of the code
|
|
527
|
+
before and during the migration and are not current policy. The standards that apply
|
|
528
|
+
to new code live in [`.github/skills/`](.github/skills/).
|
|
492
529
|
|
|
493
|
-
|
|
530
|
+
1. [Analysis of the Current Architecture](archive/v5-redesign/1_architecture_existing.md):
|
|
531
|
+
a breakdown of the v4.x design and its challenges.
|
|
532
|
+
2. [The Proposed Redesign](archive/v5-redesign/2_architecture_redesign.md): an overview
|
|
533
|
+
of the three-layer architecture.
|
|
534
|
+
3. [Implementation Plan](archive/v5-redesign/3_architecture_implementation.md): the
|
|
535
|
+
step-by-step plan that was followed.
|
|
494
536
|
|
|
495
|
-
|
|
496
|
-
adopted [RuboCop](https://rubocop.org/) as our static code analyzer and formatter.
|
|
537
|
+
### 2025-07-07: We now use RuboCop
|
|
497
538
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
539
|
+
To improve code consistency and maintainability, the `ruby-git` project has adopted
|
|
540
|
+
[RuboCop](https://rubocop.org/) as our static code analyzer and formatter. All new
|
|
541
|
+
contributions must follow the style guidelines enforced by our RuboCop
|
|
542
|
+
configuration.
|
|
501
543
|
|
|
502
|
-
RuboCop
|
|
544
|
+
Run RuboCop from the project's Rakefile:
|
|
503
545
|
|
|
504
546
|
```shell
|
|
505
547
|
rake rubocop
|
|
506
548
|
```
|
|
507
549
|
|
|
508
|
-
RuboCop
|
|
509
|
-
|
|
550
|
+
RuboCop also runs as part of the default rake task, which our continuous integration
|
|
551
|
+
workflow runs.
|
|
510
552
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
scope possible.
|
|
553
|
+
PRs with RuboCop offenses will not be merged. In rare cases, it might be acceptable
|
|
554
|
+
to disable a RuboCop check for the most limited scope possible.
|
|
514
555
|
|
|
515
|
-
If you have a problem fixing a
|
|
556
|
+
If you have a problem fixing a RuboCop offense, don't be afraid to ask a
|
|
516
557
|
contributor.
|
|
517
558
|
|
|
518
|
-
### 2025-06-06: Default
|
|
559
|
+
### 2025-06-06: Default branch rename
|
|
519
560
|
|
|
520
|
-
On June
|
|
561
|
+
On June 6, 2025, we renamed the default branch from `master` to `main`.
|
|
521
562
|
|
|
522
|
-
Instructions for renaming your local or forked branch to match
|
|
523
|
-
|
|
563
|
+
Instructions for renaming your local or forked branch to match are in the gist
|
|
564
|
+
[Default Branch Name
|
|
524
565
|
Change](https://gist.github.com/jcouball/580a10e395f7fdfaaa4297bbe816cc7d).
|
|
525
566
|
|
|
526
|
-
### 2025-05-15: We've
|
|
567
|
+
### 2025-05-15: We've switched to Conventional Commits
|
|
527
568
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
569
|
+
The `ruby-git` project has adopted the [Conventional Commits
|
|
570
|
+
standard](https://www.conventionalcommits.org/en/v1.0.0/) for all commit messages.
|
|
571
|
+
This enables automated changelog generation and is a step toward continuous
|
|
572
|
+
delivery.
|
|
532
573
|
|
|
533
|
-
|
|
534
|
-
Commits
|
|
535
|
-
|
|
574
|
+
All commits to this repository must follow the Conventional Commits standard.
|
|
575
|
+
Commits that do not follow it will fail the CI build, and PRs that include them will
|
|
576
|
+
not be merged.
|
|
536
577
|
|
|
537
|
-
|
|
538
|
-
|
|
578
|
+
To validate your commit messages locally before pushing them to GitHub, install the
|
|
579
|
+
git `commit-msg` hook by running `bin/setup` in the project root.
|
|
539
580
|
|
|
540
581
|
Read more about this change in the [Commit Message Guidelines section of
|
|
541
|
-
CONTRIBUTING.md](CONTRIBUTING.md#commit-message-guidelines)
|
|
582
|
+
CONTRIBUTING.md](CONTRIBUTING.md#commit-message-guidelines).
|