git 2.3.3 → 3.1.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/.commitlintrc.yml +38 -0
- data/.github/pull_request_template.md +1 -1
- data/.github/workflows/continuous_integration.yml +9 -5
- data/.github/workflows/enforce_conventional_commits.yml +28 -0
- data/.github/workflows/experimental_continuous_integration.yml +8 -1
- data/.github/workflows/release.yml +52 -0
- data/.gitignore +3 -0
- data/.husky/commit-msg +1 -0
- data/.release-please-manifest.json +3 -0
- data/.yardopts +0 -1
- data/CHANGELOG.md +65 -0
- data/CONTRIBUTING.md +104 -31
- data/README.md +44 -43
- data/Rakefile +7 -0
- data/git.gemspec +6 -6
- data/lib/git/author.rb +3 -2
- data/lib/git/base.rb +2 -0
- data/lib/git/branch.rb +2 -0
- data/lib/git/branches.rb +15 -14
- data/lib/git/command_line.rb +49 -139
- data/lib/git/config.rb +2 -0
- data/lib/git/diff.rb +2 -0
- data/lib/git/index.rb +2 -1
- data/lib/git/lib.rb +9 -4
- data/lib/git/log.rb +9 -2
- data/lib/git/object.rb +2 -0
- data/lib/git/path.rb +9 -8
- data/lib/git/remote.rb +2 -0
- data/lib/git/repository.rb +2 -0
- data/lib/git/stash.rb +7 -6
- data/lib/git/stashes.rb +11 -10
- data/lib/git/status.rb +3 -1
- data/lib/git/version.rb +3 -1
- data/lib/git/working_directory.rb +2 -0
- data/lib/git/worktree.rb +2 -0
- data/lib/git/worktrees.rb +2 -0
- data/lib/git.rb +2 -0
- data/package.json +10 -0
- data/release-please-config.json +36 -0
- metadata +24 -21
- data/RELEASING.md +0 -85
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ea6b964531a2d91cdc46c4e4c7a6d9f79251f246f2c8856c271b989c6d22800
|
4
|
+
data.tar.gz: 3fd581082807719899cdbe85eea5ca8eca35803402f6822c66bd5b95b27de10b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae34ed0370f1ac66b68c03e13ef16d9415e531f3ebe0b7af906dc6d9150c4fc0eec63da7dde987530f7a24bf17966cb3053b40723e0056c78652763340b8e71c
|
7
|
+
data.tar.gz: ec675f610d8d193dac8c0debca9de1480d154b3d09c34e172dbb0e68d7a47625fdcb7d8bef7a5625e3fef8dfd10e029e1ff682ee033b698beebae43414b3454f
|
data/.commitlintrc.yml
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
extends: '@commitlint/config-conventional'
|
3
|
+
|
4
|
+
rules:
|
5
|
+
# See: https://commitlint.js.org/reference/rules.html
|
6
|
+
#
|
7
|
+
# Rules are made up by a name and a configuration array. The configuration
|
8
|
+
# array contains:
|
9
|
+
#
|
10
|
+
# * Severity [0..2]: 0 disable rule, 1 warning if violated, or 2 error if
|
11
|
+
# violated
|
12
|
+
# * Applicability [always|never]: never inverts the rule
|
13
|
+
# * Value: value to use for this rule (if applicable)
|
14
|
+
#
|
15
|
+
# Run `npx commitlint --print-config` to see the current setting for all
|
16
|
+
# rules.
|
17
|
+
#
|
18
|
+
header-max-length: [2, always, 100] # Header can not exceed 100 chars
|
19
|
+
|
20
|
+
type-case: [2, always, lower-case] # Type must be lower case
|
21
|
+
type-empty: [2, never] # Type must not be empty
|
22
|
+
|
23
|
+
# Supported conventional commit types
|
24
|
+
type-enum: [2, always, [build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test]]
|
25
|
+
|
26
|
+
scope-case: [2, always, lower-case] # Scope must be lower case
|
27
|
+
|
28
|
+
# Error if subject is one of these cases (encourages lower-case)
|
29
|
+
subject-case: [2, never, [sentence-case, start-case, pascal-case, upper-case]]
|
30
|
+
subject-empty: [2, never] # Subject must not be empty
|
31
|
+
subject-full-stop: [2, never, "."] # Subject must not end with a period
|
32
|
+
|
33
|
+
body-leading-blank: [2, always] # Body must have a blank line before it
|
34
|
+
body-max-line-length: [2, always, 100] # Body lines can not exceed 100 chars
|
35
|
+
|
36
|
+
footer-leading-blank: [2, always] # Footer must have a blank line before it
|
37
|
+
footer-max-line-length: [2, always, 100] # Footer lines can not exceed 100 chars
|
38
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Review our [guidelines for contributing](https://github.com/ruby-git/ruby-git/blob/
|
1
|
+
Review our [guidelines for contributing](https://github.com/ruby-git/ruby-git/blob/main/CONTRIBUTING.md) to this repository. A good start is to:
|
2
2
|
|
3
3
|
* Write tests for your changes
|
4
4
|
* Run `rake` before pushing
|
@@ -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: [
|
5
|
+
branches: [main]
|
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 }
|
@@ -18,12 +22,12 @@ jobs:
|
|
18
22
|
fail-fast: false
|
19
23
|
matrix:
|
20
24
|
# Only the latest versions of JRuby and TruffleRuby are tested
|
21
|
-
ruby: ["3.
|
25
|
+
ruby: ["3.1", "3.2", "3.3", "3.4", "truffleruby-24.1.2", "jruby-9.4.12.0"]
|
22
26
|
operating-system: [ubuntu-latest]
|
23
27
|
experimental: [No]
|
24
28
|
include:
|
25
29
|
- # Only test with minimal Ruby version on Windows
|
26
|
-
ruby: 3.
|
30
|
+
ruby: 3.1
|
27
31
|
operating-system: windows-latest
|
28
32
|
|
29
33
|
steps:
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
name: Conventional Commits
|
3
|
+
|
4
|
+
permissions:
|
5
|
+
contents: read
|
6
|
+
|
7
|
+
on:
|
8
|
+
pull_request:
|
9
|
+
branches:
|
10
|
+
- main
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
commit-lint:
|
14
|
+
name: Verify Conventional Commits
|
15
|
+
|
16
|
+
# Skip this job if this is a release PR
|
17
|
+
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- name: Checkout
|
23
|
+
uses: actions/checkout@v4
|
24
|
+
with: { fetch-depth: 0 }
|
25
|
+
|
26
|
+
- name: Check Commit Messages
|
27
|
+
uses: wagoid/commitlint-github-action@v6
|
28
|
+
with: { configFile: .commitlintrc.yml }
|
@@ -2,12 +2,19 @@ name: CI Experimental
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [
|
5
|
+
branches: [main]
|
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 }
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
name: Release Gem
|
3
|
+
|
4
|
+
description: |
|
5
|
+
This workflow creates a new release on GitHub and publishes the gem to
|
6
|
+
RubyGems.org.
|
7
|
+
|
8
|
+
The workflow uses the `googleapis/release-please-action` to handle the
|
9
|
+
release creation process and the `rubygems/release-gem` action to publish
|
10
|
+
the gem to rubygems.org
|
11
|
+
|
12
|
+
on:
|
13
|
+
push:
|
14
|
+
branches: ["main"]
|
15
|
+
|
16
|
+
workflow_dispatch:
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
release:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
|
22
|
+
environment:
|
23
|
+
name: RubyGems
|
24
|
+
url: https://rubygems.org/gems/git
|
25
|
+
|
26
|
+
permissions:
|
27
|
+
contents: write
|
28
|
+
pull-requests: write
|
29
|
+
id-token: write
|
30
|
+
|
31
|
+
steps:
|
32
|
+
- name: Checkout project
|
33
|
+
uses: actions/checkout@v4
|
34
|
+
|
35
|
+
- name: Create release
|
36
|
+
uses: googleapis/release-please-action@v4
|
37
|
+
id: release
|
38
|
+
with:
|
39
|
+
token: ${{ secrets.AUTO_RELEASE_TOKEN }}
|
40
|
+
config-file: release-please-config.json
|
41
|
+
manifest-file: .release-please-manifest.json
|
42
|
+
|
43
|
+
- name: Setup ruby
|
44
|
+
uses: ruby/setup-ruby@v1
|
45
|
+
if: ${{ steps.release.outputs.release_created }}
|
46
|
+
with:
|
47
|
+
bundler-cache: true
|
48
|
+
ruby-version: ruby
|
49
|
+
|
50
|
+
- name: Push to RubyGems.org
|
51
|
+
uses: rubygems/release-gem@v1
|
52
|
+
if: ${{ steps.release.outputs.release_created }}
|
data/.gitignore
CHANGED
data/.husky/commit-msg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
npx --no-install commitlint --edit "$1"
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,71 @@
|
|
5
5
|
|
6
6
|
# Change Log
|
7
7
|
|
8
|
+
## [3.1.1](https://github.com/ruby-git/ruby-git/compare/v3.1.0...v3.1.1) (2025-07-02)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Raise a Git::FailedError if depth < 0 is passed to Git.clone ([803253e](https://github.com/ruby-git/ruby-git/commit/803253ea2dd2b69b099c0d1919b03ac65c800264)), closes [#805](https://github.com/ruby-git/ruby-git/issues/805)
|
14
|
+
|
15
|
+
|
16
|
+
### Other Changes
|
17
|
+
|
18
|
+
* Announce default branch change in README ([e04f08e](https://github.com/ruby-git/ruby-git/commit/e04f08e202ae54286033b4d0a75c47f124bd63e2))
|
19
|
+
* Update the project's default branch from 'master' to 'main' ([a5aa75f](https://github.com/ruby-git/ruby-git/commit/a5aa75fd04a71cd8236b8c8481a067c0a47b24b9))
|
20
|
+
|
21
|
+
## [3.1.0](https://github.com/ruby-git/ruby-git/compare/v3.0.2...v3.1.0) (2025-05-18)
|
22
|
+
|
23
|
+
|
24
|
+
### Features
|
25
|
+
|
26
|
+
* Make Git::Log support the git log --merges option ([df3b07d](https://github.com/ruby-git/ruby-git/commit/df3b07d0f14d79c6c77edc04550c1ad0207c920a))
|
27
|
+
|
28
|
+
|
29
|
+
### Other Changes
|
30
|
+
|
31
|
+
* Announce and document guidelines for using Conventional Commits ([a832259](https://github.com/ruby-git/ruby-git/commit/a832259314aa9c8bdd7719e50d425917df1df831))
|
32
|
+
* Skip continuous integration workflow for release PRs ([f647a18](https://github.com/ruby-git/ruby-git/commit/f647a18c8a3ae78f49c8cd485db4660aa10a92fc))
|
33
|
+
* Skip the experiemental build workflow if a release commit is pushed to master ([3dab0b3](https://github.com/ruby-git/ruby-git/commit/3dab0b34e41393a43437c53a53b96895fd3d2cc5))
|
34
|
+
|
35
|
+
## [3.0.2](https://github.com/ruby-git/ruby-git/compare/v3.0.1...v3.0.2) (2025-05-15)
|
36
|
+
|
37
|
+
|
38
|
+
### Bug Fixes
|
39
|
+
|
40
|
+
* Trigger the release workflow on a change to 'master' insetad of 'main' ([c8611f1](https://github.com/ruby-git/ruby-git/commit/c8611f1e68e73825fd16bd475752a40b0088d4ae))
|
41
|
+
|
42
|
+
|
43
|
+
### Other Changes
|
44
|
+
|
45
|
+
* Automate continuous delivery workflow ([06480e6](https://github.com/ruby-git/ruby-git/commit/06480e65e2441348230ef10e05cc1c563d0e7ea8))
|
46
|
+
* Enforce conventional commit messages with a GitHub action ([1da4c44](https://github.com/ruby-git/ruby-git/commit/1da4c44620a3264d4e837befd3f40416c5d8f1d8))
|
47
|
+
* Enforce conventional commit messages with husky and commitlint ([7ebe0f8](https://github.com/ruby-git/ruby-git/commit/7ebe0f8626ecb2f0da023b903b82f7332d8afaf6))
|
48
|
+
|
49
|
+
## v3.0.1 (2025-05-14)
|
50
|
+
|
51
|
+
[Full Changelog](https://github.com/ruby-git/ruby-git/compare/v3.0.0..v3.0.1)
|
52
|
+
|
53
|
+
Changes since v3.0.0:
|
54
|
+
|
55
|
+
* b47eedc Improved error message of rev_parse
|
56
|
+
* 9d44146 chore: update the development dependency on the minitar gem
|
57
|
+
* f407b92 feat: set the locale to en_US.UTF-8 for git commands
|
58
|
+
* b060e47 test: verify that command line envionment variables are set as expected
|
59
|
+
* 1a5092a chore: release v3.0.0
|
60
|
+
|
61
|
+
## v3.0.0 (2025-02-27)
|
62
|
+
|
63
|
+
[Full Changelog](https://github.com/ruby-git/ruby-git/compare/v2.3.3..v3.0.0)
|
64
|
+
|
65
|
+
Changes since v2.3.3:
|
66
|
+
|
67
|
+
* 534fcf5 chore: use ProcessExecuter.run instead of the implementing it in this gem
|
68
|
+
* 629f3b6 feat: update dependenices
|
69
|
+
* 501d135 feat: add support for Ruby 3.4 and drop support for Ruby 3.0
|
70
|
+
* 38c0eb5 build: update the CI build to use current versions to TruffleRuby and JRuby
|
71
|
+
* d3f3a9d chore: add frozen_string_literal: true magic comment
|
72
|
+
|
8
73
|
## v2.3.3 (2024-12-04)
|
9
74
|
|
10
75
|
[Full Changelog](https://github.com/ruby-git/ruby-git/compare/v2.3.2..v2.3.3)
|
data/CONTRIBUTING.md
CHANGED
@@ -5,28 +5,30 @@
|
|
5
5
|
|
6
6
|
# Contributing to the git gem
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
8
|
+
- [Summary](#summary)
|
9
|
+
- [How to contribute](#how-to-contribute)
|
10
|
+
- [How to report an issue or request a feature](#how-to-report-an-issue-or-request-a-feature)
|
11
|
+
- [How to submit a code or documentation change](#how-to-submit-a-code-or-documentation-change)
|
12
|
+
- [Commit your changes to a fork of `ruby-git`](#commit-your-changes-to-a-fork-of-ruby-git)
|
13
|
+
- [Create a pull request](#create-a-pull-request)
|
14
|
+
- [Get your pull request reviewed](#get-your-pull-request-reviewed)
|
15
|
+
- [Design philosophy](#design-philosophy)
|
16
|
+
- [Direct mapping to git commands](#direct-mapping-to-git-commands)
|
17
|
+
- [Parameter naming](#parameter-naming)
|
18
|
+
- [Output processing](#output-processing)
|
19
|
+
- [Coding standards](#coding-standards)
|
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)
|
23
|
+
- [Unit tests](#unit-tests)
|
24
|
+
- [Continuous integration](#continuous-integration)
|
25
|
+
- [Documentation](#documentation)
|
26
|
+
- [Building a specific version of the Git command-line](#building-a-specific-version-of-the-git-command-line)
|
27
|
+
- [Install pre-requisites](#install-pre-requisites)
|
28
|
+
- [Obtain Git source code](#obtain-git-source-code)
|
29
|
+
- [Build git](#build-git)
|
30
|
+
- [Use the new Git version](#use-the-new-git-version)
|
31
|
+
- [Licensing](#licensing)
|
30
32
|
|
31
33
|
## Summary
|
32
34
|
|
@@ -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
|
|
@@ -153,18 +156,88 @@ behavior.
|
|
153
156
|
To ensure high-quality contributions, all pull requests must meet the following
|
154
157
|
requirements:
|
155
158
|
|
156
|
-
###
|
159
|
+
### Commit message guidelines
|
157
160
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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.
|
165
|
+
|
166
|
+
This structured approach to commit messages allows us to:
|
167
|
+
|
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.
|
175
|
+
|
176
|
+
#### What does this mean for contributors?
|
177
|
+
|
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.
|
182
|
+
|
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.
|
163
236
|
|
164
237
|
### Unit tests
|
165
238
|
|
166
|
-
|
167
|
-
|
239
|
+
- All changes must be accompanied by new or modified unit tests.
|
240
|
+
- The entire test suite must pass when `bundle exec rake default` is run from the
|
168
241
|
project's local working copy.
|
169
242
|
|
170
243
|
While working on specific features, you can run individual test files or a group of
|
data/README.md
CHANGED
@@ -8,18 +8,44 @@
|
|
8
8
|
[](https://badge.fury.io/rb/git)
|
9
9
|
[](https://rubydoc.info/gems/git/)
|
10
10
|
[](https://rubydoc.info/gems/git/file/CHANGELOG.md)
|
11
|
-
[](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
|
12
|
+
[](https://conventionalcommits.org)
|
13
|
+
|
14
|
+
- [📢 Default Branch Rename 📢](#-default-branch-rename-)
|
15
|
+
- [📢 We've Switched to Conventional Commits 📢](#-weve-switched-to-conventional-commits-)
|
16
|
+
- [Summary](#summary)
|
17
|
+
- [Install](#install)
|
18
|
+
- [Major Objects](#major-objects)
|
19
|
+
- [Errors Raised By This Gem](#errors-raised-by-this-gem)
|
20
|
+
- [Specifying And Handling Timeouts](#specifying-and-handling-timeouts)
|
21
|
+
- [Examples](#examples)
|
22
|
+
- [Ruby version support policy](#ruby-version-support-policy)
|
23
|
+
- [License](#license)
|
24
|
+
|
25
|
+
## 📢 Default Branch Rename 📢
|
26
|
+
|
27
|
+
On June 6th, 2025, the default branch was renamed from 'master' to 'main'.
|
28
|
+
|
29
|
+
Instructions for renaming your local or forked branch to match can be found in the
|
30
|
+
gist [Default Branch Name
|
31
|
+
Change](https://gist.github.com/jcouball/580a10e395f7fdfaaa4297bbe816cc7d).
|
32
|
+
|
33
|
+
## 📢 We've Switched to Conventional Commits 📢
|
34
|
+
|
35
|
+
To enhance our development workflow, enable automated changelog generation, and pave
|
36
|
+
the way for Continuous Delivery, the `ruby-git` project has adopted the [Conventional
|
37
|
+
Commits standard](https://www.conventionalcommits.org/en/v1.0.0/) for all commit
|
38
|
+
messages.
|
39
|
+
|
40
|
+
Going forward, all commits to this repository **MUST** adhere to the Conventional
|
41
|
+
Commits standard. Commits not adhering to this standard will cause the CI build to
|
42
|
+
fail. PRs will not be merged if they include non-conventional commits.
|
43
|
+
|
44
|
+
A git pre-commit hook may be installed to validate your conventional commit messages
|
45
|
+
before pushing them to GitHub by running `bin/setup` in the project root.
|
46
|
+
|
47
|
+
Read more about this change in the [Commit Message Guidelines section of
|
48
|
+
CONTRIBUTING.md](CONTRIBUTING.md#commit-message-guidelines)
|
23
49
|
|
24
50
|
## Summary
|
25
51
|
|
@@ -34,31 +60,6 @@ Get started by obtaining a repository object by:
|
|
34
60
|
|
35
61
|
Methods that can be called on a repository object are documented in [Git::Base](https://rubydoc.info/gems/git/Git/Base)
|
36
62
|
|
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
63
|
## Install
|
63
64
|
|
64
65
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -283,8 +284,8 @@ g.branches # returns Git::Branch objects
|
|
283
284
|
g.branches.local
|
284
285
|
g.current_branch
|
285
286
|
g.branches.remote
|
286
|
-
g.branches[:
|
287
|
-
g.branches['origin/
|
287
|
+
g.branches[:main].gcommit
|
288
|
+
g.branches['origin/main'].gcommit
|
288
289
|
|
289
290
|
g.grep('hello') # implies HEAD
|
290
291
|
g.blob('v2.5:Makefile').grep('hello')
|
@@ -341,7 +342,7 @@ Git.ls_remote('https://github.com/ruby-git/ruby-git.git') # returns a hash conta
|
|
341
342
|
Git.ls_remote('/path/to/local/repo')
|
342
343
|
Git.ls_remote() # same as Git.ls_remote('.')
|
343
344
|
|
344
|
-
Git.default_branch('https://github.com/ruby-git/ruby-git') #=> '
|
345
|
+
Git.default_branch('https://github.com/ruby-git/ruby-git') #=> 'main'
|
345
346
|
```
|
346
347
|
|
347
348
|
And here are the operations that will need to write to your git repository.
|
@@ -414,13 +415,13 @@ g.branch('new_branch') # creates new or fetches existing
|
|
414
415
|
g.branch('new_branch').checkout
|
415
416
|
g.branch('new_branch').delete
|
416
417
|
g.branch('existing_branch').checkout
|
417
|
-
g.branch('
|
418
|
+
g.branch('main').contains?('existing_branch')
|
418
419
|
|
419
420
|
# delete remote branch
|
420
421
|
g.push('origin', 'remote_branch_name', force: true, delete: true)
|
421
422
|
|
422
423
|
g.checkout('new_branch')
|
423
|
-
g.checkout('new_branch', new_branch: true, start_point: '
|
424
|
+
g.checkout('new_branch', new_branch: true, start_point: 'main')
|
424
425
|
g.checkout(g.branch('new_branch'))
|
425
426
|
|
426
427
|
g.branch(name).merge(branch2)
|
@@ -430,7 +431,7 @@ g.branch(name).in_branch(message) { # add files } # auto-commits
|
|
430
431
|
g.merge('new_branch')
|
431
432
|
g.merge('new_branch', 'merge commit message', no_ff: true)
|
432
433
|
g.merge('origin/remote_branch')
|
433
|
-
g.merge(g.branch('
|
434
|
+
g.merge(g.branch('main'))
|
434
435
|
g.merge([branch1, branch2])
|
435
436
|
|
436
437
|
g.merge_base('branch1', 'branch2')
|
data/Rakefile
CHANGED
@@ -58,3 +58,10 @@ task :'test:gem' => :install do
|
|
58
58
|
|
59
59
|
puts 'Gem Test Succeeded'
|
60
60
|
end
|
61
|
+
|
62
|
+
# Make it so that calling `rake release` just calls `rake release:rubygem_push` to
|
63
|
+
# avoid creating and pushing a new tag.
|
64
|
+
|
65
|
+
Rake::Task['release'].clear
|
66
|
+
desc 'Customized release task to avoid creating a new tag'
|
67
|
+
task release: 'release:rubygem_push'
|
data/git.gemspec
CHANGED
@@ -29,13 +29,13 @@ Gem::Specification.new do |s|
|
|
29
29
|
|
30
30
|
s.add_runtime_dependency 'activesupport', '>= 5.0'
|
31
31
|
s.add_runtime_dependency 'addressable', '~> 2.8'
|
32
|
-
s.add_runtime_dependency 'process_executer', '~> 1.
|
33
|
-
s.add_runtime_dependency 'rchardet', '~> 1.
|
32
|
+
s.add_runtime_dependency 'process_executer', '~> 1.3'
|
33
|
+
s.add_runtime_dependency 'rchardet', '~> 1.9'
|
34
34
|
|
35
|
-
s.add_development_dependency 'create_github_release', '~> 1
|
36
|
-
s.add_development_dependency 'minitar', '~> 0
|
37
|
-
s.add_development_dependency 'mocha', '~> 2.
|
38
|
-
s.add_development_dependency 'rake', '~> 13.
|
35
|
+
s.add_development_dependency 'create_github_release', '~> 2.1'
|
36
|
+
s.add_development_dependency 'minitar', '~> 1.0'
|
37
|
+
s.add_development_dependency 'mocha', '~> 2.7'
|
38
|
+
s.add_development_dependency 'rake', '~> 13.2'
|
39
39
|
s.add_development_dependency 'test-unit', '~> 3.6'
|
40
40
|
|
41
41
|
unless RUBY_PLATFORM == 'java'
|
data/lib/git/author.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Git
|
2
4
|
class Author
|
3
5
|
attr_accessor :name, :email, :date
|
4
|
-
|
6
|
+
|
5
7
|
def initialize(author_string)
|
6
8
|
if m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
|
7
9
|
@name = m[1]
|
@@ -9,6 +11,5 @@ module Git
|
|
9
11
|
@date = Time.at(m[3].to_i)
|
10
12
|
end
|
11
13
|
end
|
12
|
-
|
13
14
|
end
|
14
15
|
end
|
data/lib/git/base.rb
CHANGED