diff --git a/.github/autobump.txt b/.github/autobump.txt index 01803a4b9eaa3..d8fc453664ffd 100644 --- a/.github/autobump.txt +++ b/.github/autobump.txt @@ -718,6 +718,7 @@ git-cola git-credential-oauth git-delta git-lfs +git-split-diffs git-town git-xargs gitbackup diff --git a/Formula/g/git-split-diffs.rb b/Formula/g/git-split-diffs.rb new file mode 100644 index 0000000000000..1bdaae3a03f2b --- /dev/null +++ b/Formula/g/git-split-diffs.rb @@ -0,0 +1,38 @@ +require "language/node" + +class GitSplitDiffs < Formula + desc "Syntax highlighted side-by-side diffs in your terminal" + homepage "https://github.com/banga/git-split-diffs" + url "https://registry.npmjs.org/git-split-diffs/-/git-split-diffs-1.1.0.tgz" + sha256 "124709db0b14ba1543553e8774d44c0c2361f4d4765f71df5d9d6d345cc104ed" + license "MIT" + + bottle do + sha256 cellar: :any_skip_relocation, all: "5b348302822608e4fe122591d8b0d89cffa0a1687b79c6d49bab09fbbc9dc22b" + end + + depends_on "node" + + def install + system "npm", "install", *Language::Node.std_npm_install_args(libexec) + bin.install_symlink Dir["#{libexec}/bin/*"] + end + + test do + system "git", "init", "--initial-branch=main" + system "git", "config", "user.name", "BrewTestBot" + system "git", "config", "user.email", "BrewTestBot@test.com" + + (testpath/"test").write "foo" + system "git", "add", "test" + system "git", "commit", "-m", "Initial commit" + (testpath/"test").delete + (testpath/"test").write "bar" + system "git", "add", "test" + system "git", "commit", "-m", "Second commit" + + system "git", "config", "--global", "core.pager", "git-split-diffs --color | less -RFX" + + assert_match "bar", shell_output("git diff HEAD^1...HEAD") + end +end