homebrew formula for git-stack
brew tap magus/git-stack
brew install git-stack
Use the Formula Cookbook to generate a local formula for testing.
Most of the work is done under Formula/git-stack.core.rb
using the templates/git-stack.core.rb.template
.
The formula are build as a part of the publish process in magus/git-stack-cli
.
-
Run a command like below to create the local formula you will use to test and submit to
homebrew/core
brew create https://registry.npmjs.org/git-stack-cli/-/git-stack-cli-1.0.3.tgz --node
-
Copy the contents of
Formula/git-stack.core.rb
into the generated local formula -
Use the command below to test the formula
brew test git-stack
-
Use the command below to audit the formula
brew audit --new git-stack
In order to submit to core the Github repo needs to be notable enough 75+ stars, 30+ forks, 30+ watchers, etc.
Until that time it is simpler to just do a tap and install binaries directly, bypassing homebrew/core
.
When running brew audit --new git-stack
we receive the error below
❯ brew audit --new git-stack
git-stack
* GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)
Error: 1 problem in 1 formula detected.
git-stack.core.rb.template
does the full build of the standalone executable for the appropriate target platform.
However this is an expensive operation and takes a long time since it requires fetching the node
binary to bundle alongside git-stack
.
In homebrew/core
this would generate a bottle
for all the platforms and not really be an issue since most installs
would use the prebuilt bottle
.
git-stack.tap.rb.template
on the other hand, leverages prebuilt binaries attached to Github.
This allows us to build the binaries once time for all targets and download them directly in the formula.
This gets around the otherwise prohibitively long install time.
git submodule add https://github.com/magus/homebrew-git-stack-cli homebrew
git submodule init
git submodule update
git add .gitmodules homebrew
git commit
git push
after cloning
git submodule update --init --recursive