For tagged commits produces the output:
- `1.0.1`
For untagged commits with a dirty tree produces the output:
- `1.0.1-19-g23efbc5-dirty`
Performance:
```
git describe --tags --dirty 2> /dev/null
0.07s user 0.01s system 96% cpu 0.086 total
```
This means we can tag any commit without needing to manually remember
to bump the revision every time.
`name` is passed as argument to Formulary.factory which could later be
downcased at formulary.rb:349, but Pathname doesn't have a downcase
method. Converting `name` to String as it should be fixes the problem.
Fixes#1000.
Try to find a formula in the backtrace to make the warning message more
helpful in identifying the culprit, as the formula is not always the
immediate caller of a deprecated method. Provide some sane fallbacks if
there's not formula in the call stack.
* Move GitHub API module to utils/github.rb.
* Move curl method to utils/curl.rb.
* global: use long curl arguments and an array.
This makes the code more self-documenting.
* utils/curl: support reading curl's output.
* utils/github: use curl instead of open-uri.
It has far better proxy support.
* pull: set Homebrew user agent.
* gist-logs: remove trailing whitespace.
* gist-logs: use first instead of [0].
Easier to read.
* gist-logs: use curl-based GitHub.open method.
Avoid breaking code highlighting of some editors (e.g. Sublime Text)
when `gem` is used as an identifier. This messes up the highlighting
below the first use and makes working with the file rather annoying.
If the environment variable HOMEBREW_TEST_GENERIC_OS is set ensure that
neither Mac nor Linux-specific code is loaded. This allows easier
testing of cross-platform code on OS X and will make it easier to port
Homebrew to platforms other than OS X and Linux.
This collects all violations for each formula in a single place, instead
of doing `brew style` outputs for all formulae first, and then the other
audit checks.
Closes#112.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.
Closes#66.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
This can happen when `HOMEBREW_CURL` is set to brewed curl, but during
`brew resinstall curl`, brewed curl's symlink is temporary
unlinked.
So let's fallback to /usr/bin/curl in this case.
Generally it seems user agents are all `software/version` but ours is
not. Also, set the user agent in a way that it's shared between Bash
and Ruby code.
Closes https://github.com/Homebrew/legacy-homebrew/pull/50480.