Closed mblakele closed 11 years ago
Indeed, looks like a place to improve. Some check if git is sane.
However, you had a lot of older kegs
(i.e. versions) installed in the Cellar
, which is another issue brew could improve. Usually brew cleanup
helps a bit with removing old versions that are not needed.
I have proposed earlier that brew link git
should use the one with the highest version number (and issue a small warning, because some version numbering schemes suck).
If find it strange that fatal: bad config file line 18 in /Users/mblakele/.gitconfig
claims the config file is "bad"...
Can you gist.github.com you .gitconfig?
The reason is that because your Homebrew git is not linked, it is using the Xcode-provided git which is too old to recognize the "simple" push option.
I've run brew cleanup
and added it to my daily-update script. Not sure why it wasn't there before.
My .gitconfig
is 17 lines long, and hasn't changed in 33 days. Normally brew has no problem with it, and I think that's just a symptom of git not working.
$ wc -l /Users/mblakele/.gitconfig
17 /Users/mblakele/.gitconfig
$ tail /Users/mblakele/.gitconfig
branch = auto
status = auto
diff = auto
[alias]
st = status
ci = commit
co = checkout
br = branch
[push]
default = simple
There's not really anything I can think of that can improve this. Homebrew can only relink after failed installs if there is only one other keg (in other words, if there is more than one it doesn't know which one to relink). Coupled with what I noted above, you will see issues until you relink a git that is capable of understanding push.default = simple.
Closing because this isn't something we can control. The risk you take when using cutting-edge git features is that older git won't understand them.
If brew is interrupted while updating git, it leaves git unlinked - and in my environment unlinkable. Can anything be done to make this more robust? Maybe wait to unlink the old version until the new version is ready?
At this point the wifi goes down, and brew hangs. As it exits I see:
Now any git-dependent brew functions are broken.
All these errors appear to come from git not working. Maybe the doctor can help?
OK, but the suggested fix doesn't work:
$ brew link git Error: git has multiple installed versions
Instead the fix seems to be to explicitly switch to the last known version.
It looks like I should run 'brew cleanup' more often. But can anything be done to make this more robust?