Currently brew extract only works for formulae in core tap. Would be cool if this works for those in other taps as well. Tap where the formula is extracted from may be specified via a --from argument. Another thing to consider is the tap where the formula is extracted to should be one different from the --from tap and also different from core. I would be happy to submit a pull request.
I have been a fan of the very useful but quite obscure brew extract. Today I wanted to checkout an older version of coursier and realized it is not possible.
I would argue that it is as relevant as how the current brew extract is relevant. The ability to install an older version of software should not apply only to core. This would be useful for taps that provide formulae for science-related software such as OSGeo/homebrew-osgeo4mac and brewsci/homebrew-bio when people need to install specific versions of the tools in order to reproduce results in a paper (I actually ran into this problem before when I needed older versions of bamtools and samtools when they were in homebrew-science).
Edit the formula/git checkout an old commit myself I guess.
The relevant lines to be changed are here:
Feel free to open a pull request adding this feature, and if you need guidance we can help you through any questions you might have.
Most helpful comment
The relevant lines to be changed are here:
https://github.com/Homebrew/brew/blob/d8c6f6b12075a06a9837f6fce920ccd07a36ca4c/Library/Homebrew/dev-cmd/extract.rb#L104-L109
Feel free to open a pull request adding this feature, and if you need guidance we can help you through any questions you might have.