ruby_git 0.2.0 → 0.3.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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.commitlintrc.yml +16 -0
  3. data/.github/CODEOWNERS +4 -0
  4. data/.github/workflows/continuous_integration.yml +87 -0
  5. data/.github/workflows/enforce_conventional_commits.yml +21 -0
  6. data/.github/workflows/experimental_ruby_builds.yml +65 -0
  7. data/.gitignore +3 -0
  8. data/.husky/commit-msg +1 -0
  9. data/.markdownlint.yml +25 -0
  10. data/.rubocop.yml +13 -15
  11. data/.yardopts +6 -1
  12. data/CHANGELOG.md +58 -0
  13. data/CONTRIBUTING.md +5 -5
  14. data/{LICENSE.md → LICENSE.txt} +1 -1
  15. data/PLAN.md +67 -0
  16. data/README.md +58 -6
  17. data/RELEASING.md +5 -54
  18. data/Rakefile +31 -38
  19. data/RubyGit Class Diagram.svg +1 -0
  20. data/bin/command-line-test +189 -0
  21. data/bin/console +2 -0
  22. data/bin/setup +13 -2
  23. data/lib/ruby_git/command_line/options.rb +61 -0
  24. data/lib/ruby_git/command_line/result.rb +155 -0
  25. data/lib/ruby_git/command_line/runner.rb +296 -0
  26. data/lib/ruby_git/command_line.rb +95 -0
  27. data/lib/ruby_git/encoding_normalizer.rb +49 -0
  28. data/lib/ruby_git/errors.rb +169 -0
  29. data/lib/ruby_git/repository.rb +33 -0
  30. data/lib/ruby_git/status/branch.rb +92 -0
  31. data/lib/ruby_git/status/entry.rb +162 -0
  32. data/lib/ruby_git/status/ignored_entry.rb +44 -0
  33. data/lib/ruby_git/status/ordinary_entry.rb +207 -0
  34. data/lib/ruby_git/status/parser.rb +203 -0
  35. data/lib/ruby_git/status/renamed_entry.rb +257 -0
  36. data/lib/ruby_git/status/report.rb +143 -0
  37. data/lib/ruby_git/status/stash.rb +33 -0
  38. data/lib/ruby_git/status/submodule_status.rb +85 -0
  39. data/lib/ruby_git/status/unmerged_entry.rb +248 -0
  40. data/lib/ruby_git/status/untracked_entry.rb +52 -0
  41. data/lib/ruby_git/status.rb +33 -0
  42. data/lib/ruby_git/version.rb +1 -1
  43. data/lib/ruby_git/worktree.rb +175 -33
  44. data/lib/ruby_git.rb +91 -28
  45. data/package.json +11 -0
  46. data/ruby_git.gemspec +33 -23
  47. metadata +146 -50
  48. data/.travis.yml +0 -26
  49. data/CODEOWNERS +0 -3
  50. data/MAINTAINERS.md +0 -8
  51. data/lib/ruby_git/error.rb +0 -8
  52. data/lib/ruby_git/file_helpers.rb +0 -42
  53. data/lib/ruby_git/git_binary.rb +0 -106
  54. /data/{ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md} +0 -0
  55. /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: 740fbc545a60561d555d5d698dc6303d150a7fa4eed583afbf70facd70610502
4
- data.tar.gz: '094fb5b8d53b28c240074f6c874fddaf503f2a5f4218207a437205c0aec4118e'
3
+ metadata.gz: b12470df80fc020031e73898e6332def5b5d6e7c419acb3036a58585263269b7
4
+ data.tar.gz: d1138d2381fc7272397357105b8e884a78bed2396289608df6dc746896018b4b
5
5
  SHA512:
6
- metadata.gz: 8be9d5931ea2c500fc07f0f2b0fcb93e7324e8bb156216c0f6adf147c465a41b97e6b1e3f159fe5cae5ff804613eb82b18f4ca7ea41abf4a0d4a5fb34a098444
7
- data.tar.gz: d054d7dca124d1da739dab1d7191d81dd2f7ceef900b81b118ad18f0bad2f852eda4d1970da2c169a3f18857e4d804a1efb48ac9fb7fb5b08ba4e592276741bf
6
+ metadata.gz: f1cbdfcdea413421d06bf15ad2c205866dff32a1b92ffea0b260dbecf31fe62313fb6b355ae81fff9cb0f07fab26af622c90eeb28c1b1e28c63c27a02223e499
7
+ data.tar.gz: e51b5c257998f8a2c9cad6927bfd1b32d4f397c793b82edd6017a00b4581b9b6f6f00623f05ec9d2052b42a72c62fabc94268bb4caa6b1d6b408a3b2d5041f46
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']
@@ -0,0 +1,4 @@
1
+ # Defines who must review pull requests.
2
+ # See https://help.github.com/articles/about-codeowners/ for details.
3
+
4
+ * @jcouball @main-branch/ruby_git-codeowners
@@ -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
@@ -16,3 +16,6 @@ rubocop-report.json
16
16
  /Gemfile.lock
17
17
  .idea
18
18
  .irb_history
19
+
20
+ node_modules
21
+ package-lock.json
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
- AllCops:
2
- NewCops: enable
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
- # The default max line length is 80 characters
12
- Layout/LineLength:
13
- Max: 120
4
+ Metrics/MethodLength:
5
+ Exclude:
6
+ - "spec/spec_helper.rb"
7
+ - "spec/**/*_spec.rb"
14
8
 
15
- # The DSL for RSpec makes it very hard to limit block length:
16
- Metrics/BlockLength:
9
+ Metrics/AbcSize:
17
10
  Exclude:
11
+ - "spec/spec_helper.rb"
18
12
  - "spec/**/*_spec.rb"
19
- - "*.gemspec"
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
@@ -2,4 +2,9 @@
2
2
  --hide-void-return
3
3
  --markup-provider=redcarpet
4
4
  --markup markdown
5
- - CHANGELOG.md CONTRIBUTING.md MAINTAINERS.md RELEASING.md LICENSE.md
5
+ --readme README.md
6
+ - PLAN.md
7
+ - CHANGELOG.md
8
+ - CONTRIBUTING.md
9
+ - RELEASING.md
10
+ - LICENSE.txt
data/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # Change Log
2
2
 
3
+ ## v0.3.1 (2025-03-28)
4
+
5
+ [Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.3.0..v0.3.1)
6
+
7
+ Changes since v0.3.0:
8
+
9
+ * fbadc20 docs: update the gem description
10
+
11
+ ## v0.3.0 (2025-03-28)
12
+
13
+ [Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.2.0..v0.3.0)
14
+
15
+ Changes since v0.2.0:
16
+
17
+ * 89cf543 chore: add the implementation plan
18
+ * 3e952c0 feat: add status report entry filters
19
+ * 301c7b7 feat: support git add via Worktree#add
20
+ * 72020b9 feat: add support to passing path specs to Worktree#status
21
+ * 324a472 test: add tests to verify that Worktree#status builds the right git command
22
+ * c07b3be feat: make Worktree#clone work if clone_to path is not given
23
+ * d7a3232 feat: add Worktree#status
24
+ * 7bae4b6 feat: implement RubyGit::Worktree#status
25
+ * f75e0ec chore: rename working tree to worktree
26
+ * 918487c chore: run git commands using RubyGit::CommandLine.run
27
+ * 8a5b204 fix: fix tests failing on Windows for platform-specific reasons
28
+ * 19eb327 fix: make it so command-line-test script runs in Windows
29
+ * 7fb57c5 refactor: change the way that the git command is run
30
+ * 6efdf53 chore: update process_executer dependency to 3.0
31
+ * 834b33d test: add command line tool to run to test running the command line
32
+ * e74affb chore: make it easier to identify the platform and ruby engine in scripts
33
+ * ceaf40d build: remove semver pr label check
34
+ * 6e56dd0 build: enforce conventional commit message formatting
35
+ * 209c408 Replace NullLogger with Logger.new(File::NULL)
36
+ * 9b23e0f Use shared Rubocop config
37
+ * acb286e Update copyright notice in this project
38
+ * 549d8fb Update links in gemspec
39
+ * 6de1b82 Use standard badges at the top of the README
40
+ * 1fa584e Update yardopts with new standard options
41
+ * 872cd1b Rename "markdown.yml" to ".markdown.yml"
42
+ * ec8299a Standardize YARD and Markdown Lint configurations
43
+ * 1862fc9 Update CODEOWNERS file
44
+ * 6de3eea Set JRuby --debug option when running tests in GitHub Actions workflows
45
+ * 50fda86 Integrate simplecov-rspec into the project
46
+ * 4b7410b Use create-github-release for creating releases
47
+ * 5fd999b Reset CodeClimate code coverage reporter id
48
+ * 7944490 Update continuous integration and experimental ruby builds
49
+ * 943c687 Enforce the use of semver tags on PRs
50
+ * 4e7126a Update minimum required Ruby to 3.1
51
+ * 359c358 Don't enforce coverage % in an RSpec dry run (#30)
52
+ * efa2c90 Use GitHub Actions for CI Builds (#29)
53
+ * d1ca85b Upgrade to Rubocop 1.0 (#25)
54
+ * 6c8fd7a Rename Worktree class to WorkingTree (#24)
55
+ * 88f7471 Remove MAINTAINERS.md from yard documentation (#23)
56
+ * a55042d Add logging to the RubyGit gem (#22)
57
+ * 9a95a32 Redesign RubyGit::FileHelpers.which (#20)
58
+ * 9bb7dc0 Allow members of @main-branch/ruby_git-codeowners to do code review approvals. (#19)
59
+ * 401e1fd Release v0.2.0 (#18)
60
+
3
61
  ## [v0.2.0](https://github.com/main-branch/ruby_git/releases/tag/v0.2.0) (2020-10-12)
4
62
 
5
63
  [Full Changelog](https://github.com/main-branch/ruby_git/compare/v0.1.3...v0.2.0)
data/CONTRIBUTING.md CHANGED
@@ -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
- [maintainer](MAINTAINERS.md) and any number of other contributors.
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 copy
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/)
@@ -86,7 +86,7 @@ All pull requests must meet these requirements:
86
86
  ### Continuous Integration
87
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
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) 2020 James Couball and contributors
3
+ Copyright (c) 2024 James Couball
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/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,17 +1,44 @@
1
1
  # RubyGit
2
2
 
3
- **THIS PROJECT IS A WORK IN PROGRESS AND IS NOT USEFUL IN ITS CURRENT STATE**
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
  [![Gem Version](https://badge.fury.io/rb/ruby_git.svg)](https://badge.fury.io/rb/ruby_git)
6
- [![Build Status](https://travis-ci.org/main-branch/ruby_git.svg?branch=main)](https://travis-ci.org/main-branch/ruby_git)
7
+ [![Build Status](https://github.com/main-branch/ruby_git/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/main-branch/ruby_git/actions/workflows/continuous_integration.yml)
8
+ [![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/ruby_git/)
9
+ [![Change Log](https://img.shields.io/badge/CHANGELOG-Latest-green)](https://rubydoc.info/gems/ruby_git/file/CHANGELOG.md)
7
10
  [![Maintainability](https://api.codeclimate.com/v1/badges/5403e4613b7518f70da7/maintainability)](https://codeclimate.com/github/main-branch/ruby_git/maintainability)
8
11
  [![Test Coverage](https://api.codeclimate.com/v1/badges/5403e4613b7518f70da7/test_coverage)](https://codeclimate.com/github/main-branch/ruby_git/test_coverage)
9
12
  [![Slack](https://img.shields.io/badge/slack-main--branch/ruby__git-yellow.svg?logo=slack)](https://main-branch.slack.com/archives/C01CHR7TMM2)
10
13
 
11
- RubyGit is an object-oriented wrapper for the `git` command line tool for working with Worktrees
12
- and Repositories. It tries to make more sense out of the Git command line. See the object model
13
- in [this Lucid chart diagram](https://app.lucidchart.com/invitations/accept/7df13bab-3383-4683-8cb4-e76d539de93d)
14
- (requires sign in).
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.
15
42
 
16
43
  ## Installation
17
44
 
@@ -80,3 +107,28 @@ automatically requires ruby_git.
80
107
  ## Contributing
81
108
 
82
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.
data/RELEASING.md CHANGED
@@ -1,58 +1,9 @@
1
1
  # How to release a new ruby_git gem
2
2
 
3
- Releasing a new version of the `ruby_git` gem requires these steps:
4
- * [Prepare the release](#prepare-the-release)
5
- * [Create a GitHub release](#create-a-github-release)
6
- * [Build and release the gem](#build-and-release-the-gem)
3
+ Run `create-github-release <release-type>` in the root of a clean working tree.
7
4
 
8
- These instructions use an example where the current release version is `1.0.0`
9
- and the new release version to be created is `1.1.0.pre1`.
5
+ Where `release-type` is `major`, `minor`, or `patch` depending on the nature of the
6
+ changes. Refer to the labels on each PR since the last release to determine which
7
+ semver release type to specify.
10
8
 
11
- ## Prepare the release
12
-
13
- On a branch (or fork) of ruby_git, create a PR containing changes to (1) bump the
14
- version number and (2) update the CHANGELOG.md, and (3) tag the release.
15
-
16
- * Bump the version number
17
- * Version number is in lib/ruby_git/version.rb
18
- * Follow [Semantic Versioning](https://semver.org) guidelines
19
- * `bundle exec bump --no-commit patch` # backwards compatible bug fixes
20
- * `bundle exec bump --no-commit minor` # backwards compatible new functionality
21
- * `bundle exec bump --no-commit major` # incompatible API changes
22
-
23
- * Update CHANGELOG.md
24
- * `bundle exec rake changelog`
25
-
26
- * Stage the changes to be committed
27
- * `git add lib/ruby_git/version.rb CHANGELOG.md`
28
-
29
- * Commit, tag, and push changes to the repository
30
- * ```git release v`ruby -I lib -r ruby_git -e 'puts RubyGit::VERSION'` ```
31
-
32
- * Create a PR with these changes, have it reviewed and approved, and merged to main.
33
-
34
- ## Create a GitHub release
35
-
36
- On [the ruby_git releases page](https://github.com/main-branch/ruby_git/releases),
37
- select `Draft a new release`
38
-
39
- * Select the tag corresponding to the version being released `v1.1.0.pre1`
40
- * The Target should be `main`
41
- * For the release description, copy the relevant section from the CHANGELOG.md
42
- * The release description can be edited later.
43
- * Select the appropriate value for `This is a pre-release`
44
- * Since `v1.1.0.pre1` is a pre-release, check `This is a pre-release`
45
-
46
- ## Build and release the gem
47
-
48
- Clone [main-branch/ruby_git](https://github.com/main-branch/ruby_git) directly (not a
49
- fork) and ensure your local working copy is on the main branch
50
-
51
- * Verify that you are not on a fork with the command `git remote -v`
52
- * Verify that the version number is correct by running `rake -T` and inspecting
53
- the output for the `release[remote]` task
54
-
55
- Build the git gem and push it to rubygems.org with the command `rake release`
56
-
57
- * Ensure that your `gem sources list` includes `https://rubygems.org` (in my
58
- case, I usually have my work’s internal gem repository listed)
9
+ Follow the directions that `create-github-release` after it prepares the release PR.