76 Commits

Author SHA1 Message Date
Jack Nagel
8c4e7ca5b5 Parse raw diff output in brew update
Using each_cons() "works", but to report all changes correctly we need
to look at the last elements even after we've looked at the last 3
consecutive elements.

Instead, let's parse each line of the raw diff output using a regexp.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-23 20:39:24 -05:00
Jack Nagel
9076037a0d Detect and display renames in brew update
Renamed formulae will cease to display as an add/delete pair and instead
end up the in the "Renamed" section. In the future we should be able to
take this information and use it to rename existing kegs during updates,
allowing us to rename formulae without breaking upgrades.

Renaming a formula requires renaming the class, so there will be at
least one add/delete pair in the file. Thus, the similarity threshold
for detecting renames is set at 85% to allow a little bit of content
turnover without losing track of the rename.

Closes Homebrew/homebrew#11158.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-22 22:15:57 -05:00
Jack Nagel
10f8443f8a Use --verify when querying HEAD
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-22 22:15:57 -05:00
Mike McQuaid
23b84ef732 Set MACOS_VERSION as 0 on non-OSX platforms. 2012-03-18 15:43:39 +13:00
Max Howell
88604e1bb1 Handle when formula are deleted from taps
The symlinks in Formula must be updated.
2012-03-18 01:23:01 +00:00
Max Howell
7280590e88 Link new tapped formula during brew update
Required me to spoil tap's code. All in the name of DRY! Alas!
2012-03-16 21:06:17 +00:00
Max Howell
921f0e5674 brew update will update taps 2012-03-16 21:06:16 +00:00
Jack Nagel
28d6a0f4de update: disable git line ending conversion
If a user has set core.autocrlf = true (which shouldn't ever be used on
OS X, but alas...), a subsequent `brew update` will check out files with
CRLF line endings. Setting core.autocrlf = false in Homebrew's repo
config will override this global setting, and let us check out files
with their in-repository line endings.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-02 18:37:48 -06:00
Max Howell
e26797f471 Allow brew update --rebase 2011-09-20 02:30:31 +01:00
Jack Nagel
536446b664 Use HTTPS during brew update
Closes Homebrew/homebrew#7527.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-10 16:24:51 -05:00
Misty De Meo
69e766a699 fix brew update treating command changes as deletions
`brew update` was treating all changes to internal commands as
deletions due to a typo, resulting in spurious notifications of removed
commands.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-31 12:16:01 -05:00
Jack Nagel
54e7eb3b90 update: make git pull update origin/master
Specify the refspec 'refs/heads/master:refs/remotes/origin/master' so
that the remote-tracking branch origin/master gets update during `brew
update` (git-pull updates remote-tracking branches when invoked
like `git pull` or `git pull origin`, but not `git pull origin master`).

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-31 12:10:49 -05:00
Max Howell
7c5073fff2 Feature new/removed internal commands
Removed updated external commands, like seriously, who cares? We could add it back as if --verbose is set I guess but in all honesty, if nobody complains then nobody cared.

# We removed many redundant comments
Removed many redundant comments.

Fixes Homebrew/homebrew#7191; though it could be fixed better.
2011-08-26 13:26:46 +01:00
Max Howell
0d6aff5e1b Fix brew update after new install for real this time?
Fixes Homebrew/homebrew#7220.
2011-08-26 11:25:09 +01:00
Max Howell
98fc60db69 brew update uses origin rather than full URL
This is more flexible for forks and personal customisations, and also more useful for us collaborators since the origin HEAD will be kept up-to-date.
2011-08-25 01:20:33 +01:00
Max Howell
31885c2a99 Constants that are used once are dumb
It just means nobody knows what is being done without scrolling up and down, up and down the file like a doofus on a pogo stick.
2011-08-24 22:30:42 +01:00
Max Howell
554147fa99 Reset --hard after the first git init
We don't know what revision the tarball was when homebrew was installed, so all we can do really is hard reset. In theory some set of git commands should suffice, but apparently --soft and --mixed resets ended up putting stuff in the index which would break subsequent `brew updates`.

Fixes Homebrew/homebrew#6851
2011-08-06 11:11:06 +01:00
Jack Nagel
fd6c9833c6 Fix brew update local changes bug
Users were seeing local changes in their repository after updating, even
though they had made no local changes.

The repository setup sequence should use `git reset --soft` rather than
vanilla `git reset`, which defaults to '--mixed'. '--soft' updates
_only_ HEAD, leaving the index as-is, allowing future incantations of
`brew update` to proceed without errors.

Fixes Homebrew/homebrew#6732.
2011-08-02 13:21:06 +01:00
Adam Vandenberg
f30893a968 Fix brew update on Leopard 2011-07-31 10:32:09 -07:00
Max Howell
98ffbeb8f5 Make the check for a valid git repo better
Because the new installer creates the .git directory when it installs.
2011-07-29 14:55:41 +01:00
Max Howell
1587c70357 Don’t output "nothing" messages
This is how we do it in general in Homebrew.
2011-06-17 09:30:25 +01:00
Max Howell
a656243377 Don’t error out if the Cellar doesn’t yet exist 2011-06-15 13:04:06 +01:00
Max Howell
08f31bc573 Fix first brew update with Git 1.7.4+; Fixes Homebrew/homebrew#5128
Behaviour for git checkout was changed such that the update would fail because it refused to checkout files on to existing files in the working directory.

This was bad behaviour anyway, we should make efforts to keep any local modifications to the Homebrew checkout. Everything is neatly resolved if we just do a --soft reset.

Closes Homebrew/homebrew#6017.
2011-06-15 13:02:48 +01:00
Mislav Marohnić
8c521ca3d0 refactor update command to use git diff instead of parsing pull output
This fixes reporting of which formulae changed in git versions where `pull`
output is not compatible.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-06-14 14:47:39 -07:00
Jonas Pfenniger
c2c21edae4 brew up: star installed formulae
When running `brew up`, if a mentioned formulae is also installed,
it will get a wildcard start at the end.
It makes it easier to see if any installed formulae is impacted.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-03-21 22:10:39 -07:00
Max Howell
768910283a Refactor the brew command into one file per command
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.

But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.

If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.

Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
2011-03-12 11:55:02 -08:00