Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HOMEBREW_GREEDY or variants #15097

Closed
1 task done
mvshmakov opened this issue Mar 30, 2023 · 6 comments · Fixed by #15160
Closed
1 task done

Support HOMEBREW_GREEDY or variants #15097

mvshmakov opened this issue Mar 30, 2023 · 6 comments · Fixed by #15160
Labels
features New features help wanted We want help addressing this in progress Maintainers are working on this outdated PR was locked due to age

Comments

@mvshmakov
Copy link

mvshmakov commented Mar 30, 2023

Verification

Provide a detailed description of the proposed feature

Would be nice if Homebrew supported the following env variables:

  • HOMEBREW_GREEDY
  • HOMEBREW_GREEDY_LATEST
  • HOMEBREW_GREEDY_AUTO_UPDATES

When set, the commands that accept respected flags (--greedy, --greedy-latest, and --greedy-auto-updates) should behave as this flag was set even if it wasn't. Would be nice if brew autoupdate start will also support it.

What is the motivation for the feature?

I'm used to running brew upgrade --greedy all the time, and it seems like there is no environment variable to set this flag by default.

How will the feature be relevant to at least 90% of Homebrew users?

This feature is relevant for everyone who is always using --greedy and embeds it in the custom shell functions (e.g., Stack Overflow, GitHub).

What alternatives to the feature have been considered?

The alternative is already implemented – --greedy flag and friends, but it is not really convenient to type it every upgrade.

Also, any other variable names with the same functionality would also be appreciated.

@mvshmakov mvshmakov added the features New features label Mar 30, 2023
@reitermarkus
Copy link
Member

Back when this was introduced I was already arguing that --greedy should be the default behaviour, since I want versions to be controlled by Homebrew rather than apps themselves, so I agree there should be a variable for always enabling this.

@apainintheneck
Copy link
Contributor

I think that it probably makes sense to just start with HOMEBREW_GREEDY at least initially. We can add the other ones later on if people want them but I don't know if there'd be much interest to be honest.

@reitermarkus
Copy link
Member

Yeah, I don't think we need all variants. The vast majority of casks are also versioned now, so --greedy-latest isn't as impactful.

@carlocab
Copy link
Member

carlocab commented Mar 31, 2023

Or we can just use HOMEBREW_GREEDY for all of that:

  • to use --greedy-latest, set HOMEBREW_GREEDY=latest
  • to use --greedy-autoupdates, set HOMEBREW_GREEDY=autoupdates
  • to use both --greedy-latest and --greedy-autoupdate, set HOMEBREW_GREEDY=latest,autoupdates or HOMEBREW_GREEDY=autoupdates,latest
  • to use --greedy, set HOMEBREW_GREEDY=1 (or to any other non-empty string not used in the above cases)

@MikeMcQuaid
Copy link
Member

I think that it probably makes sense to just start with HOMEBREW_GREEDY at least initially. We can add the other ones later on if people want them but I don't know if there'd be much interest to be honest.

Agreed. I'd be 👍🏻 to have just this implemented for now.

@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label Mar 31, 2023
@razvanazamfirei razvanazamfirei added the in progress Maintainers are working on this label Mar 31, 2023
@bevanjkay
Copy link
Member

Personally I run --greedy-auto-updates 90% of the time and then do an occasional run with --greedy.

The biggest difference for me is that --greedy|--greedy-latest now downloads the binaries to compare the shasums when the version of the cask is :latest. So at least for my list of installed casks, running brew outdated or upgrade with --greedy is considerably heavier on network resources than --greedy-auto-updates.

I wouldn't use the environment variable myself, as I have shell commands to handle these, but just wanted to mention the extra network usage for --greedy.

@github-actions github-actions bot added the outdated PR was locked due to age label May 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
features New features help wanted We want help addressing this in progress Maintainers are working on this outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants