git 3.0.2 → 3.1.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/.github/workflows/continuous_integration.yml +7 -3
- data/.github/workflows/experimental_continuous_integration.yml +8 -1
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +14 -0
- data/CONTRIBUTING.md +74 -13
- data/README.md +28 -36
- data/lib/git/lib.rb +2 -0
- data/lib/git/log.rb +7 -2
- 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: 511ce73ebd49de3ef2985b430f6aef69828bef58f15f4272ff835328b1275fc3
|
4
|
+
data.tar.gz: a223cc03fef4b9968b5ff30ba2521ab841e9c4e15e311dbb7d94bec16b466373
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bb93e9a89b396c30ed1ce535baa972a9d52a9c8afe63cbdee55520881cb9d0921eb85cea447779ee78469812a3b939de8a9a47a10996f47502e8bf1bd9cdb05
|
7
|
+
data.tar.gz: d9b075c42d95fd121986e3a79fc87acbd634aefa06228a139104ac189c7258351ee88a4607638184d92f03668d67253412b39d50a9a8994c63943b38353d2f8a
|
@@ -1,15 +1,19 @@
|
|
1
1
|
name: CI
|
2
2
|
|
3
3
|
on:
|
4
|
-
push:
|
5
|
-
branches: [master,v1]
|
6
4
|
pull_request:
|
7
|
-
branches: [master
|
5
|
+
branches: [master]
|
8
6
|
workflow_dispatch:
|
9
7
|
|
10
8
|
jobs:
|
11
9
|
build:
|
12
10
|
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
|
11
|
+
|
12
|
+
# Skip this job if triggered by a release PR
|
13
|
+
if: >-
|
14
|
+
github.event_name == 'workflow_dispatch' ||
|
15
|
+
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
|
16
|
+
|
13
17
|
runs-on: ${{ matrix.operating-system }}
|
14
18
|
continue-on-error: ${{ matrix.experimental == 'Yes' }}
|
15
19
|
env: { JAVA_OPTS: -Djdk.io.File.enableADS=true }
|
@@ -2,12 +2,19 @@ name: CI Experimental
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [master
|
5
|
+
branches: [master]
|
6
|
+
|
6
7
|
workflow_dispatch:
|
7
8
|
|
8
9
|
jobs:
|
9
10
|
build:
|
10
11
|
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
|
12
|
+
|
13
|
+
# Skip this job if triggered by pushing a release commit
|
14
|
+
if: >-
|
15
|
+
github.event_name == 'workflow_dispatch' ||
|
16
|
+
(github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore: release '))
|
17
|
+
|
11
18
|
runs-on: ${{ matrix.operating-system }}
|
12
19
|
continue-on-error: true
|
13
20
|
env: { JAVA_OPTS: -Djdk.io.File.enableADS=true }
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,20 @@
|
|
5
5
|
|
6
6
|
# Change Log
|
7
7
|
|
8
|
+
## [3.1.0](https://github.com/ruby-git/ruby-git/compare/v3.0.2...v3.1.0) (2025-05-18)
|
9
|
+
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
* Make Git::Log support the git log --merges option ([df3b07d](https://github.com/ruby-git/ruby-git/commit/df3b07d0f14d79c6c77edc04550c1ad0207c920a))
|
14
|
+
|
15
|
+
|
16
|
+
### Other Changes
|
17
|
+
|
18
|
+
* Announce and document guidelines for using Conventional Commits ([a832259](https://github.com/ruby-git/ruby-git/commit/a832259314aa9c8bdd7719e50d425917df1df831))
|
19
|
+
* Skip continuous integration workflow for release PRs ([f647a18](https://github.com/ruby-git/ruby-git/commit/f647a18c8a3ae78f49c8cd485db4660aa10a92fc))
|
20
|
+
* Skip the experiemental build workflow if a release commit is pushed to master ([3dab0b3](https://github.com/ruby-git/ruby-git/commit/3dab0b34e41393a43437c53a53b96895fd3d2cc5))
|
21
|
+
|
8
22
|
## [3.0.2](https://github.com/ruby-git/ruby-git/compare/v3.0.1...v3.0.2) (2025-05-15)
|
9
23
|
|
10
24
|
|
data/CONTRIBUTING.md
CHANGED
@@ -18,6 +18,8 @@
|
|
18
18
|
- [Output processing](#output-processing)
|
19
19
|
- [Coding standards](#coding-standards)
|
20
20
|
- [Commit message guidelines](#commit-message-guidelines)
|
21
|
+
- [What does this mean for contributors?](#what-does-this-mean-for-contributors)
|
22
|
+
- [What to know about Conventional Commits](#what-to-know-about-conventional-commits)
|
21
23
|
- [Unit tests](#unit-tests)
|
22
24
|
- [Continuous integration](#continuous-integration)
|
23
25
|
- [Documentation](#documentation)
|
@@ -63,7 +65,8 @@ thoroughly as possible to describe the issue or feature request.
|
|
63
65
|
There is a three-step process for submitting code or documentation changes:
|
64
66
|
|
65
67
|
1. [Commit your changes to a fork of
|
66
|
-
`ruby-git`](#commit-your-changes-to-a-fork-of-ruby-git)
|
68
|
+
`ruby-git`](#commit-your-changes-to-a-fork-of-ruby-git) using [Conventional
|
69
|
+
Commits](#commit-message-guidelines)
|
67
70
|
2. [Create a pull request](#create-a-pull-request)
|
68
71
|
3. [Get your pull request reviewed](#get-your-pull-request-reviewed)
|
69
72
|
|
@@ -155,23 +158,81 @@ requirements:
|
|
155
158
|
|
156
159
|
### Commit message guidelines
|
157
160
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
161
|
+
To enhance our development workflow, enable automated changelog generation, and pave
|
162
|
+
the way for Continuous Delivery, the `ruby-git` project has adopted the [Conventional
|
163
|
+
Commits standard](https://www.conventionalcommits.org/en/v1.0.0/) for all commit
|
164
|
+
messages.
|
162
165
|
|
163
|
-
|
166
|
+
This structured approach to commit messages allows us to:
|
164
167
|
|
165
|
-
-
|
168
|
+
- **Automate versioning and releases:** Tools can now automatically determine the
|
169
|
+
semantic version bump (patch, minor, major) based on the types of commits merged.
|
170
|
+
- **Generate accurate changelogs:** We can automatically create and update a
|
171
|
+
`CHANGELOG.md` file, providing a clear history of changes for users and
|
172
|
+
contributors.
|
173
|
+
- **Improve commit history readability:** A standardized format makes it easier for
|
174
|
+
everyone to understand the nature of changes at a glance.
|
166
175
|
|
167
|
-
|
168
|
-
`npm install`.
|
176
|
+
#### What does this mean for contributors?
|
169
177
|
|
170
|
-
|
171
|
-
|
178
|
+
Going forward, all commits to this repository **MUST** adhere to the [Conventional
|
179
|
+
Commits standard](https://www.conventionalcommits.org/en/v1.0.0/). Commits not
|
180
|
+
adhering to this standard will cause the CI build to fail. PRs will not be merged if
|
181
|
+
they include non-conventional commits.
|
172
182
|
|
173
|
-
|
174
|
-
|
183
|
+
A git pre-commit hook may be installed to validate your conventional commit messages
|
184
|
+
before pushing them to GitHub by running `bin/setup` in the project root.
|
185
|
+
|
186
|
+
#### What to know about Conventional Commits
|
187
|
+
|
188
|
+
The simplist conventional commit is in the form `type: description` where `type`
|
189
|
+
indicates the type of change and `description` is your usual commit message (with
|
190
|
+
some limitations).
|
191
|
+
|
192
|
+
- Types include: `feat`, `fix`, `docs`, `test`, `refactor`, and `chore`. See the full
|
193
|
+
list of types supported in [.commitlintrc.yml](.commitlintrc.yml).
|
194
|
+
- The description must (1) not start with an upper case letter, (2) be no more than
|
195
|
+
100 characters, and (3) not end with punctuation.
|
196
|
+
|
197
|
+
Examples of valid commits:
|
198
|
+
|
199
|
+
- `feat: add the --merges option to Git::Lib.log`
|
200
|
+
- `fix: exception thrown by Git::Lib.log when repo has no commits`
|
201
|
+
- `docs: add conventional commit announcement to README.md`
|
202
|
+
|
203
|
+
Commits that include breaking changes must include an exclaimation mark before the
|
204
|
+
colon:
|
205
|
+
|
206
|
+
- `feat!: removed Git::Base.commit_force`
|
207
|
+
|
208
|
+
The commit messages will drive how the version is incremented for each release:
|
209
|
+
|
210
|
+
- a release containing a **breaking change** will do a **major** version increment
|
211
|
+
- a release containing a **new feature** will do a **minor** increment
|
212
|
+
- a release containing **neither a breaking change nor a new feature** will do a
|
213
|
+
**patch** version increment
|
214
|
+
|
215
|
+
The full conventional commit format is:
|
216
|
+
|
217
|
+
```text
|
218
|
+
<type>[optional scope][!]: <description>
|
219
|
+
|
220
|
+
[optional body]
|
221
|
+
|
222
|
+
[optional footer(s)]
|
223
|
+
```
|
224
|
+
|
225
|
+
- `optional body` may include multiple lines of descriptive text limited to 100 chars
|
226
|
+
each
|
227
|
+
- `optional footers` only uses `BREAKING CHANGE: <description>` where description
|
228
|
+
should describe the nature of the backward incompatibility.
|
229
|
+
|
230
|
+
Use of the `BREAKING CHANGE:` footer flags a backward incompatible change even if it
|
231
|
+
is not flagged with an exclaimation mark after the `type`. Other footers are allowed
|
232
|
+
by not acted upon.
|
233
|
+
|
234
|
+
See [the Conventional Commits
|
235
|
+
specification](https://www.conventionalcommits.org/en/v1.0.0/) for more details.
|
175
236
|
|
176
237
|
### Unit tests
|
177
238
|
|
data/README.md
CHANGED
@@ -9,17 +9,34 @@
|
|
9
9
|
[](https://rubydoc.info/gems/git/)
|
10
10
|
[](https://rubydoc.info/gems/git/file/CHANGELOG.md)
|
11
11
|
[](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
|
12
|
-
[](https://conventionalcommits.org)
|
13
|
+
|
14
|
+
- [📢 We've Switched to Conventional Commits 📢](#-weve-switched-to-conventional-commits-)
|
15
|
+
- [Summary](#summary)
|
16
|
+
- [Install](#install)
|
17
|
+
- [Major Objects](#major-objects)
|
18
|
+
- [Errors Raised By This Gem](#errors-raised-by-this-gem)
|
19
|
+
- [Specifying And Handling Timeouts](#specifying-and-handling-timeouts)
|
20
|
+
- [Examples](#examples)
|
21
|
+
- [Ruby version support policy](#ruby-version-support-policy)
|
22
|
+
- [License](#license)
|
23
|
+
|
24
|
+
## 📢 We've Switched to Conventional Commits 📢
|
25
|
+
|
26
|
+
To enhance our development workflow, enable automated changelog generation, and pave
|
27
|
+
the way for Continuous Delivery, the `ruby-git` project has adopted the [Conventional
|
28
|
+
Commits standard](https://www.conventionalcommits.org/en/v1.0.0/) for all commit
|
29
|
+
messages.
|
30
|
+
|
31
|
+
Going forward, all commits to this repository **MUST** adhere to the Conventional
|
32
|
+
Commits standard. Commits not adhering to this standard will cause the CI build to
|
33
|
+
fail. PRs will not be merged if they include non-conventional commits.
|
34
|
+
|
35
|
+
A git pre-commit hook may be installed to validate your conventional commit messages
|
36
|
+
before pushing them to GitHub by running `bin/setup` in the project root.
|
37
|
+
|
38
|
+
Read more about this change in the [Commit Message Guidelines section of
|
39
|
+
CONTRIBUTING.md](CONTRIBUTING.md#commit-message-guidelines)
|
23
40
|
|
24
41
|
## Summary
|
25
42
|
|
@@ -34,31 +51,6 @@ Get started by obtaining a repository object by:
|
|
34
51
|
|
35
52
|
Methods that can be called on a repository object are documented in [Git::Base](https://rubydoc.info/gems/git/Git/Base)
|
36
53
|
|
37
|
-
## v2.x Release
|
38
|
-
|
39
|
-
git 2.0.0 has recently been released. Please give it a try.
|
40
|
-
|
41
|
-
**If you have problems with the 2.x release, open an issue and use the 1.x version
|
42
|
-
instead.** We will do our best to fix your issues in a timely fashion.
|
43
|
-
|
44
|
-
**JRuby on Windows is not yet supported by the 2.x release line. Users running JRuby
|
45
|
-
on Windows should continue to use the 1.x release line.**
|
46
|
-
|
47
|
-
The changes in this major release include:
|
48
|
-
|
49
|
-
* Added a dependency on the activesupport gem to use the deprecation functionality
|
50
|
-
* Create a policy of supported Ruby versions to support only non-EOL Ruby versions
|
51
|
-
* Create a policy of supported Git CLI versions (released 2020-12-25)
|
52
|
-
* Update the required Ruby version to at least 3.0 (released 2020-07-27)
|
53
|
-
* Update the required Git command line version to at least 2.28
|
54
|
-
* Update how CLI commands are called to use the [process_executer](https://github.com/main-branch/process_executer)
|
55
|
-
gem which is built on top of [Kernel.spawn](https://ruby-doc.org/3.3.0/Kernel.html#method-i-spawn).
|
56
|
-
See [PR #684](https://github.com/ruby-git/ruby-git/pull/684) for more details
|
57
|
-
on the motivation for this implementation.
|
58
|
-
|
59
|
-
The `master` branch will be used for `2.x` development. If needed, fixes for `1.x`
|
60
|
-
version will be done on the `v1` branch.
|
61
|
-
|
62
54
|
## Install
|
63
55
|
|
64
56
|
Install the gem and add to the application's Gemfile by executing:
|
data/lib/git/lib.rb
CHANGED
@@ -294,6 +294,7 @@ module Git
|
|
294
294
|
# * 'tree' [String] the tree sha
|
295
295
|
# * 'author' [String] the author of the commit and timestamp of when the changes were created
|
296
296
|
# * 'committer' [String] the committer of the commit and timestamp of when the commit was applied
|
297
|
+
# * 'merges' [Boolean] if truthy, only include merge commits (aka commits with 2 or more parents)
|
297
298
|
#
|
298
299
|
# @raise [ArgumentError] if the revision range (specified with :between or :object) is a string starting with a hyphen
|
299
300
|
#
|
@@ -305,6 +306,7 @@ module Git
|
|
305
306
|
|
306
307
|
arr_opts << '--pretty=raw'
|
307
308
|
arr_opts << "--skip=#{opts[:skip]}" if opts[:skip]
|
309
|
+
arr_opts << '--merges' if opts[:merges]
|
308
310
|
|
309
311
|
arr_opts += log_path_options(opts)
|
310
312
|
|
data/lib/git/log.rb
CHANGED
@@ -133,11 +133,16 @@ module Git
|
|
133
133
|
return self
|
134
134
|
end
|
135
135
|
|
136
|
+
def merges
|
137
|
+
dirty_log
|
138
|
+
@merges = true
|
139
|
+
return self
|
140
|
+
end
|
141
|
+
|
136
142
|
def to_s
|
137
143
|
self.map { |c| c.to_s }.join("\n")
|
138
144
|
end
|
139
145
|
|
140
|
-
|
141
146
|
# forces git log to run
|
142
147
|
|
143
148
|
def size
|
@@ -184,7 +189,7 @@ module Git
|
|
184
189
|
log = @base.lib.full_log_commits(
|
185
190
|
count: @max_count, all: @all, object: @object, path_limiter: @path, since: @since,
|
186
191
|
author: @author, grep: @grep, skip: @skip, until: @until, between: @between,
|
187
|
-
cherry: @cherry
|
192
|
+
cherry: @cherry, merges: @merges
|
188
193
|
)
|
189
194
|
@commits = log.map { |c| Git::Object::Commit.new(@base, c['sha'], c) }
|
190
195
|
end
|
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: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Chacon and others
|
@@ -248,8 +248,8 @@ licenses:
|
|
248
248
|
metadata:
|
249
249
|
homepage_uri: http://github.com/ruby-git/ruby-git
|
250
250
|
source_code_uri: http://github.com/ruby-git/ruby-git
|
251
|
-
changelog_uri: https://rubydoc.info/gems/git/3.0
|
252
|
-
documentation_uri: https://rubydoc.info/gems/git/3.0
|
251
|
+
changelog_uri: https://rubydoc.info/gems/git/3.1.0/file/CHANGELOG.md
|
252
|
+
documentation_uri: https://rubydoc.info/gems/git/3.1.0
|
253
253
|
rdoc_options: []
|
254
254
|
require_paths:
|
255
255
|
- lib
|