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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +78 -0
  3. data/CONTRIBUTING.md +202 -169
  4. data/LICENSE +1 -1
  5. data/README.md +192 -151
  6. data/UPGRADING.md +287 -1
  7. data/git.gemspec +35 -3
  8. data/lib/git/author.rb +11 -0
  9. data/lib/git/author_info.rb +66 -0
  10. data/lib/git/branch.rb +210 -15
  11. data/lib/git/branch_info.rb +1 -1
  12. data/lib/git/branches.rb +35 -7
  13. data/lib/git/command_line/base.rb +1 -2
  14. data/lib/git/commands/base.rb +1 -1
  15. data/lib/git/commands/cat_file/raw.rb +62 -7
  16. data/lib/git/object.rb +13 -7
  17. data/lib/git/parsers/stash.rb +50 -17
  18. data/lib/git/parsers/tag.rb +54 -8
  19. data/lib/git/remote.rb +37 -7
  20. data/lib/git/remote_info.rb +67 -10
  21. data/lib/git/repository/branching.rb +190 -6
  22. data/lib/git/repository/merging.rb +96 -2
  23. data/lib/git/repository/remote_operations.rb +57 -0
  24. data/lib/git/repository/shared_private.rb +67 -0
  25. data/lib/git/stash_info.rb +32 -34
  26. data/lib/git/tag_info.rb +21 -29
  27. data/lib/git/version.rb +1 -1
  28. data/lib/git.rb +1 -0
  29. metadata +6 -94
  30. data/.claude/commands/address-copilot-reviews.md +0 -14
  31. data/.claude/settings.json +0 -16
  32. data/.claude/skills +0 -1
  33. data/.commitlintrc.yml +0 -38
  34. data/.dockerignore +0 -27
  35. data/.github/copilot-instructions.md +0 -30
  36. data/.github/hooks/bin-setup-on-worktree.json +0 -11
  37. data/.github/hooks/run-bin-setup-once.sh +0 -20
  38. data/.github/issue_template.md +0 -15
  39. data/.github/prompts/iteratively-address-copilot-reviews.prompt.md +0 -188
  40. data/.github/pull_request_template.md +0 -21
  41. data/.github/skills/breaking-change-analysis/SKILL.md +0 -99
  42. data/.github/skills/ci-cd-troubleshooting/SKILL.md +0 -264
  43. data/.github/skills/command-implementation/REFERENCE.md +0 -994
  44. data/.github/skills/command-implementation/SKILL.md +0 -230
  45. data/.github/skills/command-test-conventions/SKILL.md +0 -664
  46. data/.github/skills/command-yard-documentation/SKILL.md +0 -434
  47. data/.github/skills/dependency-management/SKILL.md +0 -72
  48. data/.github/skills/development-workflow/SKILL.md +0 -512
  49. data/.github/skills/facade-implementation/REFERENCE.md +0 -837
  50. data/.github/skills/facade-implementation/SKILL.md +0 -269
  51. data/.github/skills/facade-test-conventions/SKILL.md +0 -391
  52. data/.github/skills/facade-yard-documentation/SKILL.md +0 -435
  53. data/.github/skills/make-skill-template/SKILL.md +0 -226
  54. data/.github/skills/pr-readiness-review/SKILL.md +0 -205
  55. data/.github/skills/project-context/SKILL.md +0 -306
  56. data/.github/skills/pull-request-review/SKILL.md +0 -168
  57. data/.github/skills/rebase/SKILL.md +0 -148
  58. data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +0 -131
  59. data/.github/skills/release-management/SKILL.md +0 -125
  60. data/.github/skills/resolve-feedback/SKILL.md +0 -288
  61. data/.github/skills/review-arguments-dsl/CHECKLIST.md +0 -788
  62. data/.github/skills/review-arguments-dsl/SKILL.md +0 -214
  63. data/.github/skills/review-cross-command-consistency/SKILL.md +0 -139
  64. data/.github/skills/reviewing-skills/SKILL.md +0 -214
  65. data/.github/skills/rspec-unit-testing-standards/SKILL.md +0 -685
  66. data/.github/skills/tdd-refactor-step/SKILL.md +0 -236
  67. data/.github/skills/test-debugging/SKILL.md +0 -161
  68. data/.github/skills/yard-documentation/SKILL.md +0 -981
  69. data/.github/skills/yard-documentation/element-rules.md +0 -162
  70. data/.github/skills-deprecated/README.md +0 -21
  71. data/.github/skills-deprecated/extract-command-from-lib/SKILL.md +0 -487
  72. data/.github/skills-deprecated/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -22
  73. data/.github/skills-deprecated/extract-facade-from-base-lib/SKILL.md +0 -600
  74. data/.github/skills-deprecated/review-backward-compatibility/SKILL.md +0 -275
  75. data/.github/workflows/continuous_integration.yml +0 -358
  76. data/.github/workflows/enforce_conventional_commits.yml +0 -35
  77. data/.github/workflows/experimental_continuous_integration.yml +0 -59
  78. data/.github/workflows/release.yml +0 -52
  79. data/.github/workflows/warm_bundler_caches.yml +0 -82
  80. data/.gitignore +0 -30
  81. data/.husky/commit-msg +0 -1
  82. data/.husky/pre-commit +0 -13
  83. data/.release-please-config.json +0 -36
  84. data/.release-please-manifest.json +0 -3
  85. data/.rspec +0 -2
  86. data/.rubocop.yml +0 -44
  87. data/.rubocop_todo.yml +0 -30
  88. data/.yard-lint.yml +0 -75
  89. data/CLAUDE.md +0 -11
  90. data/Gemfile +0 -22
  91. data/Rakefile +0 -41
  92. data/docker/test/Dockerfile +0 -32
  93. data/docker/test/docker-compose.yml +0 -0
  94. data/package.json +0 -10
  95. data/redesign/1_architecture_existing.md +0 -102
  96. data/redesign/2_architecture_redesign.md +0 -449
  97. data/redesign/3_architecture_implementation.md +0 -1623
  98. data/redesign/Phase 4 - Step A.md +0 -366
  99. data/redesign/Phase 4 - Step B.md +0 -921
  100. data/redesign/Phase 4 - Step C.md +0 -833
  101. data/redesign/beta_release.md +0 -107
  102. data/redesign/branch_parse_refactor_plan.md +0 -163
  103. data/redesign/c1a-public-api-scope.tsv +0 -256
  104. data/redesign/c1c2_audit.md +0 -566
  105. data/redesign/c1c2_bucket6_lib_orphans.md +0 -626
  106. data/redesign/config_design.rb +0 -501
  107. data/redesign/index.md +0 -34
  108. data/redesign/info_object_migration_plan.md +0 -126
  109. data/redesign/integration_test_analysis.md +0 -521
  110. data/redesign/phase-4-step-b-test-audit.tsv +0 -485
  111. data/redesign/remote_refactor_plan.md +0 -164
  112. data/redesign/reverse_dependencies.sql +0 -44
  113. data/tasks/gem_tasks.rake +0 -14
  114. data/tasks/npm_tasks.rake +0 -7
  115. data/tasks/rspec.rake +0 -111
  116. data/tasks/rubocop.rake +0 -5
  117. data/tasks/test_gem.rake +0 -12
  118. 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 Git Gem
6
+ # The git gem
7
7
 
8
8
  [![Gem Version](https://badge.fury.io/rb/git.svg)](https://badge.fury.io/rb/git)
9
9
  [![Build Status](https://github.com/ruby-git/ruby-git/actions/workflows/continuous_integration.yml/badge.svg)](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 Start](#quick-start)
25
+ - [Quick start](#quick-start)
26
26
  - [Examples](#examples)
27
- - [Gem Configuration](#gem-configuration)
28
- - [Git Configuration](#git-configuration)
27
+ - [Gem configuration](#gem-configuration)
28
+ - [Git configuration](#git-configuration)
29
29
  - [Full API](#full-api)
30
- - [Errors Raised by This Gem](#errors-raised-by-this-gem)
31
- - [Specifying and Handling Timeouts](#specifying-and-handling-timeouts)
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 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
- - [Project Announcements](#project-announcements)
39
- - [2026-07-28: v5.0.0 Released](#2026-07-28-v500-released)
40
- - [2026-01-07: AI Policy Introduced](#2026-01-07-ai-policy-introduced)
41
- - [2025-07-09: Architectural Redesign](#2025-07-09-architectural-redesign)
42
- - [2025-07-07: We Now Use RuboCop](#2025-07-07-we-now-use-rubocop)
43
- - [2025-06-06: Default Branch Rename](#2025-06-06-default-branch-rename)
44
- - [2025-05-15: We've Switched to Conventional Commits](#2025-05-15-weve-switched-to-conventional-commits)
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 started by obtaining a repository object by:
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
- Methods that can be called on a repository object are documented in
61
- [Git::Repository](https://rubydoc.info/gems/git/Git/Repository)
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 Version Support
67
- Policy](#git-version-support-policy) for details.
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 bundler is not being used to manage dependencies, install the gem by executing:
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 Start
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. This module can be used to run
85
- non-repo scoped `git` commands such as `config`.
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. The
89
- `Git::Repository` object is used to run repo-specific `git` commands such as `add`,
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 Configuration
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
- **How SSH configuration is determined:**
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 Configuration
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
- Quick Start and the configuration sections above cover the most common setup. For
192
- the complete set of operations — reading history, diffs, branches, remotes,
193
- worktrees, staging, and low-level index and tree work — see the
194
- [`Git::Repository`](https://rubydoc.info/gems/git/Git/Repository) reference. It
195
- documents every method along with the object types each one returns (such as
196
- `Git::Log`, `Git::Object::Commit`, `Git::Diff`, `Git::Branch`, and `Git::Worktree`),
197
- so you can follow the links from a method to the full API of its result.
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 Raised by This Gem
202
+ ## Errors raised by this gem
200
203
 
201
- The git gem will only raise an `ArgumentError` or an error that is a subclass of
202
- `Git::Error`. It does not explicitly raise any other types of errors.
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
- It is recommended to rescue `Git::Error` to catch any runtime error raised by this
205
- gem unless you need more specific error handling.
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 Handling Timeouts
220
+ ## Specifying and handling timeouts
218
221
 
219
- A timeout for git command line operations can be set either globally or for specific
220
- method calls that accept a `:timeout` parameter.
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 a
223
- number of seconds a `git` command will be given to complete before being sent a KILL
224
- signal. This library may hang if the `git` command does not terminate after receiving
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, it is killed by sending it the `SIGKILL` signal and a
228
- `Git::TimeoutError` is raised. This error derives from the `Git::SignaledError` and
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 will be enforced.
233
+ If the timeout value is `0` or `nil`, no timeout is enforced.
232
234
 
233
- If a method accepts a `:timeout` parameter and a receives a non-nil value, the value
234
- of this parameter will override the global timeout value. In this context, a value of
235
- `nil` (which is usually the default) will use the global timeout value and a value of
236
- `0` will turn off timeout enforcement for that method call no matter what the global
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, a `Git::TimeoutError` will be raised:
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
- If deprecation warnings are silenced, you should reenable them before upgrading the
301
- git gem to the next major version. This will make it easier to identify changes
302
- needed for the upgrade.
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 Limitations
308
+ ## Platform limitations
308
309
 
309
- ### Regex Metacharacters on Git for Windows
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 nothing raises, and the result is indistinguishable from a
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** than git's default POSIX basic/extended regular
344
- expressions. Selecting it is a deliberate choice by the caller, so the gem does not
345
- substitute it automatically based on the host.
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 not merely an
357
- empty result. When the value pattern selects nothing, `git config --replace-all` *adds*
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 replaced, as intended
366
- # => ["ÄPFEL sind gut", "NEW"] on Windows original kept, duplicate added
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 Policies
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 Version Support Policy
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
- It is this project's intent to support the latest version of JRuby on Windows once
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 Version Support Policy
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 leveraging modern git
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 clearly documented in the CHANGELOG and release
420
- notes.
423
+ impractical. Such changes will be documented in the CHANGELOG and release notes.
421
424
 
422
- ## Project Announcements
425
+ ### Deprecation policy
423
426
 
424
- ### 2026-07-28: v5.0.0 Released
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
- We have published [`git v5.0.0`](https://rubygems.org/gems/git/versions/5.0.0)
427
- the first stable release of the v5.x series, after five public beta releases
428
- spanning June–July 2026.
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 **no changes** compatibility shims keep the old API
446
- working while emitting deprecation warnings that tell you what to migrate before
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 Policy Introduced
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 time and expertise. It’s
457
- quick to read, easy to remember, and avoids unnecessary policy overhead while still
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
- We have prepared detailed documents outlining the analysis of the current
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
- 1. [Analysis of the Current Architecture](redesign/1_architecture_existing.md): A
472
- breakdown of the existing design and its challenges.
473
- 2. [The Proposed Redesign](redesign/2_architecture_redesign.md): An overview of the
474
- new three-layered architecture.
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
- Your feedback is welcome! Please feel free to open an issue to discuss the proposed
479
- changes.
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
- > **DON'T PANIC!**
482
- >
483
- > While this is a major internal refactoring, our goal is to keep the primary public
484
- API on the main repository object as stable as possible. Most users who rely on
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
- ### 2025-07-07: We Now Use RuboCop
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
- To improve code consistency and maintainability, the `ruby-git` project has now
496
- adopted [RuboCop](https://rubocop.org/) as our static code analyzer and formatter.
537
+ ### 2025-07-07: We now use RuboCop
497
538
 
498
- This integration is a key part of our ongoing commitment to making `ruby-git` a
499
- high-quality, stable, and easy-to-contribute-to project. All new contributions will
500
- be expected to adhere to the style guidelines enforced by our RuboCop configuration.
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 can be run from the project's Rakefile:
544
+ Run RuboCop from the project's Rakefile:
503
545
 
504
546
  ```shell
505
547
  rake rubocop
506
548
  ```
507
549
 
508
- RuboCop is also run as part of the default rake task (by running `rake`) that is run
509
- in our Continuous Integration workflow.
550
+ RuboCop also runs as part of the default rake task, which our continuous integration
551
+ workflow runs.
510
552
 
511
- Going forward, any PRs that have any Robocop offenses will not be merged. In certain
512
- rare cases, it might be acceptable to disable a RuboCop check for the most limited
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 RuboCop offense, don't be afraid to ask 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 Branch Rename
559
+ ### 2025-06-06: Default branch rename
519
560
 
520
- On June 6th, 2025, the default branch was renamed from 'master' to 'main'.
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 can be found in the
523
- gist [Default Branch Name
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 Switched to Conventional Commits
567
+ ### 2025-05-15: We've switched to Conventional Commits
527
568
 
528
- To enhance our development workflow, enable automated changelog generation, and pave
529
- the way for Continuous Delivery, the `ruby-git` project has adopted the [Conventional
530
- Commits standard](https://www.conventionalcommits.org/en/v1.0.0/) for all commit
531
- messages.
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
- Going forward, all commits to this repository **MUST** adhere to the Conventional
534
- Commits standard. Commits not adhering to this standard will cause the CI build to
535
- fail. PRs will not be merged if they include non-conventional commits.
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
- A git pre-commit hook may be installed to validate your conventional commit messages
538
- before pushing them to GitHub by running `bin/setup` in the project root.
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).