Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fixlr/ruby-git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ruby-git/ruby-git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 13,256 additions and 2,963 deletions.
  1. +38 −0 .commitlintrc.yml
  2. +15 −0 .github/issue_template.md
  3. +8 −0 .github/pull_request_template.md
  4. +47 −0 .github/workflows/continuous_integration.yml
  5. +28 −0 .github/workflows/enforce_conventional_commits.yml
  6. +50 −0 .github/workflows/experimental_continuous_integration.yml
  7. +52 −0 .github/workflows/release.yml
  8. +7 −2 .gitignore
  9. +1 −0 .husky/commit-msg
  10. +3 −0 .release-please-manifest.json
  11. +10 −0 .yardopts
  12. +483 −0 CHANGELOG.md
  13. +351 −0 CONTRIBUTING.md
  14. +5 −0 Gemfile
  15. +0 −21 History.txt
  16. +12 −0 MAINTAINERS.md
  17. +0 −240 README
  18. +536 −0 README.md
  19. +57 −41 Rakefile
  20. +0 −27 TODO
  21. +0 −1 VERSION
  22. +0 −157 benchmark.rb
  23. +217 −0 bin/command_line_test
  24. +15 −0 bin/console
  25. +13 −0 bin/setup
  26. +27 −0 bin/test
  27. +17 −0 bin/test-in-docker
  28. +0 −555 camping/gitweb.rb
  29. +48 −49 git.gemspec
  30. +334 −93 lib/git.rb
  31. +4 −3 lib/git/author.rb
  32. +636 −241 lib/git/base.rb
  33. +77 −36 lib/git/branch.rb
  34. +37 −13 lib/git/branches.rb
  35. +287 −0 lib/git/command_line.rb
  36. +86 −0 lib/git/command_line_result.rb
  37. +28 −0 lib/git/config.rb
  38. +55 −44 lib/git/diff.rb
  39. +33 −0 lib/git/encoding_utils.rb
  40. +206 −0 lib/git/errors.rb
  41. +77 −0 lib/git/escaped_path.rb
  42. +2 −1 lib/git/index.rb
  43. +1,362 −383 lib/git/lib.rb
  44. +120 −38 lib/git/log.rb
  45. +128 −85 lib/git/object.rb
  46. +18 −13 lib/git/path.rb
  47. +19 −19 lib/git/remote.rb
  48. +4 −0 lib/git/repository.rb
  49. +7 −6 lib/git/stash.rb
  50. +22 −10 lib/git/stashes.rb
  51. +254 −56 lib/git/status.rb
  52. +127 −0 lib/git/url.rb
  53. +7 −0 lib/git/version.rb
  54. +2 −0 lib/git/working_directory.rb
  55. +40 −0 lib/git/worktree.rb
  56. +49 −0 lib/git/worktrees.rb
  57. +10 −0 package.json
  58. +36 −0 release-please-config.json
  59. +0 −15 ruby-git.gemspec
  60. +12 −0 tests/Dockerfile
  61. +0 −4 tests/all_tests.rb
  62. +5 −0 tests/docker-compose.yml
  63. +1 −0 tests/files/encoding/dot_git/COMMIT_EDITMSG
  64. +1 −0 tests/files/encoding/dot_git/HEAD
  65. +7 −0 tests/files/encoding/dot_git/config
  66. +1 −0 tests/files/encoding/dot_git/description
  67. +15 −0 tests/files/encoding/dot_git/hooks/applypatch-msg.sample
  68. +24 −0 tests/files/encoding/dot_git/hooks/commit-msg.sample
  69. +114 −0 tests/files/encoding/dot_git/hooks/fsmonitor-watchman.sample
  70. +8 −0 tests/files/encoding/dot_git/hooks/post-update.sample
  71. +14 −0 tests/files/encoding/dot_git/hooks/pre-applypatch.sample
  72. +49 −0 tests/files/encoding/dot_git/hooks/pre-commit.sample
  73. +53 −0 tests/files/encoding/dot_git/hooks/pre-push.sample
  74. +169 −0 tests/files/encoding/dot_git/hooks/pre-rebase.sample
  75. +24 −0 tests/files/encoding/dot_git/hooks/pre-receive.sample
  76. +42 −0 tests/files/encoding/dot_git/hooks/prepare-commit-msg.sample
  77. +128 −0 tests/files/encoding/dot_git/hooks/update.sample
  78. BIN tests/files/encoding/dot_git/index
  79. +6 −0 tests/files/encoding/dot_git/info/exclude
  80. +2 −0 tests/files/encoding/dot_git/logs/HEAD
  81. +2 −0 tests/files/encoding/dot_git/logs/refs/heads/master
  82. +2 −0 tests/files/encoding/dot_git/objects/20/aefc8947d5bf08710afabe7712a1d6040ed5bd
  83. +1 −0 tests/files/encoding/dot_git/objects/54/82c9609dd461acafcc859279490acfdea01f00
  84. BIN tests/files/encoding/dot_git/objects/87/d9aa884f84c67ac2185530f0b84d5eebda3eca
  85. BIN tests/files/encoding/dot_git/objects/91/59312af5dd77ca1fac174a3b965a806451b5c6
  86. BIN tests/files/encoding/dot_git/objects/cf/921422e5382afe0c90a772a2cb37867839ae64
  87. BIN tests/files/encoding/dot_git/objects/d4/fc598fff13f7bd681ceb38afafcae631ab3e50
  88. +1 −0 tests/files/encoding/dot_git/refs/heads/master
  89. +4 −0 tests/files/encoding/test1.txt
  90. +3 −0 tests/files/encoding/test2.txt
  91. +1 −0 tests/files/working/colon_numbers.txt
  92. +13 −2 tests/files/working/dot_git/config
  93. BIN tests/files/working/dot_git/index
  94. +7 −0 tests/files/working/dot_git/logs/HEAD
  95. +3 −0 tests/files/working/dot_git/logs/refs/heads/cherry
  96. +2 −0 tests/files/working/dot_git/logs/refs/heads/diff_over_patches
  97. +1 −0 tests/files/working/dot_git/logs/refs/heads/git_grep
  98. BIN tests/files/working/dot_git/objects/0c/ac9b660896797e9cc9abb36c081a7ec0d1a7b1
  99. BIN tests/files/working/dot_git/objects/19/3505827a4694ddc21ef7b622e3e758ed6fea7e
  100. +3 −0 tests/files/working/dot_git/objects/1c/04149973fb98fe8437fde044eb44cf5eb6ddda
  101. +1 −0 tests/files/working/dot_git/objects/46/abbf07e3c564c723c7c039a43ab3a39e5d02dd
  102. BIN tests/files/working/dot_git/objects/55/cbfe9fdf29da8b9dac05cb3c515055fe52ac2d
  103. BIN tests/files/working/dot_git/objects/60/94405a5209406708ffe737077841b45c63fe25
  104. BIN tests/files/working/dot_git/objects/6f/09de178a27f7702c37907fd614c3c122d33c30
  105. BIN tests/files/working/dot_git/objects/8e/33476f852fffb06e22b244c0f97093588567ee
  106. BIN tests/files/working/dot_git/objects/b9/84607a41cc1f5c512a49213404b1b4cf8df4a6
  107. BIN tests/files/working/dot_git/objects/d6/46165a1e3a89399f72c1ffc1fcd76814c5ce1d
  108. BIN tests/files/working/dot_git/objects/e7/6778b73006b0dda0dd56e9257c5bf6b6dd3373
  109. BIN tests/files/working/dot_git/objects/fa/f8d899a0f123c3c5def10857920be1c930e8ed
  110. +1 −0 tests/files/working/dot_git/refs/heads/cherry
  111. +1 −0 tests/files/working/dot_git/refs/heads/diff_over_patches
  112. +1 −1 tests/files/working/dot_git/refs/heads/git_grep
  113. +1 −0 tests/files/working/dot_git/refs/tags/grep_colon_numbers
  114. +259 −45 tests/test_helper.rb
  115. +68 −33 tests/units/test_archive.rb
  116. +17 −18 tests/units/test_bare.rb
  117. +108 −0 tests/units/test_base.rb
  118. +270 −62 tests/units/test_branch.rb
  119. +72 −0 tests/units/test_checkout.rb
  120. +283 −0 tests/units/test_command_line.rb
  121. +48 −0 tests/units/test_command_line_env_overrides.rb
  122. +25 −0 tests/units/test_command_line_error.rb
  123. +19 −0 tests/units/test_command_line_result.rb
  124. +26 −0 tests/units/test_commit_with_empty_message.rb
  125. +39 −0 tests/units/test_commit_with_gpg.rb
  126. +53 −14 tests/units/test_config.rb
  127. +37 −0 tests/units/test_config_module.rb
  128. +21 −0 tests/units/test_describe.rb
  129. +71 −17 tests/units/test_diff.rb
  130. +41 −0 tests/units/test_diff_non_default_encoding.rb
  131. +22 −0 tests/units/test_diff_with_escaped_path.rb
  132. +30 −42 tests/units/test_each_conflict.rb
  133. +41 −0 tests/units/test_escaped_path.rb
  134. +24 −0 tests/units/test_failed_error.rb
  135. +29 −0 tests/units/test_git_alt_uri.rb
  136. +92 −0 tests/units/test_git_base_root_of_worktree.rb
  137. +60 −0 tests/units/test_git_binary_version.rb
  138. +162 −0 tests/units/test_git_clone.rb
  139. +41 −0 tests/units/test_git_default_branch.rb
  140. +97 −0 tests/units/test_git_dir.rb
  141. +14 −12 tests/units/test_git_path.rb
  142. +23 −0 tests/units/test_ignored_files_with_escaped_path.rb
  143. +137 −78 tests/units/test_index_ops.rb
  144. +129 −38 tests/units/test_init.rb
  145. +371 −59 tests/units/test_lib.rb
  146. +51 −0 tests/units/test_lib_meets_required_version.rb
  147. +96 −0 tests/units/test_lib_repository_default_branch.rb
  148. +84 −17 tests/units/test_log.rb
  149. +48 −29 tests/units/test_logger.rb
  150. +22 −0 tests/units/test_ls_files_with_escaped_path.rb
  151. +48 −0 tests/units/test_ls_tree.rb
  152. +121 −86 tests/units/test_merge.rb
  153. +122 −0 tests/units/test_merge_base.rb
  154. +42 −37 tests/units/test_object.rb
  155. +141 −0 tests/units/test_pull.rb
  156. +103 −0 tests/units/test_push.rb
  157. +235 −33 tests/units/test_remotes.rb
  158. +6 −26 tests/units/test_repack.rb
  159. +85 −0 tests/units/test_rm.rb
  160. +20 −0 tests/units/test_show.rb
  161. +24 −0 tests/units/test_signaled_error.rb
  162. +43 −0 tests/units/test_signed_commits.rb
  163. +126 −30 tests/units/test_stashes.rb
  164. +240 −0 tests/units/test_status.rb
  165. +617 −0 tests/units/test_status_object.rb
  166. +631 −0 tests/units/test_status_object_empty_repo.rb
  167. +53 −0 tests/units/test_submodule.rb
  168. +68 −19 tests/units/test_tags.rb
  169. +42 −0 tests/units/test_thread_safety.rb
  170. +26 −0 tests/units/test_timeout_error.rb
  171. +177 −112 tests/units/test_tree_ops.rb
  172. +114 −0 tests/units/test_url_clone_to.rb
  173. +100 −0 tests/units/test_url_parse.rb
  174. +22 −0 tests/units/test_windows_cmd_escaping.rb
  175. +190 −0 tests/units/test_worktree.rb
38 changes: 38 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
extends: '@commitlint/config-conventional'

rules:
# See: https://commitlint.js.org/reference/rules.html
#
# Rules are made up by a name and a configuration array. The configuration
# array contains:
#
# * Severity [0..2]: 0 disable rule, 1 warning if violated, or 2 error if
# violated
# * Applicability [always|never]: never inverts the rule
# * Value: value to use for this rule (if applicable)
#
# Run `npx commitlint --print-config` to see the current setting for all
# rules.
#
header-max-length: [2, always, 100] # Header can not exceed 100 chars

type-case: [2, always, lower-case] # Type must be lower case
type-empty: [2, never] # Type must not be empty

# Supported conventional commit types
type-enum: [2, always, [build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test]]

scope-case: [2, always, lower-case] # Scope must be lower case

# Error if subject is one of these cases (encourages lower-case)
subject-case: [2, never, [sentence-case, start-case, pascal-case, upper-case]]
subject-empty: [2, never] # Subject must not be empty
subject-full-stop: [2, never, "."] # Subject must not end with a period

body-leading-blank: [2, always] # Body must have a blank line before it
body-max-line-length: [2, always, 100] # Body lines can not exceed 100 chars

footer-leading-blank: [2, always] # Footer must have a blank line before it
footer-max-line-length: [2, always, 100] # Footer lines can not exceed 100 chars

15 changes: 15 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Subject of the issue
Describe your issue here.

### Your environment
* version of git and ruby-git
* version of ruby

### Steps to reproduce
Tell us how to reproduce this issue.

### Expected behaviour
What did you expect to happen?

### Actual behaviour
What actually happened?
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Review our [guidelines for contributing](https://github.com/ruby-git/ruby-git/blob/master/CONTRIBUTING.md) to this repository. A good start is to:

* Write tests for your changes
* Run `rake` before pushing
* Include / update docs in the README.md and in YARD documentation

# Description

47 changes: 47 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
pull_request:
branches: [master]
workflow_dispatch:

jobs:
build:
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}

# Skip this job if triggered by a release PR
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
runs-on: ${{ matrix.operating-system }}
continue-on-error: ${{ matrix.experimental == 'Yes' }}
env: { JAVA_OPTS: -Djdk.io.File.enableADS=true }

strategy:
fail-fast: false
matrix:
# Only the latest versions of JRuby and TruffleRuby are tested
ruby: ["3.1", "3.2", "3.3", "3.4", "truffleruby-24.1.2", "jruby-9.4.12.0"]
operating-system: [ubuntu-latest]
experimental: [No]
include:
- # Only test with minimal Ruby version on Windows
ruby: 3.1
operating-system: windows-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Run Build
run: bundle exec rake default

- name: Test Gem
run: bundle exec rake test:gem
28 changes: 28 additions & 0 deletions .github/workflows/enforce_conventional_commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Conventional Commits

permissions:
contents: read

on:
pull_request:
branches:
- master

jobs:
commit-lint:
name: Verify Conventional Commits

# Skip this job if this is a release PR
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with: { fetch-depth: 0 }

- name: Check Commit Messages
uses: wagoid/commitlint-github-action@v6
with: { configFile: .commitlintrc.yml }
50 changes: 50 additions & 0 deletions .github/workflows/experimental_continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI Experimental

on:
push:
branches: [master]

workflow_dispatch:

jobs:
build:
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}

# Skip this job if triggered by pushing a release commit
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore: release '))
runs-on: ${{ matrix.operating-system }}
continue-on-error: true
env: { JAVA_OPTS: -Djdk.io.File.enableADS=true }

strategy:
fail-fast: false
matrix:
include:
- # Building against head version of Ruby is considered experimental
ruby: head
operating-system: ubuntu-latest
experimental: Yes

- # Since JRuby on Windows is known to not work, consider this experimental
ruby: jruby-head
operating-system: windows-latest
experimental: Yes

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Run Build
run: bundle exec rake default

- name: Test Gem
run: bundle exec rake test:gem
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Release Gem

description: |
This workflow creates a new release on GitHub and publishes the gem to
RubyGems.org.
The workflow uses the `googleapis/release-please-action` to handle the
release creation process and the `rubygems/release-gem` action to publish
the gem to rubygems.org
on:
push:
branches: ["master"]

workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

environment:
name: RubyGems
url: https://rubygems.org/gems/git

permissions:
contents: write
pull-requests: write
id-token: write

steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Create release
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.AUTO_RELEASE_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

- name: Setup ruby
uses: ruby/setup-ruby@v1
if: ${{ steps.release.outputs.release_created }}
with:
bundler-cache: true
ruby-version: ruby

- name: Push to RubyGems.org
uses: rubygems/release-gem@v1
if: ${{ steps.release.outputs.release_created }}
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
*.gem
*.kpf
*.sw?
.DS_Store
coverage
rdoc
doc
.yardoc
pkg

rdoc
Gemfile.lock
node_modules
package-lock.json
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit "$1"
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "3.1.0"
}
10 changes: 10 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--default-return=''
--hide-void-return
--markup-provider=redcarpet
--markup=markdown
--fail-on-warning
-
README.md
CHANGELOG.md
CONTRIBUTING.md
MAINTAINERS.md
Loading