Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

'brew update' fails the second time #6851

Closed
xose opened this issue Aug 6, 2011 · 3 comments
Closed

'brew update' fails the second time #6851

xose opened this issue Aug 6, 2011 · 3 comments

Comments

@xose
Copy link
Contributor

xose commented Aug 6, 2011

'brew update' seems to fail the second time it is run on a new homebrew installation.

Factory install of Lion and Xcode 4.1:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/Formula/...
/usr/local/Library/Homebrew/...

Press enter to continue
==> /usr/bin/sudo /bin/mkdir /usr/local
==> /usr/bin/sudo /bin/chmod o+w /usr/local
==> Downloading and Installing Homebrew...
==> /usr/bin/sudo /bin/chmod o-w /usr/local
==> Installation successful!
Now type: brew help

$ brew update
Initialized empty Git repository in /usr/local/.git/
remote: Counting objects: 40879, done.
remote: Compressing objects: 100% (18250/18250), done.
remote: Total 40879 (delta 24812), reused 36251 (delta 22037)
Receiving objects: 100% (40879/40879), 5.65 MiB | 971 KiB/s, done.
Resolving deltas: 100% (24812/24812), done.
From http://github.com/mxcl/homebrew
 * branch            HEAD       -> FETCH_HEAD
From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
Already up-to-date.

$ brew update
error: The following untracked working tree files would be overwritten by checkout:

[... very long list of ALL homebrew files ...]

Aborting
Error: Failure while executing: git checkout -q master 

This seems to happen only on new installs, 'brew update' still works fine on my other ones.

I fixed it by running 'git reset' in /usr/local.

@jacknagel
Copy link
Contributor

Dang, I thought this was finally fixed in cbcd4a3.

...I will investigate.

@jacknagel
Copy link
Contributor

I guess cbcd4a3 probably needs to be reverted, though now I don't understand what was causing the earlier (unstaged local changes) bug.

@jacknagel
Copy link
Contributor

There's a reverting commit here: jacknagel/homebrew@27dd197

However it doesn't really fix anything in that it will only reintroduce the old behavior, which was also broken.

I don't have anything better to do, so I will continue to work on this in my free time, but considering how confident I was that the '--soft' patch would work it would be good to have some fresh eyes take a look at this, so if anyone sees what the real issue is here, please chime in and suggest a fix.

ping @mxcl

@mxcl mxcl closed this as completed in 9e5e27b Aug 6, 2011
Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 19, 2011
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#6851
martinploeger pushed a commit to martinploeger/homebrew that referenced this issue Oct 8, 2011
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#6851
etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 27, 2011
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#6851
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
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#6851
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants