Brew: `brew cleanup` should `git prune`

Created on 17 Aug 2018  路  7Comments  路  Source: Homebrew/brew

I ran git prune in brew's repo and it removed 5k+ items:

Homebrew (master) $ brew cleanup
Homebrew (master) $ git prune
Checking connectivity: 51957, done.

Is there a downside to doing this? I believe this would clear space on the users' computers, which I find beneficial.

features outdated

Most helpful comment

Sorry, I misread this. brew cleanup should perhaps do brew prune but not git prune. git prune is done by Git when it needs to be done.

All 7 comments

There's not. Please fill out the issue template in future though (which would point you towards Discourse for similar issues 馃槃).

@MikeMcQuaid I actually filled out the "New Feature Suggestion" template (which suggested replacement) and I tried searching discourse for "git prune" and found nothing?

Ok, it doesn't look to me like you followed the template but this is still an issue worth keeping open. A PR would be great!

I assume the intention would be to _only_ apply this to the brew repo? Mostly asking because even after doing multiple git prune operations in core I still pop an average of 27 seconds per git prune there.

@MikeMcQuaid, on second thought you're right about template and asking the downside to git prune question on discourse. Sorry about that!

I looked into putting git prune in Library/Homebrew/cleanup.rb but I'm wondering if it should actually go in Library/Homebrew/cmd/update.sh so that users don't need to run cleanup and it sort've fits in with the other git commands.

  1. Which file should it go in?
  2. Any guidance on where to place it within that file?
  3. Do you agree that the user shouldn't see any output (> /dev/null)?

@DomT4 I'm running it on $(brew --prefix)/Homebrew? Is core installed on our machines?

I'm running it on $(brew --prefix)/Homebrew? Is core installed on our machines?

Aye, it's the primary tap for formulae and ships by default. brew --repo homebrew/core will give you its location.

Sorry, I misread this. brew cleanup should perhaps do brew prune but not git prune. git prune is done by Git when it needs to be done.

Was this page helpful?
0 / 5 - 0 ratings