Skip to content

magus/homebrew-git-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homebrew-git-stack

homebrew formula for git-stack

install

brew tap magus/git-stack
brew install git-stack

Preparing for homebrew/core

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.

  1. Run a command like below to create the local formula you will use to test and submit to homebrew/core

    brew create --node https://registry.npmjs.org/git-stack-cli/-/git-stack-cli-1.15.1.tgz
  2. Copy the contents of Formula/git-stack.core.rb into the generated local formula

  3. Install the formula, note the path to the source file generated by brew create above

    brew install --verbose --build-from-source /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/g/git-stack-cli.rb
  4. After install you can test the formula

    brew test git-stack-cli
  5. Use the command below to audit the formula

    brew audit --new git-stack-cli

Why brew tap and not homebrew/core?

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.

https://docs.brew.sh/Formula-Cookbook#audit-the-formula

git-stack.core.rb.template does the full build of the single-file 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.

https://docs.brew.sh/Bottles

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.

setup

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

Resources

Bun formula was very informative on how to handle CPU architectures etc.

https://github.com/oven-sh/homebrew-bun/blob/main/Formula/bun.rb

About

homebrew formula for git-stack

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages