Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various maintenance 2022-01-22 #101

Merged
merged 7 commits into from
Jan 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ Go back to tracking a particular branch.

braid diff vendor/rails

## Supported environments

As of this writing (2022-01-20), we try to keep Braid working at least on Linux,
OSX and Windows with recent versions of its dependencies (Git, Ruby, gems, etc.).
Your mileage on other operating systems or with other versions of dependencies
may vary. We don't have a procedure in place to systematically test Braid in
multiple environments; typically, Braid developers just run the test suite on
their own systems with whatever is installed. So breakages may sometimes occur.
If you run into an environment-related problem, please report it and we'll fix
it if feasible. Contributions to improve testing of Braid would be welcome.

## Braid version compatibility

Since Braid has been regularly changing the configuration format and adding new
Expand Down
2 changes: 0 additions & 2 deletions braid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {spec}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.default_executable = %q{braid}
s.require_paths = %w(lib)

s.has_rdoc = false
s.rdoc_options = %w(--line-numbers --inline-source --title braid --main)

s.required_ruby_version = '>= 2.2.0'
Expand Down
13 changes: 12 additions & 1 deletion lib/braid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
module Braid
OLD_CONFIG_FILE = '.braids'
CONFIG_FILE = '.braids.json'
REQUIRED_GIT_VERSION = '1.6'

# See the background in the "Supported environments" section of README.md.
#
# The newest Git feature that Braid is currently known to rely on is
# `receive.denyCurrentBranch = updateInstead` (in
# spec/integration/push_spec.rb), which was added in Git 2.3.0 (in 2015). It
# doesn't seem worth even a small amount of work to remove that dependency and
# support even older versions of Git. So set that as the declared requirement
# for now. In general, a reasonable approach might be to try to support the
# oldest version of Git in current "long-term support" versions of popular OS
# distributions.
REQUIRED_GIT_VERSION = '2.3.0'

def self.verbose
!!@verbose
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/diff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
describe 'with changes' do
before do
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1') + '/layouts/layout.liquid', "#{@repository_dir}/skit-layout.liquid",
{preserve: true})
preserve: true)
in_dir(@repository_dir) do
run_command('git add *')
run_command('git commit -m "Some local changes"')
Expand Down Expand Up @@ -463,7 +463,7 @@
@filemode_enabled = filemode_enabled
end
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1x') + '/layouts/layout.liquid', "#{@repository_dir}/skit-layout.liquid",
{preserve: true})
preserve: true)
in_dir(@repository_dir) do
run_command('git add *')
run_command('git commit -m "Some local changes"')
Expand Down
8 changes: 7 additions & 1 deletion spec/integration/integration_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

BRAID_BIN = ((defined?(JRUBY_VERSION) || Gem.win_platform?) ? 'ruby ' : '') + File.join(BRAID_PATH, 'bin', 'braid')

# Use a separate, clean cache for each test case (because TMP_PATH is deleted
# and recreated for each test case). We don't want to mess with the user's real
# cache, and this ensures that previous cache contents can't affect the behavior
# of the tests.
ENV['BRAID_LOCAL_CACHE_DIR'] = File.join(TMP_PATH, 'braid-cache')

# Must run in a git repository, though we expect the setting to be the same for
# most repositories on a given OS.
def filemode_enabled
Expand Down Expand Up @@ -86,7 +92,7 @@ def run_command_expect_failure(command)
def update_dir_from_fixture(dir, fixture = dir)
to_dir = File.join(TMP_PATH, dir)
FileUtils.mkdir_p(to_dir)
FileUtils.cp_r(File.join(FIXTURE_PATH, fixture) + '/.', to_dir, {preserve: true})
FileUtils.cp_r(File.join(FIXTURE_PATH, fixture) + '/.', to_dir, preserve: true)
end

def create_git_repo_from_fixture(fixture_name, options = {})
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
end

FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1x') + '/layouts/layout.liquid', "#{@repository_dir}/skit-layout.liquid",
{preserve: true})
preserve: true)
in_dir(@repository_dir) do
run_command('git add *')
run_command('git commit -m "Make some changes to vendored files"')
Expand Down