ruby_git 0.1.3 → 0.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/.commitlintrc.yml +16 -0
- data/.github/CODEOWNERS +4 -0
- data/.github/workflows/continuous_integration.yml +87 -0
- data/.github/workflows/enforce_conventional_commits.yml +21 -0
- data/.github/workflows/experimental_ruby_builds.yml +65 -0
- data/.gitignore +3 -0
- data/.husky/commit-msg +1 -0
- data/.markdownlint.yml +25 -0
- data/.rubocop.yml +13 -15
- data/.yardopts +6 -1
- data/CHANGELOG.md +76 -20
- data/CONTRIBUTING.md +7 -7
- data/{LICENSE.md → LICENSE.txt} +1 -1
- data/PLAN.md +67 -0
- data/README.md +64 -10
- data/RELEASING.md +5 -54
- data/Rakefile +31 -38
- data/RubyGit Class Diagram.svg +1 -0
- data/bin/command-line-test +189 -0
- data/bin/console +2 -0
- data/bin/setup +13 -2
- data/lib/ruby_git/command_line/options.rb +61 -0
- data/lib/ruby_git/command_line/result.rb +155 -0
- data/lib/ruby_git/command_line/runner.rb +296 -0
- data/lib/ruby_git/command_line.rb +95 -0
- data/lib/ruby_git/encoding_normalizer.rb +49 -0
- data/lib/ruby_git/errors.rb +169 -0
- data/lib/ruby_git/repository.rb +33 -0
- data/lib/ruby_git/status/branch.rb +92 -0
- data/lib/ruby_git/status/entry.rb +162 -0
- data/lib/ruby_git/status/ignored_entry.rb +44 -0
- data/lib/ruby_git/status/ordinary_entry.rb +207 -0
- data/lib/ruby_git/status/parser.rb +203 -0
- data/lib/ruby_git/status/renamed_entry.rb +257 -0
- data/lib/ruby_git/status/report.rb +143 -0
- data/lib/ruby_git/status/stash.rb +33 -0
- data/lib/ruby_git/status/submodule_status.rb +85 -0
- data/lib/ruby_git/status/unmerged_entry.rb +248 -0
- data/lib/ruby_git/status/untracked_entry.rb +52 -0
- data/lib/ruby_git/status.rb +33 -0
- data/lib/ruby_git/version.rb +1 -1
- data/lib/ruby_git/worktree.rb +277 -0
- data/lib/ruby_git.rb +154 -14
- data/package.json +11 -0
- data/ruby_git.gemspec +32 -20
- metadata +146 -45
- data/.travis.yml +0 -13
- data/MAINTAINERS.md +0 -8
- data/lib/ruby_git/file_helpers.rb +0 -42
- data/lib/ruby_git/git_binary.rb +0 -90
- /data/{ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md} +0 -0
- /data/{PULL_REQUEST_TEMPLATE.md → .github/PULL_REQUEST_TEMPLATE.md} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6dbaeff8a7d5e9221fb6dd0fca372582640f7d61a845287a5e33bdeaa2ac5f4a
|
|
4
|
+
data.tar.gz: 2264c19addc654a35a89b87fba4c13a12b05acd5e0061d9bfe80237b1732867d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d086389925d5a852f5adc0bd8a21176ea063135ca6392503babf7624685eefc551758a273c2d3509eb75c2c5f2bf224fbce8a2cf61fbcbdc3ff0078c7f323c8
|
|
7
|
+
data.tar.gz: 66cd76a662df89a8d6f74dac76c8711cbcc2d36ea3f1bba349f341a05584d4359929ace7bf950807997f53e5f2af652353378d5cb3bcee795cb01c125fd13830
|
data/.commitlintrc.yml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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 array contains:
|
|
8
|
+
#
|
|
9
|
+
# * Severity [0..2]: 0 disable rule, 1 warning if violated, or 2 error if violated
|
|
10
|
+
# * Applicability [always|never]: never inverts the rule
|
|
11
|
+
# * Value: value to use for this rule
|
|
12
|
+
#
|
|
13
|
+
# Run `npx commitlint --print-config` to see the current setting for all rules.
|
|
14
|
+
#
|
|
15
|
+
body-leading-blank: [2, 'always']
|
|
16
|
+
footer-leading-blank: [2, 'always']
|
data/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: Continuous Integration
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
# SimpleCov suggests setting the JRuby --debug flag to ensure that coverage
|
|
14
|
+
# results from JRuby are complete.
|
|
15
|
+
JRUBY_OPTS: --debug
|
|
16
|
+
GIT_AUTHOR_NAME: Git Author
|
|
17
|
+
GIT_AUTHOR_EMAIL: git_author@example.com
|
|
18
|
+
GIT_COMMITTER_NAME: Git Committer
|
|
19
|
+
GIT_COMMITTER_EMAIL: git_committer@example.com
|
|
20
|
+
|
|
21
|
+
# Supported platforms / Ruby versions:
|
|
22
|
+
# - Ubuntu: MRI (3.1, 3.2, 3.3, 3.4), TruffleRuby (24), JRuby (9.4)
|
|
23
|
+
# - Windows: MRI (3.1)
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
build:
|
|
27
|
+
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
|
|
28
|
+
|
|
29
|
+
runs-on: ${{ matrix.operating-system }}
|
|
30
|
+
continue-on-error: true
|
|
31
|
+
|
|
32
|
+
env:
|
|
33
|
+
FAIL_ON_LOW_COVERAGE: ${{ matrix.fail_on_low_coverage }}
|
|
34
|
+
|
|
35
|
+
strategy:
|
|
36
|
+
fail-fast: false
|
|
37
|
+
matrix:
|
|
38
|
+
ruby: ["3.1", "3.2", "3.3", "3.4"]
|
|
39
|
+
operating-system: [ubuntu-latest]
|
|
40
|
+
fail_on_low_coverage: [true]
|
|
41
|
+
include:
|
|
42
|
+
- ruby: "3.1"
|
|
43
|
+
operating-system: windows-latest
|
|
44
|
+
fail_on_low_coverage: false
|
|
45
|
+
- ruby: "jruby-9.4"
|
|
46
|
+
operating-system: ubuntu-latest
|
|
47
|
+
fail_on_low_coverage: false
|
|
48
|
+
- ruby: "truffleruby-24"
|
|
49
|
+
operating-system: ubuntu-latest
|
|
50
|
+
fail_on_low_coverage: false
|
|
51
|
+
|
|
52
|
+
steps:
|
|
53
|
+
- name: Checkout
|
|
54
|
+
uses: actions/checkout@v4
|
|
55
|
+
|
|
56
|
+
- name: Initialize Ruby
|
|
57
|
+
uses: ruby/setup-ruby@v1
|
|
58
|
+
with:
|
|
59
|
+
ruby-version: ${{ matrix.ruby }}
|
|
60
|
+
bundler-cache: true
|
|
61
|
+
|
|
62
|
+
- name: Run rake
|
|
63
|
+
run: bundle exec rake
|
|
64
|
+
|
|
65
|
+
coverage:
|
|
66
|
+
name: Report test coverage to CodeClimate
|
|
67
|
+
|
|
68
|
+
needs: [build]
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
|
|
71
|
+
steps:
|
|
72
|
+
- name: Checkout
|
|
73
|
+
uses: actions/checkout@v4
|
|
74
|
+
|
|
75
|
+
- name: Initialize Ruby
|
|
76
|
+
uses: ruby/setup-ruby@v1
|
|
77
|
+
with:
|
|
78
|
+
ruby-version: 3.1
|
|
79
|
+
bundler-cache: true
|
|
80
|
+
|
|
81
|
+
- name: Report test coverage
|
|
82
|
+
uses: paambaati/codeclimate-action@v9
|
|
83
|
+
env:
|
|
84
|
+
CC_TEST_REPORTER_ID: b86e77bc6980a43dc09314502fe13334e0f663770b840628ca0716e6dcdeeb5d
|
|
85
|
+
with:
|
|
86
|
+
coverageCommand: bundle exec rake spec
|
|
87
|
+
coverageLocations: ${{github.workspace}}/coverage/lcov/*.lcov:lcov
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Conventional Commits
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
commit-lint:
|
|
10
|
+
name: Verify Conventional Commits
|
|
11
|
+
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
with: { fetch-depth: 0 }
|
|
18
|
+
|
|
19
|
+
- name: Check Commit Messages
|
|
20
|
+
uses: wagoid/commitlint-github-action@v6
|
|
21
|
+
with: { configFile: .commitlintrc.yml }
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Experimental Ruby Builds
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
# SimpleCov suggests setting the JRuby --debug flag to ensure that coverage
|
|
11
|
+
# results from JRuby are complete.
|
|
12
|
+
JRUBY_OPTS: --debug
|
|
13
|
+
|
|
14
|
+
# Experimental platforms / Ruby versions:
|
|
15
|
+
# - Ubuntu: MRI (head), TruffleRuby (head), JRuby (head)
|
|
16
|
+
# - Windows: MRI (head), JRuby (head), JRuby (9.4)
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
|
|
21
|
+
|
|
22
|
+
runs-on: ${{ matrix.operating-system }}
|
|
23
|
+
continue-on-error: true
|
|
24
|
+
|
|
25
|
+
env:
|
|
26
|
+
FAIL_ON_LOW_COVERAGE: ${{ matrix.fail_on_low_coverage }}
|
|
27
|
+
GIT_AUTHOR_NAME: Git Author
|
|
28
|
+
GIT_AUTHOR_EMAIL: git_author@example.com
|
|
29
|
+
GIT_COMMITTER_NAME: Git Committer
|
|
30
|
+
GIT_COMMITTER_EMAIL: git_committer@example.com
|
|
31
|
+
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
fail_on_low_coverage: [true]
|
|
36
|
+
include:
|
|
37
|
+
- ruby: head
|
|
38
|
+
operating-system: ubuntu-latest
|
|
39
|
+
- ruby: head
|
|
40
|
+
operating-system: windows-latest
|
|
41
|
+
- ruby: truffleruby-head
|
|
42
|
+
operating-system: ubuntu-latest
|
|
43
|
+
fail_on_low_coverage: false
|
|
44
|
+
- ruby: jruby-head
|
|
45
|
+
operating-system: ubuntu-latest
|
|
46
|
+
fail_on_low_coverage: false
|
|
47
|
+
- ruby: "jruby-9.4"
|
|
48
|
+
operating-system: windows-latest
|
|
49
|
+
fail_on_low_coverage: false
|
|
50
|
+
- ruby: jruby-head
|
|
51
|
+
operating-system: windows-latest
|
|
52
|
+
fail_on_low_coverage: false
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- name: Checkout
|
|
56
|
+
uses: actions/checkout@v4
|
|
57
|
+
|
|
58
|
+
- name: Initialize Ruby
|
|
59
|
+
uses: ruby/setup-ruby@v1
|
|
60
|
+
with:
|
|
61
|
+
ruby-version: ${{ matrix.ruby }}
|
|
62
|
+
bundler-cache: true
|
|
63
|
+
|
|
64
|
+
- name: Run rake
|
|
65
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.husky/commit-msg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx --no-install commitlint --edit "$1"
|
data/.markdownlint.yml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
default: true
|
|
2
|
+
|
|
3
|
+
# Unordered list indentation
|
|
4
|
+
MD007: { indent: 2 }
|
|
5
|
+
|
|
6
|
+
# Line length
|
|
7
|
+
MD013: { line_length: 90, tables: false, code_blocks: false }
|
|
8
|
+
|
|
9
|
+
# Heading duplication is allowed for non-sibling headings
|
|
10
|
+
MD024: { siblings_only: true }
|
|
11
|
+
|
|
12
|
+
# Do not allow the specified trailing punctuation in a header
|
|
13
|
+
MD026: { punctuation: '.,;:' }
|
|
14
|
+
|
|
15
|
+
# Order list items must have a prefix that increases in numerical order
|
|
16
|
+
MD029: { style: 'ordered' }
|
|
17
|
+
|
|
18
|
+
# Lists do not need to be surrounded by blank lines
|
|
19
|
+
MD032: false
|
|
20
|
+
|
|
21
|
+
# Allow raw HTML in Markdown
|
|
22
|
+
MD033: false
|
|
23
|
+
|
|
24
|
+
# Allow emphasis to be used instead of a heading
|
|
25
|
+
MD036: false
|
data/.rubocop.yml
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Output extra information for each offense to make it easier to diagnose:
|
|
4
|
-
DisplayCopNames: true
|
|
5
|
-
DisplayStyleGuide: true
|
|
6
|
-
ExtraDetails: true
|
|
7
|
-
# RuboCop enforces rules depending on the oldest version of Ruby which
|
|
8
|
-
# your project supports:
|
|
9
|
-
TargetRubyVersion: 2.6
|
|
1
|
+
inherit_gem:
|
|
2
|
+
main_branch_shared_rubocop_config: config/rubocop.yml
|
|
10
3
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
Metrics/MethodLength:
|
|
5
|
+
Exclude:
|
|
6
|
+
- "spec/spec_helper.rb"
|
|
7
|
+
- "spec/**/*_spec.rb"
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
Metrics/BlockLength:
|
|
9
|
+
Metrics/AbcSize:
|
|
17
10
|
Exclude:
|
|
11
|
+
- "spec/spec_helper.rb"
|
|
18
12
|
- "spec/**/*_spec.rb"
|
|
19
|
-
|
|
13
|
+
|
|
14
|
+
AllCops:
|
|
15
|
+
# Pin this project to Ruby 3.1 in case the shared config above is upgraded to 3.2
|
|
16
|
+
# or later.
|
|
17
|
+
TargetRubyVersion: 3.1
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,45 +1,101 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
[Full Changelog](https://github.com/
|
|
3
|
+
## v0.3.0 (2025-03-28)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.2.0..v0.3.0)
|
|
6
|
+
|
|
7
|
+
Changes since v0.2.0:
|
|
8
|
+
|
|
9
|
+
* 89cf543 chore: add the implementation plan
|
|
10
|
+
* 3e952c0 feat: add status report entry filters
|
|
11
|
+
* 301c7b7 feat: support git add via Worktree#add
|
|
12
|
+
* 72020b9 feat: add support to passing path specs to Worktree#status
|
|
13
|
+
* 324a472 test: add tests to verify that Worktree#status builds the right git command
|
|
14
|
+
* c07b3be feat: make Worktree#clone work if clone_to path is not given
|
|
15
|
+
* d7a3232 feat: add Worktree#status
|
|
16
|
+
* 7bae4b6 feat: implement RubyGit::Worktree#status
|
|
17
|
+
* f75e0ec chore: rename working tree to worktree
|
|
18
|
+
* 918487c chore: run git commands using RubyGit::CommandLine.run
|
|
19
|
+
* 8a5b204 fix: fix tests failing on Windows for platform-specific reasons
|
|
20
|
+
* 19eb327 fix: make it so command-line-test script runs in Windows
|
|
21
|
+
* 7fb57c5 refactor: change the way that the git command is run
|
|
22
|
+
* 6efdf53 chore: update process_executer dependency to 3.0
|
|
23
|
+
* 834b33d test: add command line tool to run to test running the command line
|
|
24
|
+
* e74affb chore: make it easier to identify the platform and ruby engine in scripts
|
|
25
|
+
* ceaf40d build: remove semver pr label check
|
|
26
|
+
* 6e56dd0 build: enforce conventional commit message formatting
|
|
27
|
+
* 209c408 Replace NullLogger with Logger.new(File::NULL)
|
|
28
|
+
* 9b23e0f Use shared Rubocop config
|
|
29
|
+
* acb286e Update copyright notice in this project
|
|
30
|
+
* 549d8fb Update links in gemspec
|
|
31
|
+
* 6de1b82 Use standard badges at the top of the README
|
|
32
|
+
* 1fa584e Update yardopts with new standard options
|
|
33
|
+
* 872cd1b Rename "markdown.yml" to ".markdown.yml"
|
|
34
|
+
* ec8299a Standardize YARD and Markdown Lint configurations
|
|
35
|
+
* 1862fc9 Update CODEOWNERS file
|
|
36
|
+
* 6de3eea Set JRuby --debug option when running tests in GitHub Actions workflows
|
|
37
|
+
* 50fda86 Integrate simplecov-rspec into the project
|
|
38
|
+
* 4b7410b Use create-github-release for creating releases
|
|
39
|
+
* 5fd999b Reset CodeClimate code coverage reporter id
|
|
40
|
+
* 7944490 Update continuous integration and experimental ruby builds
|
|
41
|
+
* 943c687 Enforce the use of semver tags on PRs
|
|
42
|
+
* 4e7126a Update minimum required Ruby to 3.1
|
|
43
|
+
* 359c358 Don't enforce coverage % in an RSpec dry run (#30)
|
|
44
|
+
* efa2c90 Use GitHub Actions for CI Builds (#29)
|
|
45
|
+
* d1ca85b Upgrade to Rubocop 1.0 (#25)
|
|
46
|
+
* 6c8fd7a Rename Worktree class to WorkingTree (#24)
|
|
47
|
+
* 88f7471 Remove MAINTAINERS.md from yard documentation (#23)
|
|
48
|
+
* a55042d Add logging to the RubyGit gem (#22)
|
|
49
|
+
* 9a95a32 Redesign RubyGit::FileHelpers.which (#20)
|
|
50
|
+
* 9bb7dc0 Allow members of @main-branch/ruby_git-codeowners to do code review approvals. (#19)
|
|
51
|
+
* 401e1fd Release v0.2.0 (#18)
|
|
52
|
+
|
|
53
|
+
## [v0.2.0](https://github.com/main-branch/ruby_git/releases/tag/v0.2.0) (2020-10-12)
|
|
54
|
+
|
|
55
|
+
[Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.1.3...v0.2.0)
|
|
6
56
|
|
|
7
57
|
**Merged pull requests:**
|
|
8
58
|
|
|
9
|
-
- Add
|
|
59
|
+
- Add Worktree class and creation methods init, clone, and open [\#17](https://github.com/main-branch/ruby_git/pull/17) ([jcouball](https://github.com/jcouball))
|
|
60
|
+
- Add Slack badge to README [\#16](https://github.com/main-branch/ruby_git/pull/16) ([jcouball](https://github.com/jcouball))
|
|
61
|
+
- Push code coverage information to CodeClimate [\#14](https://github.com/main-branch/ruby_git/pull/14) ([jcouball](https://github.com/jcouball))
|
|
62
|
+
- Move the ruby\_git repository to the main-branch GitHub organization. [\#13](https://github.com/main-branch/ruby_git/pull/13) ([jcouball](https://github.com/jcouball))
|
|
63
|
+
- Add CODEOWNERS file [\#12](https://github.com/main-branch/ruby_git/pull/12) ([jcouball](https://github.com/jcouball))
|
|
64
|
+
- Release v0.1.3 [\#11](https://github.com/main-branch/ruby_git/pull/11) ([jcouball](https://github.com/jcouball))
|
|
10
65
|
|
|
11
|
-
## [v0.1.
|
|
66
|
+
## [v0.1.3](https://github.com/main-branch/ruby_git/releases/tag/v0.1.3) (2020-09-24)
|
|
12
67
|
|
|
13
|
-
[Full Changelog](https://github.com/
|
|
68
|
+
[Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.1.2...v0.1.3)
|
|
14
69
|
|
|
15
70
|
**Merged pull requests:**
|
|
16
71
|
|
|
17
|
-
-
|
|
72
|
+
- Add Gem badge and correct home page URL [\#10](https://github.com/main-branch/ruby_git/pull/10) ([jcouball](https://github.com/jcouball))
|
|
18
73
|
|
|
19
|
-
## [
|
|
74
|
+
## [v0.1.2](https://github.com/main-branch/ruby_git/releases/tag/v0.1.2) (2020-09-24)
|
|
20
75
|
|
|
21
|
-
[Full Changelog](https://github.com/
|
|
76
|
+
[Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.1.1...v0.1.2)
|
|
22
77
|
|
|
23
78
|
**Merged pull requests:**
|
|
24
79
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
80
|
+
- Release v0.1.2 [\#9](https://github.com/main-branch/ruby_git/pull/9) ([jcouball](https://github.com/jcouball))
|
|
81
|
+
- Update instructions for creating releases and updating the changelog [\#8](https://github.com/main-branch/ruby_git/pull/8) ([jcouball](https://github.com/jcouball))
|
|
82
|
+
- Changes requested in documentation review [\#7](https://github.com/main-branch/ruby_git/pull/7) ([jcouball](https://github.com/jcouball))
|
|
83
|
+
- Set and retrieve the path to the git binary used by this library [\#6](https://github.com/main-branch/ruby_git/pull/6) ([jcouball](https://github.com/jcouball))
|
|
84
|
+
- Move RSpec config from Rakefile to .rspec [\#5](https://github.com/main-branch/ruby_git/pull/5) ([jcouball](https://github.com/jcouball))
|
|
85
|
+
- Release v0.1.1 [\#4](https://github.com/main-branch/ruby_git/pull/4) ([jcouball](https://github.com/jcouball))
|
|
30
86
|
|
|
31
|
-
## [v0.1.1](https://github.com/
|
|
87
|
+
## [v0.1.1](https://github.com/main-branch/ruby_git/releases/tag/v0.1.1) (2020-09-18)
|
|
32
88
|
|
|
33
|
-
[Full Changelog](https://github.com/
|
|
89
|
+
[Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.1.0...v0.1.1)
|
|
34
90
|
|
|
35
91
|
**Merged pull requests:**
|
|
36
92
|
|
|
37
|
-
- Add notice saying that this project is a work in progress [\#3](https://github.com/
|
|
38
|
-
- Remove Gemfile.lock and add it to .gitignore [\#2](https://github.com/
|
|
93
|
+
- Add notice saying that this project is a work in progress [\#3](https://github.com/main-branch/ruby_git/pull/3) ([jcouball](https://github.com/jcouball))
|
|
94
|
+
- Remove Gemfile.lock and add it to .gitignore [\#2](https://github.com/main-branch/ruby_git/pull/2) ([jcouball](https://github.com/jcouball))
|
|
39
95
|
|
|
40
|
-
## [v0.1.0](https://github.com/
|
|
96
|
+
## [v0.1.0](https://github.com/main-branch/ruby_git/releases/tag/v0.1.0) (2020-09-18)
|
|
41
97
|
|
|
42
|
-
[Full Changelog](https://github.com/
|
|
98
|
+
[Full Changelog](https://github.com/main-branch/ruby_git/compare/04b4b2bc59b0b09ad45a69572450cb393dbe79a1...v0.1.0)
|
|
43
99
|
|
|
44
100
|
|
|
45
101
|
|
data/CONTRIBUTING.md
CHANGED
|
@@ -20,7 +20,7 @@ You can contribute in two ways:
|
|
|
20
20
|
ruby_git utilizes [GitHub Issues](https://help.github.com/en/github/managing-your-work-on-github/about-issues)
|
|
21
21
|
for issue tracking and feature requests.
|
|
22
22
|
|
|
23
|
-
Report an issue or feature request by [creating a ruby_git Github issue](https://github.com/
|
|
23
|
+
Report an issue or feature request by [creating a ruby_git Github issue](https://github.com/main-branch/ruby_git/issues/new).
|
|
24
24
|
Fill in the template to describe the issue or feature request the best you can.
|
|
25
25
|
|
|
26
26
|
## How to submit a code or documentation change
|
|
@@ -46,8 +46,8 @@ Follow the instructions in the pull request template.
|
|
|
46
46
|
|
|
47
47
|
Code review takes place in a GitHub pull request using the [the Github pull request review feature](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-reviews).
|
|
48
48
|
|
|
49
|
-
Once your pull request is ready for review, request a review from at least one
|
|
50
|
-
[
|
|
49
|
+
Once your pull request is ready for review, request a review from at least one of the
|
|
50
|
+
[code owners](https://github.com/orgs/main-branch/teams/ruby_git-codeowners/members).
|
|
51
51
|
|
|
52
52
|
During the review process, you may need to make additional commits which would
|
|
53
53
|
need to be squashed. It may also be necessary to rebase to main again if other
|
|
@@ -70,8 +70,8 @@ All pull requests must meet these requirements:
|
|
|
70
70
|
### Unit tests
|
|
71
71
|
* All changes must be accompanied by new or modified RSpec unit tests
|
|
72
72
|
* The entire test suite must pass when `bundle exec rake spec` is run from the
|
|
73
|
-
project's local working
|
|
74
|
-
* The unit test suite must maintain 100% code coverage to pass
|
|
73
|
+
project's local working tree
|
|
74
|
+
* The unit test suite must maintain 100% code coverage to pass
|
|
75
75
|
|
|
76
76
|
### Documentation
|
|
77
77
|
* New and updated public methods must have [YARD](https://yardoc.org/)
|
|
@@ -84,9 +84,9 @@ All pull requests must meet these requirements:
|
|
|
84
84
|
* The documentation suite must maintain 100% documentation to pass
|
|
85
85
|
|
|
86
86
|
### Continuous Integration
|
|
87
|
-
* All tests must pass in the project's [Travis CI](https://travis-ci.org/
|
|
87
|
+
* All tests must pass in the project's [Travis CI](https://travis-ci.org/main-branch/ruby_git)
|
|
88
88
|
build before the pull request will be merged.
|
|
89
|
-
* You can simulate what happens in the Travis CI build by running `bundle exec rake` in
|
|
89
|
+
* You can simulate what happens in the Travis CI build by running `bundle exec rake` in
|
|
90
90
|
the projects root directory.
|
|
91
91
|
|
|
92
92
|
### Other Design Guidelines
|
data/{LICENSE.md → LICENSE.txt}
RENAMED
data/PLAN.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# RubyGit Implementation Plan
|
|
2
|
+
|
|
3
|
+
This is the plan for the RubyGit project, which provides an object-oriented wrapper
|
|
4
|
+
around the Git command line. The project follows a clear architecture with three main
|
|
5
|
+
objects: Worktree, Index, and Repository.
|
|
6
|
+
|
|
7
|
+
Implementation of git commands will follow a logical progression to build upon
|
|
8
|
+
previous functionality and deliver value early. Here is the order:
|
|
9
|
+
|
|
10
|
+
## Git commands
|
|
11
|
+
|
|
12
|
+
**1. Basic Repository Operations (Some Already Implemented)**
|
|
13
|
+
|
|
14
|
+
* ✅ git init
|
|
15
|
+
* ✅ git clone
|
|
16
|
+
* ✅ git status
|
|
17
|
+
* ✅ git add
|
|
18
|
+
* git commit
|
|
19
|
+
* git log
|
|
20
|
+
|
|
21
|
+
**2. Branch Management**
|
|
22
|
+
|
|
23
|
+
* git branch (create, list, delete)
|
|
24
|
+
* git checkout/switch
|
|
25
|
+
* git merge
|
|
26
|
+
* git rebase
|
|
27
|
+
|
|
28
|
+
**3. Remote Operations**
|
|
29
|
+
|
|
30
|
+
* git remote (add, remove, list)
|
|
31
|
+
* git fetch
|
|
32
|
+
* git pull
|
|
33
|
+
* git push
|
|
34
|
+
|
|
35
|
+
**4. Advanced Repository Operations**
|
|
36
|
+
|
|
37
|
+
* git tag
|
|
38
|
+
* git stash
|
|
39
|
+
* git cherry-pick
|
|
40
|
+
* git reset
|
|
41
|
+
* git revert
|
|
42
|
+
|
|
43
|
+
**5. Specialized Operations**
|
|
44
|
+
|
|
45
|
+
* git blame
|
|
46
|
+
* git bisect
|
|
47
|
+
* git submodule
|
|
48
|
+
* git worktree
|
|
49
|
+
* git reflog
|
|
50
|
+
|
|
51
|
+
## Rationale
|
|
52
|
+
|
|
53
|
+
1. **Start with the basic workflow**: This follows the typical Git workflow that
|
|
54
|
+
developers use daily. You've already implemented init, clone and status, so add
|
|
55
|
+
and commit are the natural next steps to complete the basic functionality.
|
|
56
|
+
2. **Branch management**: Once basic repository operations are in place, branch
|
|
57
|
+
management is essential for any Git workflow.
|
|
58
|
+
3. **Remote operations**: These commands build on local operations but add networking
|
|
59
|
+
capabilities.
|
|
60
|
+
4. **Advanced operations**: These provide more specialized functionality that builds
|
|
61
|
+
on the core commands.
|
|
62
|
+
5. **Specialized operations**: These are less commonly used but provide powerful
|
|
63
|
+
capabilities for specific use cases.
|
|
64
|
+
|
|
65
|
+
This approach allows functional value to be delivered early while building a
|
|
66
|
+
foundation for more complex operations. It also aligns with my idea of how users
|
|
67
|
+
typically learn and use Git, making the library more intuitive.
|
data/README.md
CHANGED
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
# RubyGit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This project is not complete, but [{file:PLAN.md implementation plan}](PLAN.md) details what is available
|
|
4
|
+
and the order of implementing new features.
|
|
4
5
|
|
|
5
6
|
[](https://badge.fury.io/rb/ruby_git)
|
|
6
|
-
[](https://github.com/main-branch/ruby_git/actions/workflows/continuous_integration.yml)
|
|
8
|
+
[](https://rubydoc.info/gems/ruby_git/)
|
|
9
|
+
[](https://rubydoc.info/gems/ruby_git/file/CHANGELOG.md)
|
|
10
|
+
[](https://codeclimate.com/github/main-branch/ruby_git/maintainability)
|
|
11
|
+
[](https://codeclimate.com/github/main-branch/ruby_git/test_coverage)
|
|
12
|
+
[](https://main-branch.slack.com/archives/C01CHR7TMM2)
|
|
13
|
+
|
|
14
|
+
Git Is Hard™ but it doesn't have to be that way. Git has this reputation because it has an
|
|
15
|
+
underlying model that is more complex than other popular revision control systems
|
|
16
|
+
such as CVS or Subversion. To make matters worse, the `git` command line is vast,
|
|
17
|
+
inconsistently implemented, and does not have a clear mapping between the command-line
|
|
18
|
+
actions and Git's underlying model.
|
|
19
|
+
|
|
20
|
+
Because of this complexity, beginners tend to memorize a few `git` commands in
|
|
21
|
+
order to get by with a simple workflow without really understanding how Git works
|
|
22
|
+
and the rich set of features it offers.
|
|
23
|
+
|
|
24
|
+
The RubyGit module provides a Ruby API that is an object-oriented wrapper around
|
|
25
|
+
the `git` command line. It is intended to make automating both simple and complex Git
|
|
26
|
+
interactions easier. To accomplish this, it ties each action you can do with `git` to
|
|
27
|
+
the type of object that action operates on.
|
|
28
|
+
|
|
29
|
+
There are three main objects in RubyGit:
|
|
30
|
+
* [Worktree](lib/ruby_git/worktree.rb): The directory tree of actual checked
|
|
31
|
+
out files. The working tree normally contains the contents of the HEAD commit’s
|
|
32
|
+
tree, plus any local changes that you have made but not yet committed.
|
|
33
|
+
* [Index](lib/ruby_git/index.rb): The index is used as a staging area between your
|
|
34
|
+
working tree and your repository. You can use the index to build up a set of changes
|
|
35
|
+
that you want to commit together. When you create a commit, what is committed is what is
|
|
36
|
+
currently in the index, not what is in your working directory.
|
|
37
|
+
* [Repository](lib/ruby_git/repository.rb): The repository stores the files in a project,
|
|
38
|
+
their history, and other meta data like commit information, tags, and branches.
|
|
39
|
+
|
|
40
|
+
The [RubyGit Class Diagram](RubyGit%20Class%20Diagram.svg) shows the main abstractions in
|
|
41
|
+
RubyGit, how they are related, and what actions each can perform.
|
|
13
42
|
|
|
14
43
|
## Installation
|
|
15
44
|
|
|
@@ -65,7 +94,7 @@ To tell what version of Git is being used:
|
|
|
65
94
|
puts RubyGit.git_version
|
|
66
95
|
```
|
|
67
96
|
|
|
68
|
-
The full API is documented in [the RubyGit YARD documentation](https://github.com/pages/
|
|
97
|
+
The full API is documented in [the RubyGit YARD documentation](https://github.com/pages/main-branch/ruby_git).
|
|
69
98
|
|
|
70
99
|
## Development
|
|
71
100
|
|
|
@@ -77,4 +106,29 @@ automatically requires ruby_git.
|
|
|
77
106
|
|
|
78
107
|
## Contributing
|
|
79
108
|
|
|
80
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
109
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/main-branch/ruby_git.
|
|
110
|
+
|
|
111
|
+
### Commit message guidelines
|
|
112
|
+
|
|
113
|
+
All commit messages must follow the [Conventional Commits
|
|
114
|
+
standard](https://www.conventionalcommits.org/en/v1.0.0/). This helps us maintain a
|
|
115
|
+
clear and structured commit history, automate versioning, and generate changelogs
|
|
116
|
+
effectively.
|
|
117
|
+
|
|
118
|
+
To ensure compliance, this project includes:
|
|
119
|
+
|
|
120
|
+
* A git commit-msg hook that validates your commit messages before they are accepted.
|
|
121
|
+
|
|
122
|
+
To activate the hook, you must have node installed and run `npm install`.
|
|
123
|
+
|
|
124
|
+
* A GitHub Actions workflow that will enforce the Conventional Commit standard as
|
|
125
|
+
part of the continuous integration pipeline.
|
|
126
|
+
|
|
127
|
+
Any commit message that does not conform to the Conventional Commits standard will
|
|
128
|
+
cause the workflow to fail and not allow the PR to be merged.
|
|
129
|
+
|
|
130
|
+
### Pull request guidelines
|
|
131
|
+
|
|
132
|
+
All pull requests must be merged using rebase merges. This ensures that commit
|
|
133
|
+
messages from the feature branch are preserved in the release branch, keeping the
|
|
134
|
+
history clean and meaningful.
|