Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

ARGV: stop supporting --homebrew-developer option #48322

Closed
wants to merge 1 commit into from
Closed

ARGV: stop supporting --homebrew-developer option #48322

wants to merge 1 commit into from

Conversation

UniqMartin
Copy link
Contributor

Homebrew developers have the corresponding variable permanently set in their environment and wanting to appear like a Homebrew developer for a single invocation is exceedingly rare. Additionally, the option won't be recognized by bin/brew. (It is also undocumented.)

Using HOMEBREW_DEVELOPER=1 brew <command> is still possible, and not more inconvenient than passing the --homebrew-developer option.

Homebrew developers have the corresponding variable permanently set in
their environment and wanting to appear like a Homebrew developer for a
single invocation is exceedingly rare. Additionally, the option won't be
recognized by `bin/brew`. (It is also undocumented.)

Using `HOMEBREW_DEVELOPER=1 brew <command>` is still possible, and not
more inconvenient than passing the `--homebrew-developer` option.
@@ -125,7 +125,7 @@ def git?
end

def homebrew_developer?
include?("--homebrew-developer") || !ENV["HOMEBREW_DEVELOPER"].nil?
!ENV["HOMEBREW_DEVELOPER"].nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t it strange to have a method defined on ARGV that now have nothing to do with ARGV? 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but it feels weird to not have the API kept.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could maybe add this on ENV and keep this method for compatibility; then at some point in the future remove it when we’ll be used to the new API?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even realize how misplaced this now looks. On the bright side, this keeps the required changes to a minimum. I'm a bit torn on how to best resolve this, as moving this to ENV doesn't feel appropriate (the extensions there are mostly concerned with the build process).

Maybe something like Config could be created for things that can be passed both via arguments and the environment? The environment variables are effectively configuration, we just don't seem to like an approach where we would put them into a file, something a lot of software allows.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we talked about it a bit on the chat; it would be great to move the ARGV extension methods in a separate module for all these global settings. The long-term goal is to remove as many references to ARGV as possible outside of cmd/ to have more predictable/testable code (i.e. calling Homebrew.foo shouldn’t depend on the arguments on the command-line; if it needs them we should call e.g. Homebrew.foo(:verbose => true)) and a clear separation of the core vs. the code that handles what is given on the command-line, so we’ll be able to e.g. automatically generate manpage/completion scripts with all the options, warn if an option is not recognized, etc.

@MikeMcQuaid
Copy link
Member

👍

@DomT4
Copy link
Member

DomT4 commented Jan 22, 2016

No objections.

@bfontaine
Copy link
Contributor

@BrewTestBot test this please.

@UniqMartin
Copy link
Contributor Author

Sorry if I'm bothering you all once more, but is that fine to merge as-is? From the discussion I'm not entirely sure if this is the case or if we'd like to postpone this until we have a better way of handling “configuration”, i.e. stuff that responds to environment variables and sometimes to arguments, too.

@MikeMcQuaid
Copy link
Member

Merge as-is

@UniqMartin UniqMartin deleted the one-night-dev branch February 11, 2016 12:18
flier pushed a commit to flier/homebrew that referenced this pull request Feb 17, 2016
Homebrew developers have the corresponding variable permanently set in
their environment and wanting to appear like a Homebrew developer for a
single invocation is exceedingly rare. Additionally, the option won't be
recognized by `bin/brew`. (It is also undocumented.)

Using `HOMEBREW_DEVELOPER=1 brew <command>` is still possible, and not
more inconvenient than passing the `--homebrew-developer` option.

Closes Homebrew#48322.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants