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).
ClosesHomebrew/homebrew#45825.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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.
ClosesHomebrew/homebrew#45373.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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
ClosesHomebrew/homebrew#44377.
Signed-off-by: Xu Cheng <xucheng@me.com>
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.
ClosesHomebrew/homebrew#43353.
Signed-off-by: Xu Cheng <xucheng@me.com>
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.
ClosesHomebrew/homebrew#42074.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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.
Right now this code only produces false positives. When we have real
support for renames, we can implement it more carefully.
ClosesHomebrew/homebrew#31126.
There is always a git executable on PATH due to the git wrapper in
Library/Contributions/cmd. The wrapper will notify the user if there is
not a real git installed.