Skip to content

info: show other installed versions#22241

Merged
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
HaraldNordgren:info-link-state-and-versioned-siblings
May 16, 2026
Merged

info: show other installed versions#22241
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
HaraldNordgren:info-link-state-and-versioned-siblings

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented May 12, 2026

Copy link
Copy Markdown
Contributor

Give user info about sibling formulae:

❯ brew info go@1.24
==> go@1.24 ✔: stable 1.24.13 (bottled) [keg-only]
Open source programming language to build simple/reliable/efficient software
https://go.dev/
Deprecated because it is not supported upstream! It will be disabled on 2027-02-11.
Installed (on request)
/opt/homebrew/Cellar/go@1.24/1.24.13_1 (14,126 files, 256.2MB)
  Poured from bottle using the internal formulae.brew.sh API on 2026-05-12 at 09:38:28
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/g/go@1.24.rb
License: BSD-3-Clause
==> Caveats
go@1.24 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have go@1.24 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/go@1.24/bin:$PATH"' >> ~/.zshrc

The following go@1.24 executables are shadowed by other linked Homebrew commands:
  go (shadowed by /opt/homebrew/bin/go from go)
  gofmt (shadowed by /opt/homebrew/bin/gofmt from go)
Running these by name will not invoke the version provided by Homebrew.
Run `brew link go@1.24` to switch the active version to this keg.
==> Installed versions
  go, go@1.26 (1.26.2) *
  go@1.24 (1.24.13_1)
  go@1.22 (1.22.12)

❯ brew link go@1.24
Unlinking /opt/homebrew/Cellar/go/1.26.2... 2 symlinks removed.
Linking /opt/homebrew/Cellar/go@1.24/1.24.13_1... 2 symlinks created.

❯ brew info go
==> go ↑: 1.26.2 → stable 1.26.3 (bottled), HEAD
Open source programming language to build simple/reliable/efficient software
https://go.dev/
Installed (on request)
/opt/homebrew/Cellar/go/1.26.2 (14,948 files, 228.5MB)
  Poured from bottle using the formulae.brew.sh API on 2026-05-02 at 21:10:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/g/go.rb
License: BSD-3-Clause
==> Dependencies
Dependents: 2
==> Options
--HEAD
	Install HEAD version
==> Caveats
The following go executables are shadowed by other linked Homebrew commands:
  go (shadowed by /opt/homebrew/bin/go from go@1.24)
  gofmt (shadowed by /opt/homebrew/bin/gofmt from go@1.24)
Running these by name will not invoke the version provided by Homebrew.
Run `brew link go` to switch the active version to this keg.
==> Installed versions
  go, go@1.26 (1.26.2)
  go@1.24 (1.24.13_1) *
  go@1.22 (1.22.12)

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR.

Claud Code, Extra High


@HaraldNordgren HaraldNordgren marked this pull request as ready for review May 12, 2026 09:14
@MikeMcQuaid

Copy link
Copy Markdown
Member

/opt/homebrew/Cellar/go@1.24/1.24.13_1 (14,126 files, 256.2MB)

and

go@1.24 (1.24.13_1) *

both output the same information.

I think if we want to highlight other versions it should avoid duplication.

Also as a general note @HaraldNordgren: I'm getting concerned that we may make brew info less useful if we just keep adding information without removing any. Thoughts?

@HaraldNordgren

HaraldNordgren commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

/opt/homebrew/Cellar/go@1.24/1.24.13_1 (14,126 files, 256.2MB)

and

go@1.24 (1.24.13_1) *

both output the same information.

I don't quite follow this? Do you mean the star for a linked formula, it's quite hidden imo, not sure how many users look here. It's there for a formula without any siblings as well. So for me I would consider dropping it:

/opt/homebrew/Cellar/go/1.26.2 (14,948 files, 228.5MB) *

Also as a general note @HaraldNordgren: I'm getting concerned that we may make brew info less useful if we just keep adding information without removing any. Thoughts?

Could be true! Even if I'm spraying PR's at the moment, these are things I have had in the back of my head for the 10 or so years I've been using Homebrew and teaching my team to use brew, so not just randomly adding stuff 🤗

@HaraldNordgren

Copy link
Copy Markdown
Contributor Author

Or do you mean the location of the keg itself? Yes, that also seems quite specific and not necessarily useful unless the user wants --verbose.

/opt/homebrew/Cellar/go@1.24/1.24.13_1 (14,126 files, 256.2MB)

It doesn't tell me if it's linked or not.

@MikeMcQuaid

Copy link
Copy Markdown
Member

I don't quite follow this? Do you mean the star for a linked formula, it's quite hidden imo, not sure how many users look here. It's there for a formula without any siblings as well. So for me I would consider dropping it:

I mean that this section will output multiple kegs for e.g. go so, if we want to output e.g. some go@another.version kegs: it might make sense to have them "nearby" and in a similar format.

Even if I'm spraying PR's at the moment, these are thing I have had in the back of my head for the 10 or so years I've been using Homebrew and teaching my team to use brew, so not just randomly adding stuff 🤗

Ok good to know 👍🏻

@HaraldNordgren

HaraldNordgren commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

I mean that this section will output multiple kegs for e.g. go so, if we want to output e.g. some go@another.version kegs: it might make sense to have them "nearby" and in a similar format.

@MikeMcQuaid Ah, so you mean collapse the new ==> Installed versions section and instead adding all the version paths up here?

/opt/homebrew/Cellar/go@1.24/1.24.13_1 (14,126 files, 256.2MB)

Maybe, but not necessarily clearer for me as a user. If so, we should add some explanatory text as well!

@MikeMcQuaid

Copy link
Copy Markdown
Member

the new ==> Installed versions section and instead adding all the version paths up here?

Yeh. Or we make that part of the installed versions section and display similar information. I'd like to avoid repetition between sections that are relatively far apart from one another.

@HaraldNordgren HaraldNordgren changed the title info: add installed versions section info: show other installed versions May 12, 2026
@HaraldNordgren

Copy link
Copy Markdown
Contributor Author

the new ==> Installed versions section and instead adding all the version paths up here?

Yeh. Or we make that part of the installed versions section and display similar information. I'd like to avoid repetition between sections that are relatively far apart from one another.

@MikeMcQuaid Moving it down to the installed versions section would look nicer I think, the upper section is quite crowded. However, one complication is that I was not going to show that section when there are no siblings. We need to have a solution that works for any formula.

@MikeMcQuaid

Copy link
Copy Markdown
Member

@MikeMcQuaid Moving it down to the installed versions section would look nicer I think, the upper section is quite crowded. However, one complication is that I was not going to show that section when there are no siblings. We need to have a solution that works for any formula.

Yeh. I think the "installed versions" language makes sense even for the current output? what do you think?

@HaraldNordgren

HaraldNordgren commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@MikeMcQuaid Updated, looks much nicer! I renamed the section to "Installed" so it wouldn't look weird for formulae without siblings:

❯ brew info go
==> go ↑: 1.26.2 → stable 1.26.3 (bottled), HEAD
Open source programming language to build simple/reliable/efficient software
https://go.dev/
Installed (on request)
  Poured from bottle using the formulae.brew.sh API on 2026-05-02 at 21:10:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/g/go.rb
License: BSD-3-Clause
==> Dependencies
Dependents: 2
==> Options
--HEAD
	Install HEAD version
==> Caveats
The following go executables are shadowed by other linked Homebrew commands:
  go (shadowed by /opt/homebrew/bin/go from go@1.24)
  gofmt (shadowed by /opt/homebrew/bin/gofmt from go@1.24)
Running these by name will not invoke the version provided by Homebrew.
Run `brew link go` to switch the active version to this keg.
==> Installed
  go, go@1.26 (1.26.2), /opt/homebrew/Cellar/go/1.26.2 (14,948 files, 228.5MB)
  go@1.24 (1.24.13_1), /opt/homebrew/Cellar/go@1.24/1.24.13_1 (14,126 files, 256.2MB) *
  go@1.22 (1.22.12), /opt/homebrew/Cellar/go@1.22/1.22.12 (12,874 files, 263MB)
==> Analytics
install: 134,503 (30 days), 477,136 (90 days), 1,527,674 (365 days)
install-on-request: 103,957 (30 days), 377,611 (90 days), 1,198,882 (365 days)
build-error: 581 (30 days)
❯ brew info x264
==> x264 ↑: r3108 → stable r3222 (bottled), HEAD
H.264/AVC encoder
https://www.videolan.org/developers/x264.html
Installed (as dependency)
  Poured from bottle using the formulae.brew.sh API on 2024-02-22 at 21:33:27
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/x/x264.rb
License: GPL-2.0-or-later
==> Dependencies
Dependents: 1
==> Options
--HEAD
	Install HEAD version
==> Installed
  /opt/homebrew/Cellar/x264/r3108 (11 files, 4.5MB) *
==> Analytics
install: 59,048 (30 days), 184,665 (90 days), 460,562 (365 days)
install-on-request: 642 (30 days), 1,856 (90 days), 7,719 (365 days)
build-error: 7 (30 days)

@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch from 6293853 to 9aa1f4c Compare May 12, 2026 12:30

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! More comments.

Comment thread Library/Homebrew/cmd/info.rb Outdated
Comment thread Library/Homebrew/cmd/info.rb Outdated
Comment thread Library/Homebrew/cmd/info.rb Outdated
Comment thread Library/Homebrew/cmd/info.rb Outdated
Comment thread Library/Homebrew/caveats.rb
@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch from 0a81675 to 02cefbb Compare May 12, 2026 18:43
Comment thread Library/Homebrew/cmd/info.rb Outdated
@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch 2 times, most recently from 4c7272e to 1c27a6f Compare May 13, 2026 17:37
@HaraldNordgren

HaraldNordgren commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@MikeMcQuaid Here is an output that I like.

  • Got rid of "Not installed" line, the header already tells us this
  • Show more sibling info in tabular format, even uninstalled formulae with installed siblings
  • Dropped "Poured from bottle using the formulae.brew.sh API on 2026-05-13 at 20:41:47"
❯ brew info go@1.26
==> go ↑: 1.26.2 → stable 1.26.3 (bottled), HEAD
Open source programming language to build simple/reliable/efficient software
https://go.dev/
Other names: go@1.26, golang, google-go
Installed (on request)
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/g/go.rb
License: BSD-3-Clause
==> Installed Kegs and Versions
  go ↑       1.26.2     /opt/homebrew/Cellar/go/1.26.2          (14,948 files, 228.5MB)  [Linked]
  go@1.24 ✔  1.24.13_1  /opt/homebrew/Cellar/go@1.24/1.24.13_1  (14,126 files, 256.2MB)
  go@1.22 ✔  1.22.12    /opt/homebrew/Cellar/go@1.22/1.22.12    (12,874 files, 263MB)
❯ brew info mysql
==> mysql ✘: stable 9.6.0 (bottled)
Open source relational database management system
https://github.com/mysql/mysql-server
Other names: mysql@9.6
Conflicts with:
  mariadb (because both install the same binaries)
  percona-server (because both install the same binaries)
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/m/mysql.rb
License: GPL-2.0-only WITH Universal-FOSS-exception-1.0
==> Installed Kegs and Versions
  mysql@8.0 ✔  8.0.46  /opt/homebrew/Cellar/mysql@8.0/8.0.46  (319 files, 317.8MB)  [Linked]

@HaraldNordgren

HaraldNordgren commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Big output for Python on my machine, but I think it's correct:

❯ brew info python
==> python@3.14 ✔: stable 3.14.5 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
Other names: python, python3, python@3
Installed (as dependency)
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/p/python@3.14.rb
License: Python-2.0
==> Installed Kegs and Versions
  python@3.14 ✔  3.14.5    /opt/homebrew/Cellar/python@3.14/3.14.5    (3,767 files, 76MB)    [Linked]
  python@3.14 ✔  3.14.4    /opt/homebrew/Cellar/python@3.14/3.14.4    (3,993 files, 79.8MB)
  python@3.14 ✔  3.14.3_1  /opt/homebrew/Cellar/python@3.14/3.14.3_1  (3,995 files, 80.8MB)
  python@3.13 ↑  3.13.2    /opt/homebrew/Cellar/python@3.13/3.13.2    (3,387 files, 70.8MB)  [Linked]
  python@3.13 ↑  3.13.1    /opt/homebrew/Cellar/python@3.13/3.13.1    (3,278 files, 68.5MB)
  python@3.12 ↑  3.12.8    /opt/homebrew/Cellar/python@3.12/3.12.8    (3,372 files, 70.7MB)  [Linked]

@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch 3 times, most recently from a208399 to e05bc1a Compare May 15, 2026 09:05
@HaraldNordgren

Copy link
Copy Markdown
Contributor Author

@MikeMcQuaid Can I get some review here please?

@MikeMcQuaid

Copy link
Copy Markdown
Member

@HaraldNordgren yes, please give me a bit 🙇🏻

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, sorry for delay. Almost there!

Comment thread Library/Homebrew/cmd/info.rb Outdated
Comment thread Library/Homebrew/cmd/info.rb Outdated
Comment thread Library/Homebrew/cmd/info.rb Outdated
Comment thread Library/Homebrew/test/cask/info_spec.rb
@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch from a667b1b to 451306c Compare May 15, 2026 16:38
@HaraldNordgren

Copy link
Copy Markdown
Contributor Author

@MikeMcQuaid Thanks a lot! Pushed a new version and squashed all commits.

@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch 2 times, most recently from 38519d3 to d2c7401 Compare May 15, 2026 17:58

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@HaraldNordgren Came to ✅ based on local testing but: one more tiny thing, sorry! This is way better, thanks for your hard work and patience here.

Comment thread Library/Homebrew/test/cask/info_spec.rb
@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch from d2c7401 to 4b21838 Compare May 16, 2026 12:58
@HaraldNordgren HaraldNordgren force-pushed the info-link-state-and-versioned-siblings branch from 4b21838 to a2b77dc Compare May 16, 2026 13:21

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks again @HaraldNordgren!

@MikeMcQuaid MikeMcQuaid enabled auto-merge May 16, 2026 13:36
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 16, 2026

@Lauraje276 Lauraje276 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very helpful

Merged via the queue into Homebrew:main with commit 174e0d8 May 16, 2026
36 checks passed
@HaraldNordgren HaraldNordgren mentioned this pull request Jun 28, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants