diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb
index 78c8ee5f5b..ee70350095 100644
--- a/Library/Homebrew/brew.rb
+++ b/Library/Homebrew/brew.rb
@@ -64,8 +64,13 @@ begin
if cmd
internal_cmd = require? HOMEBREW_LIBRARY_PATH.join("cmd", cmd)
- if !internal_cmd && ARGV.homebrew_developer?
+ unless internal_cmd
internal_cmd = require? HOMEBREW_LIBRARY_PATH.join("dev-cmd", cmd)
+ if internal_cmd && !ARGV.homebrew_developer?
+ safe_system "git", "config", "--file=#{HOMEBREW_REPOSITORY}/.git/config",
+ "--replace-all", "homebrew.devcmdrun", "true"
+ ENV["HOMEBREW_DEV_CMD_RUN"] = "1"
+ end
end
end
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index 1651e82624..70a23a39c3 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -191,11 +191,26 @@ case "$HOMEBREW_COMMAND" in
--config) HOMEBREW_COMMAND="config" ;;
esac
+if [[ -z "$HOMEBREW_DEVELOPER" ]]
+then
+ export HOMEBREW_GIT_CONFIG_FILE="$HOMEBREW_REPOSITORY/.git/config"
+ HOMEBREW_GIT_CONFIG_DEVELOPERMODE="$(git config --file="$HOMEBREW_GIT_CONFIG_FILE" --get homebrew.devcmdrun)"
+ if [[ "$HOMEBREW_GIT_CONFIG_DEVELOPERMODE" = "true" ]]
+ then
+ export HOMEBREW_DEV_CMD_RUN="1"
+ fi
+fi
+
if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]]
then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh"
-elif [[ -n "$HOMEBREW_DEVELOPER" && -f "$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" ]]
+elif [[ -f "$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" ]]
then
+ if [[ -z "$HOMEBREW_DEVELOPER" ]]
+ then
+ git config --file="$HOMEBREW_GIT_CONFIG_FILE" --replace-all homebrew.devcmdrun true
+ export HOMEBREW_DEV_CMD_RUN="1"
+ fi
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh"
fi
diff --git a/Library/Homebrew/cmd/command.rb b/Library/Homebrew/cmd/command.rb
index 8c8a8c6990..b76468f621 100644
--- a/Library/Homebrew/cmd/command.rb
+++ b/Library/Homebrew/cmd/command.rb
@@ -1,13 +1,15 @@
#: * `command`
analytics (on|off)Turn on/off Homebrew's analytics.
analytics regenerate-uuidRegenerate UUID used in Homebrew's analytics.
audit [--strict] [--online] [--new-formula] [--display-cop-names] [--display-filename] [formulae]Check formulae for Homebrew coding style violations. This should be -run before submitting a new formula.
- -If no formulae are provided, all of them are checked.
- -If --strict is passed, additional checks are run, including RuboCop
-style checks.
If --online is passed, additional slower checks that require a network
-connection are run.
If --new-formula is passed, various additional checks are run that check
-if a new formula is eligable for Homebrew. This should be used when creating
-new formulae and implies --strict and --online.
If --display-cop-names is passed, the RuboCop cop name for each violation
-is included in the output.
If --display-filename is passed, every line of output is prefixed with the
-name of the file or formula being audited, to make the output easy to grep.
audit exits with a non-zero status if any errors are found. This is useful,
-for instance, for implementing pre-commit hooks.
cat formulaDisplay the source to formula.
cleanup [--prune=days] [--dry-run] [-s] [formulae]For all installed or specific formulae, remove any older versions from the cellar. In addition, old downloads from the Homebrew download-cache are deleted.
@@ -82,24 +59,6 @@ With--include-aliases, the aliases of internal commands will be in
configShow Homebrew and system configuration useful for debugging. If you file a bug report, you will likely be asked for this information if you do not provide it.
create URL [--autotools|--cmake] [--no-fetch] [--set-name name] [--set-version version] [--tap user/repo]Generate a formula for the downloadable file at URL and open it in the editor.
-Homebrew will attempt to automatically derive the formula name
-and version, but if it fails, you'll have to make your own template. The wget
-formula serves as a simple example. For the complete API have a look at
http://www.rubydoc.info/github/Homebrew/brew/master/Formula
- -If --autotools is passed, create a basic template for an Autotools-style build.
-If --cmake is passed, create a basic template for a CMake-style build.
If --no-fetch is passed, Homebrew will not download URL to the cache and
-will thus not add the SHA256 to the formula for you.
The options --set-name and --set-version each take an argument and allow
-you to explicitly set the name and version of the package you are creating.
The option --tap takes a tap as its argument and generates the formula in
-the specified tap.
deps [--1] [-n] [--union] [--full-name] [--installed] [--include-build] [--include-optional] [--skip-recommended] formulaeShow dependencies for formulae. When given multiple formula arguments, show the intersection of dependencies for formulae.
@@ -149,8 +108,6 @@ and allow you to explicitly set the name and version of the package you are installing.doctorCheck your system for potential problems. Doctor exits with a non-zero status if any problems are found.
editOpen all of Homebrew for editing.
edit formulaOpen formula in the editor.
fetch [--force] [--retry] [-v] [--devel|--HEAD] [--deps] [--build-from-source|--force-bottle] formulaeDownload the source packages for the given formulae. For tarballs, also print SHA-256 checksums.
@@ -395,21 +352,6 @@ for version isv1.
tap-pin tapPin tap, prioritizing its formulae over core when formula names are supplied
by the user. See also tap-unpin.
tap-unpin tapUnpin tap so its formulae are no longer prioritized. See also tap-pin.
test [--devel|--HEAD] [--debug] [--keep-tmp] formulaA few formulae provide a test method. brew test formula runs this
-test method. There is no standard output or return code, but it should
-generally indicate to the user if something is wrong with the installed
-formula.
To test the development or head version of a formula, use --devel or
---HEAD.
If --debug is passed and the test fails, an interactive debugger will be
-launched with access to IRB or a shell inside the temporary test directory.
If --keep-tmp is passed, the temporary files created for the test are
-not deleted.
Example: brew install jruby && brew test jruby
uninstall, rm, remove [--force] formulaUninstall formula.
If --force is passed, and there are multiple versions of formula
@@ -494,6 +436,156 @@ the prefix and repository are the same directory.
audit [--strict] [--online] [--new-formula] [--display-cop-names] [--display-filename] [formulae]Check formulae for Homebrew coding style violations. This should be +run before submitting a new formula.
+ +If no formulae are provided, all of them are checked.
+ +If --strict is passed, additional checks are run, including RuboCop
+style checks.
If --online is passed, additional slower checks that require a network
+connection are run.
If --new-formula is passed, various additional checks are run that check
+if a new formula is eligable for Homebrew. This should be used when creating
+new formulae and implies --strict and --online.
If --display-cop-names is passed, the RuboCop cop name for each violation
+is included in the output.
If --display-filename is passed, every line of output is prefixed with the
+name of the file or formula being audited, to make the output easy to grep.
audit exits with a non-zero status if any errors are found. This is useful,
+for instance, for implementing pre-commit hooks.
bottle [--verbose] [--no-rebuild] [--keep-old] [--skip-relocation] [--root-url=<root_url>]:bottle --merge [--no-commit] [--keep-old] [--write]:Generate a bottle (binary package) from a formula installed with
+--build-bottle.
bump-formula-pr [--devel] [--dry-run] [--audit|--strict] --url=url --sha256=sha-256 formula:bump-formula-pr [--devel] [--dry-run] [--audit|--strict] --tag=tag --revision=revision formulaCreates a pull request to update the formula with a new url or a new tag.
+ +If a url is specified, the sha-256 checksum of the new download must +also be specified.
+ +If a tag is specified, the git commit revision corresponding to that +tag must also be specified.
+ +If --devel is passed, bump the development rather than stable version.
+The development spec must already exist.
If --dry-run is passed, print what would be done rather than doing it.
If --audit is passed, run brew audit before opening the PR.
If --strict is passed, run brew audit --strict before opening the PR.
Note that this command cannot be used to transition a formula from a +url-and-sha256 style specification into a tag-and-revision style +specification, nor vice versa. It must use whichever style specification +the preexisting formula already uses.
create URL [--autotools|--cmake] [--no-fetch] [--set-name name] [--set-version version] [--tap user/repo]Generate a formula for the downloadable file at URL and open it in the editor.
+Homebrew will attempt to automatically derive the formula name
+and version, but if it fails, you'll have to make your own template. The wget
+formula serves as a simple example. For the complete API have a look at
http://www.rubydoc.info/github/Homebrew/brew/master/Formula
+ +If --autotools is passed, create a basic template for an Autotools-style build.
+If --cmake is passed, create a basic template for a CMake-style build.
If --no-fetch is passed, Homebrew will not download URL to the cache and
+will thus not add the SHA256 to the formula for you.
The options --set-name and --set-version each take an argument and allow
+you to explicitly set the name and version of the package you are creating.
The option --tap takes a tap as its argument and generates the formula in
+the specified tap.
editOpen all of Homebrew for editing.
edit formulaOpen formula in the editor.
linkage [--test] [--reverse] formula-nameChecks the library links of an installed formula.
+ +Only works on installed formulae. An error is raised if it is run on +uninstalled formulae.
+ +If --test is passed, only display missing libraries and exit with a
+non-zero exit code if any missing libraries were found.
If --reverse is passed, print the dylib followed by the binaries
+which link to it for each library the keg references.
manGenerate Homebrew's manpages.
pull [--bottle] [--bump] [--clean] [--ignore-whitespace] [--resolve] [--branch-okay] [--no-pbcopy] [--no-publish] patch-source [patch-source]
Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
+Optionally, installs the formulae changed by the patch.
+
+Each <patch-source> may be one of:
+ * The ID number of a PR (Pull Request) in the homebrew/core GitHub
+ repository
+ * The URL of a PR on GitHub, using either the web page or API URL
+ formats. In this form, the PR may be on Homebrew/brew,
+ Homebrew/homebrew-core or any tap.
+ * The URL of a commit on GitHub
+ * A "http://bot.brew.sh/job/..." string specifying a testing job ID
+
+
+ If --bottle was passed, handle bottles, pulling the bottle-update
+ commit and publishing files on Bintray.
+ If --bump was passed, for one-formula PRs, automatically reword
+ commit message to our preferred format.
+ If --clean was passed, do not rewrite or otherwise modify the
+ commits found in the pulled PR.
+ If --ignore-whitespace was passed, silently ignore whitespace
+ discrepancies when applying diffs.
+ If --resolve was passed, when a patch fails to apply, leave in
+ progress and allow user to
+ resolve, instead of aborting.
+ If --branch-okay was passed, do not warn if pulling to a branch
+ besides master (useful for testing).
+ If --no-pbcopy was passed, do not copy anything to the system
+ If --no-publish was passed, do not publish bottles to Bintray.
tap_readme [-v] nameGenerate the README.md file for a new tap.
test [--devel|--HEAD] [--debug] [--keep-tmp] formulaA few formulae provide a test method. brew test formula runs this
+test method. There is no standard output or return code, but it should
+generally indicate to the user if something is wrong with the installed
+formula.
To test the development or head version of a formula, use --devel or
+--HEAD.
If --debug is passed and the test fails, an interactive debugger will be
+launched with access to IRB or a shell inside the temporary test directory.
If --keep-tmp is passed, the temporary files created for the test are
+not deleted.
Example: brew install jruby && brew test jruby
tests [-v] [--coverage] [--generic] [--no-compat] [--only=--seed seed] [--trace] [--online] [--official-cmd-taps]Run Homebrew's unit and integration tests.
update-test [--commit=<sha1>] [--before=<date>] [--keep-tmp]Runs a test of brew update with a new repository clone.
If no arguments are passed, use origin/master as the start commit.
If --commit=<sha1> is passed, use <sha1> as the start commit.
If --before=<date> is passed, use the commit at <date> as the
+start commit.
If --keep-tmp is passed, retain the temporary directory containing
+the new repository clone.
Homebrew, like git(1), supports external commands. These are executable
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index 41ba07e6af..1877a39477 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -56,31 +56,6 @@ Turn on/off Homebrew\'s analytics\.
Regenerate UUID used in Homebrew\'s analytics\.
.
.TP
-\fBaudit\fR [\fB\-\-strict\fR] [\fB\-\-online\fR] [\fB\-\-new\-formula\fR] [\fB\-\-display\-cop\-names\fR] [\fB\-\-display\-filename\fR] [\fIformulae\fR]
-Check \fIformulae\fR for Homebrew coding style violations\. This should be run before submitting a new formula\.
-.
-.IP
-If no \fIformulae\fR are provided, all of them are checked\.
-.
-.IP
-If \fB\-\-strict\fR is passed, additional checks are run, including RuboCop style checks\.
-.
-.IP
-If \fB\-\-online\fR is passed, additional slower checks that require a network connection are run\.
-.
-.IP
-If \fB\-\-new\-formula\fR is passed, various additional checks are run that check if a new formula is eligable for Homebrew\. This should be used when creating new formulae and implies \fB\-\-strict\fR and \fB\-\-online\fR\.
-.
-.IP
-If \fB\-\-display\-cop\-names\fR is passed, the RuboCop cop name for each violation is included in the output\.
-.
-.IP
-If \fB\-\-display\-filename\fR is passed, every line of output is prefixed with the name of the file or formula being audited, to make the output easy to grep\.
-.
-.IP
-\fBaudit\fR exits with a non\-zero status if any errors are found\. This is useful, for instance, for implementing pre\-commit hooks\.
-.
-.TP
\fBcat\fR \fIformula\fR
Display the source to \fIformula\fR\.
.
@@ -113,25 +88,6 @@ If \fB\-\-quiet\fR is passed, list only the names of commands without the header
Show Homebrew and system configuration useful for debugging\. If you file a bug report, you will likely be asked for this information if you do not provide it\.
.
.TP
-\fBcreate\fR \fIURL\fR [\fB\-\-autotools\fR|\fB\-\-cmake\fR] [\fB\-\-no\-fetch\fR] [\fB\-\-set\-name\fR \fIname\fR] [\fB\-\-set\-version\fR \fIversion\fR] [\fB\-\-tap\fR \fIuser\fR\fB/\fR\fIrepo\fR]
-Generate a formula for the downloadable file at \fIURL\fR and open it in the editor\. Homebrew will attempt to automatically derive the formula name and version, but if it fails, you\'ll have to make your own template\. The \fBwget\fR formula serves as a simple example\. For the complete API have a look at
-.
-.IP
-\fIhttp://www\.rubydoc\.info/github/Homebrew/brew/master/Formula\fR
-.
-.IP
-If \fB\-\-autotools\fR is passed, create a basic template for an Autotools\-style build\. If \fB\-\-cmake\fR is passed, create a basic template for a CMake\-style build\.
-.
-.IP
-If \fB\-\-no\-fetch\fR is passed, Homebrew will not download \fIURL\fR to the cache and will thus not add the SHA256 to the formula for you\.
-.
-.IP
-The options \fB\-\-set\-name\fR and \fB\-\-set\-version\fR each take an argument and allow you to explicitly set the name and version of the package you are creating\.
-.
-.IP
-The option \fB\-\-tap\fR takes a tap as its argument and generates the formula in the specified tap\.
-.
-.TP
\fBdeps\fR [\fB\-\-1\fR] [\fB\-n\fR] [\fB\-\-union\fR] [\fB\-\-full\-name\fR] [\fB\-\-installed\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] \fIformulae\fR
Show dependencies for \fIformulae\fR\. When given multiple formula arguments, show the intersection of dependencies for \fIformulae\fR\.
.
@@ -193,14 +149,6 @@ The options \fB\-\-name=\fR\fIname\fR and \fB\-\-version=\fR\fIversion\fR each t
Check your system for potential problems\. Doctor exits with a non\-zero status if any problems are found\.
.
.TP
-\fBedit\fR
-Open all of Homebrew for editing\.
-.
-.TP
-\fBedit\fR \fIformula\fR
-Open \fIformula\fR in the editor\.
-.
-.TP
\fBfetch\fR [\fB\-\-force\fR] [\fB\-\-retry\fR] [\fB\-v\fR] [\fB\-\-devel\fR|\fB\-\-HEAD\fR] [\fB\-\-deps\fR] [\fB\-\-build\-from\-source\fR|\fB\-\-force\-bottle\fR] \fIformulae\fR
Download the source packages for the given \fIformulae\fR\. For tarballs, also print SHA\-256 checksums\.
.
@@ -542,22 +490,6 @@ Pin \fItap\fR, prioritizing its formulae over core when formula names are suppli
Unpin \fItap\fR so its formulae are no longer prioritized\. See also \fBtap\-pin\fR\.
.
.TP
-\fBtest\fR [\fB\-\-devel\fR|\fB\-\-HEAD\fR] [\fB\-\-debug\fR] [\fB\-\-keep\-tmp\fR] \fIformula\fR
-A few formulae provide a test method\. \fBbrew test\fR \fIformula\fR runs this test method\. There is no standard output or return code, but it should generally indicate to the user if something is wrong with the installed formula\.
-.
-.IP
-To test the development or head version of a formula, use \fB\-\-devel\fR or \fB\-\-HEAD\fR\.
-.
-.IP
-If \fB\-\-debug\fR is passed and the test fails, an interactive debugger will be launched with access to IRB or a shell inside the temporary test directory\.
-.
-.IP
-If \fB\-\-keep\-tmp\fR is passed, the temporary files created for the test are not deleted\.
-.
-.IP
-Example: \fBbrew install jruby && brew test jruby\fR
-.
-.TP
\fBuninstall\fR, \fBrm\fR, \fBremove\fR [\fB\-\-force\fR] \fIformula\fR
Uninstall \fIformula\fR\.
.
@@ -684,6 +616,182 @@ Display where tap \fIuser\fR\fB/\fR\fIrepo\fR\'s directory is located\.
\fB\-\-version\fR
Print the version number of Homebrew to standard output and exit\.
.
+.SH "DEVELOPER COMMANDS"
+.
+.TP
+\fBaudit\fR [\fB\-\-strict\fR] [\fB\-\-online\fR] [\fB\-\-new\-formula\fR] [\fB\-\-display\-cop\-names\fR] [\fB\-\-display\-filename\fR] [\fIformulae\fR]
+Check \fIformulae\fR for Homebrew coding style violations\. This should be run before submitting a new formula\.
+.
+.IP
+If no \fIformulae\fR are provided, all of them are checked\.
+.
+.IP
+If \fB\-\-strict\fR is passed, additional checks are run, including RuboCop style checks\.
+.
+.IP
+If \fB\-\-online\fR is passed, additional slower checks that require a network connection are run\.
+.
+.IP
+If \fB\-\-new\-formula\fR is passed, various additional checks are run that check if a new formula is eligable for Homebrew\. This should be used when creating new formulae and implies \fB\-\-strict\fR and \fB\-\-online\fR\.
+.
+.IP
+If \fB\-\-display\-cop\-names\fR is passed, the RuboCop cop name for each violation is included in the output\.
+.
+.IP
+If \fB\-\-display\-filename\fR is passed, every line of output is prefixed with the name of the file or formula being audited, to make the output easy to grep\.
+.
+.IP
+\fBaudit\fR exits with a non\-zero status if any errors are found\. This is useful, for instance, for implementing pre\-commit hooks\.
+.
+.TP
+\fBbottle\fR [\fB\-\-verbose\fR] [\fB\-\-no\-rebuild\fR] [\fB\-\-keep\-old\fR] [\fB\-\-skip\-relocation\fR] [\fB\-\-root\-url=