aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update.rb
AgeCommit message (Collapse)Author
2016-02-15Promote update-bash to the default updater.Mike McQuaid
Also, rename the existing updater to `update-ruby` to allow using as a fallback. It will eventually be removed. Closes Homebrew/homebrew#49109. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-08update: abbreviate hashes to at least 7 charactersJoseph Frazier
Abbreviations will be longer if needed to preserve uniqueness. This makes it more consistent with `git rev-parse --short`, https://github.com/Homebrew/homebrew/commits, etc. For example, instead of: Updated Homebrew from 40d1e9c2 to 90b9bdf4. We see: Updated Homebrew from 40d1e9c to 90b9bdf. See 0c48248b6555353c8d60b61973639c8423ce586c for the original introduction of eight-character abbreviations.
2016-01-05doctor: move code away from cmd/Baptiste Fontaine
Closes Homebrew/homebrew#47665. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-04update: avoid unnecessarily recreating 'master'Martin Afanasjew
This only affects the behavior of `brew update` while being on a branch `feature` that doesn't track the upstream branch. For simplicity, the upstream branch is assumed to be called `master` (`@upstream_branch` in the code). Consider the following simplified commit history: master origin/master (current state of remote) | | A---B---C---D---E---F \ G---H---I | feature (HEAD) If `origin/master` is equal to `master` and also points at commit `C`, then `brew update` will update both `master` and `origin/master` to `F` and report on the changes in the range `C..F`. However, if `origin/master` is equal to `E` because some commits have been already fetched with `git fetch origin`, then `brew update` will recreate `master` from `origin/master` and then pull in the commits from the remote to update both to `F`. Because `master` gets recreated from a younger `origin/master`, the report will only contain changes from the range `E..F` (thus omitting the changes from `C..E`). This commit adjusts the logic to not recreate `master` if it can be safely fast-forwarded to `origin/master` (the common case). This fixes the problem from the second scenario and again reports on the desired range `C..F`. Closes Homebrew/homebrew#46951. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-13update: make stashing local changes more robustMartin Afanasjew
Users with local changes and without a configured Git identity won't be able to update Homebrew via `brew update`, as the update will fail when trying to stash the local modifications with `git stash`. They will be unable to proceed until they follow Git's advice to configure their identity or they manage to revert their local changes. This change always sets a commit e-mail and name, avoiding this issue. A nice bonus is that experienced Git users can see who created the stash commit (identifying `brew update` as the author). Fixes Homebrew/homebrew#46930. Closes Homebrew/homebrew#46939. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-09Allow taps to link manpages.Mike McQuaid
A blocker for https://github.com/caskroom/homebrew-cask/pull/15381 being merged. Closes Homebrew/homebrew#46795.
2015-12-09avoid using FORMULA_RENAMES directlyXu Cheng
2015-12-07Use `(installed)` and emoji ticks consistently.Mike McQuaid
Across info, search and update. Closes Homebrew/homebrew#45131. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-07update: always reset to origin/master.Mike McQuaid
Do a reset to `origin/master` and then stash but don't pop the stash after running update (unless you were on a branch). This may be mildly more annoying for Homebrew developers but means it's easier for our users who don't understand Git (and particularly when they don't understand that every tap is a separate Git repository). Closes Homebrew/homebrew#45825. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-03centralize the logic of handling `homebrew-` in Tap.fetchXu Cheng
Closes Homebrew/homebrew#46537. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-09cmd/update: check before tappingAlex Dunn
Follow-up to ea6c8f7e2dc8f1adf8df9065468d0b37047d4a46
2015-11-09use Tap#installXu Cheng
2015-11-04update: always rescue formula loadingXu Cheng
Closes Homebrew/homebrew#45676. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-27update: use git stash silently.Mike McQuaid
There's been a few issues where users have been confused about these errors. They may have modified stuff but we probably don't care about telling them that unless we're debugging other issues. Closes Homebrew/homebrew#45373. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-16update: report tap updates and improve wordingMartin Afanasjew
Closes Homebrew/homebrew#43468. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-15update: highlight installed formulae in reportMartin Afanasjew
Closes Homebrew/homebrew#44335. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-14update: allow updating from local branchVlad Shablinsky
Closes Homebrew/homebrew#44893. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-30cache tapsXu Cheng
There are plenty of IO operations inside Tap object, and it will be more when implementing formula alias reverse look up(e.g. list all of alias names for a formula). So let's cache them. Some benchmark: $ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null Before: 6.40s user 2.42s system 96% cpu 9.134 total After: 4.75s user 0.77s system 97% cpu 5.637 total Closes Homebrew/homebrew#44377. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-30update: add permissions checkXu Cheng
Closes Homebrew/homebrew#42048 Closes Homebrew/homebrew#44434. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-19Fix brew update for taps with non-master branchesMisty De Meo
Fixes Homebrew/homebrew#43865.
2015-09-11update: fix when `HEAD` doesn't exist.Mike McQuaid
e.g. when it's a detached `HEAD` through checking out a commit rather than a branch.
2015-09-08Improve description searching and add a cache.Dan Martinez
Closes Homebrew/homebrew#42281. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-07update: explicitly no-ff merge and rebase.Josh Hagins
This overrides user configuration which may do otherwise. Closes Homebrew/homebrew#41570. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-02update: ensure git is installedXu Cheng
2015-08-28update: secure formula loading in renameXu Cheng
For update, all formula loading need to be secured by `rescue`. Otherwise it's easy to crash `brew update` for vasty reasons, e.g. new Formula DSL. Closes Homebrew/homebrew#43353. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-27update: always report changes to branch 'master'Martin Afanasjew
If the user's working copy is *not* on the 'master' branch, the revision recorded after the update to the 'master' branch is not the one of the updated 'master' branch but that of whatever the user's current branch is. This tends to be not very helpful. This change records the revision *after* the update to the 'master' branch, but *before* switching back to the user's current branch prior to the update, effectively causing the report to show changes to the 'master' branch. Closes Homebrew/homebrew#42074. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-25update: #each.map is redundantBaptiste Fontaine
2015-08-22core file style updateXu Cheng
2015-08-20update: only update renamed when necessaryXu Cheng
2015-08-20update: add formula renames to reportVlad Shablinsky
2015-08-18unnecessary calls to .select simplifiedBaptiste Fontaine
These are minor perf optimizations. Closes Homebrew/homebrew#43028. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-15update: only compute tapd_basename when necessaryXu Cheng
2015-08-10update tabs only if core formula installedVlad Shablinsky
Closes Homebrew/homebrew#42745. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-10update: fix load_tap_migrationsVlad Shablinsky
2015-08-10update: handle renames on updateVlad Shablinsky
2015-08-07update: handle more exceptionsXu Cheng
Closes Homebrew/homebrew#42558. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-06update: loading core files at the beginningXu Cheng
This should help to prevent similar situation of Homebrew/homebrew#42553 happening in the future.
2015-08-03Core files style updates.BrewTestBot
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-07-30Tap: allow enumerate non-git tapsXu Cheng
Also add a `Tap#git?` method to indicate whether the tap is a git repository. Closes Homebrew/homebrew#42264. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-09update: fix --rebaseMike McQuaid
2015-07-09update: stash save/pop uncommitted changes.Mike McQuaid
Also: - return to your previous branch after `brew update`. Closes Homebrew/homebrew#38568. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-11(un)tap/update/readall: use Tap classXu Cheng
2015-06-02update: only display version changed formulaeXu Cheng
Closes Homebrew/homebrew#40090. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-27Remove dead codeJack Nagel
2015-05-27tap/untap/update/prune: remove obsolete method, add migrate_tapsXu Cheng
2014-09-18Remove obsolete nil guardJack Nagel
This was added in 3a7a3619f7016c75c3e53e944221bf7f6354a63b to make the tests pass, but this method is now stubbed out in the tests, so we can assume $? will be non-nil.
2014-09-18Pass command and arg list into ErrorDuringExecution constructorJack Nagel
2014-08-12Set the remote config manuallyJack Nagel
See 5cd6b35 and 8eefd4e.
2014-07-31Handle tap file renames that remove a file from the formula directoryJack Nagel
2014-07-26Remove obsolete hacks from updater reportJack Nagel