Skip to content

Commit

Permalink
emacs-30: allow to pin revision using env var (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
d12frosted authored Jan 8, 2024
1 parent 88ba6e3 commit 18819af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
6 changes: 5 additions & 1 deletion Formula/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ class EmacsPlusAT30 < EmacsBase
# URL
#

url "https://github.com/emacs-mirror/emacs.git", :branch => "master"
if ENV['HOMEBREW_EMACS_PLUS_30_REVISION']
url "https://github.com/emacs-mirror/emacs.git", :revision => ENV['HOMEBREW_EMACS_PLUS_30_REVISION']
else
url "https://github.com/emacs-mirror/emacs.git", :branch => "master"
end

#
# Icons
Expand Down
17 changes: 4 additions & 13 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -430,23 +430,14 @@ $ brew install cask --ignore-dependencies

The most current development version is consistently compiled from a specific branch. At the time of this writing, for instance, =emacs-plus@30= is being built from the =master= branch.

Here's the relevant code snippet for the =emacs-plus@30= formula:
Ordinarily, =brew= will update to the latest commit in the specified branch during installation, meaning the exact commit you're building from varies depending on the installation timing. As development versions are less stable than official releases, some users may prefer to pin a specific commit.

#+begin_src ruby
# Formula/[email protected]
url "https://github.com/emacs-mirror/emacs.git", :branch => "master"
#+end_src

Ordinarily, =brew= will update to the latest commit in the specified branch during installation, meaning the exact commit you're building from varies depending on the installation timing. As development versions are less stable than official releases, some users may prefer to pin a specific commit. To do this, one must manually modify the formula by executing =brew edit emacs-plus@30= and altering the =url= directive to reference a specific commit, as shown below:
Usually this is done by modifying formula (i.e. by executing =brew edit emacs-plus@30= and altering the =url= directive), but you can also set =HOMEBREW_EMACS_PLUS_30_REVISION= environment variable before installing =emacs-plus@30=:

#+begin_src ruby
url "https://github.com/emacs-mirror/emacs.git", :revision => "6abea4d98d1d964c68a78cb9b5321071da851654"
#+begin_src bash
$ HOMEBREW_EMACS_PLUS_30_REVISION=6abea4d98d1d964c68a78cb9b5321071da851654 brew install emacs-plus@30 [OPTIONS]
#+end_src

#+begin_quote
⚠️ It's important to note that any local changes to commits or branches within the cached repository won't impact the build process, as =brew= overrides the state of the cloned repository during installation.
#+end_quote

** Screenshots

#+BEGIN_HTML
Expand Down

0 comments on commit 18819af

Please sign in to comment.