Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
40.98k stars 9.62k forks source link

brew home --changelog to help find the project changelog #2935

Closed shamrin closed 7 years ago

shamrin commented 7 years ago

Could brew outdated help people with the decision to upgrade the package? Currently you have to do brew home <formula> (or brew home $(brew outdated)) and then manually search the project website for the release notes. Often it involves several clicks. You could also google for "\<formula> changelog", but it often fails or requires more than one click.

From the previous discussion at https://github.com/Homebrew/legacy-homebrew/issues/20617#issuecomment-19735213:

brew log <formula> only shows the changes to the formula… Its too much work to copy the upstream change log into home-brew.

I agree with the above. It's error-prone and tedious to provide a changelog copy. But what about brew home --changelog or brew changelog command? It would work similar to brew home, but would open changelog web page in the browser .

This way you could do:

brew home --changelog <formula>

or:

brew home --changelog $(brew outdated)

This would require one new piece of metadata for formulas. I propose to call it changelog. It could be called changes as well. Some examples:

fish:

class Fish < Formula
  desc "User-friendly command-line shell for UNIX-like operating systems"
  homepage "https://fishshell.com"
  changelog "https://fishshell.com/release_notes.html"

fzf:

class Fzf < Formula
  desc "Command-line fuzzy finder written in Go"
  homepage "https://github.com/junegunn/fzf"
  changelog "https://github.com/junegunn/fzf/blob/master/CHANGELOG.md"

docker:

class Docker < Formula
  desc "Pack, ship and run any application as a lightweight container"
  homepage "https://www.docker.com/"
  changelog "https://docs.docker.com/release-notes/docker-ce/"

caddy:

class Caddy < Formula
  desc "Alternative general-purpose HTTP/2 web server"
  homepage "https://caddyserver.com/"
  changelog "https://github.com/mholt/caddy/releases"
  url "https://github.com/mholt/caddy/archive/v0.10.4.tar.gz"
  sha256 "411e6bf10520e938712887a31f2132bfd19e2c79543e7aef158f7c77d03ae2bf"
  head "https://github.com/mholt/caddy.git"
  changelog "https://github.com/mholt/caddy/releases"

speedtest-cli (link to git commits, because the project doesn't provide the official release notes page):

class SpeedtestCli < Formula
  desc "Command-line interface for https://speedtest.net bandwidth tests"
  homepage "https://github.com/sivel/speedtest-cli"
  url "https://github.com/sivel/speedtest-cli/archive/v1.0.6.tar.gz"
  sha256 "9ed312e552929241ed090e0c9370801c348e252af89e498034cf4a1ae2aa8aaa"
  revision 1
  head "https://github.com/sivel/speedtest-cli.git"
  changelog "https://github.com/sivel/speedtest-cli/commits/master"
MikeMcQuaid commented 7 years ago

This is a nice idea but we'd need to go backfill this for all existing formulae which isn't something we're going to do, unfortunately. The best thing to do would be to make this an external command in a tap and when you have values for all of homebrew/core submit it as a pull request back here and we'll look at including it in the DSL. Sorry and thanks!

shamrin commented 7 years ago

@MikeMcQuaid Thank you for your kind reply! Seems like a reasonable plan. And I didn't know I could add custom brew commands. Good to know.

ghost commented 7 years ago

FWIW I wished brew and brew cask had this options as welll