kabel / homebrew-php-ext

🐘🌐 Core PHP extension formulae not suitable for Homebrew/core
BSD 2-Clause "Simplified" License
122 stars 18 forks source link

Fetching homebrew-php-ext failed #29

Closed DevDavido closed 3 years ago

DevDavido commented 3 years ago

Hi, thank you for the work you put into this repository/tap. 👍

After making the brew repo unshallow and try to run brew update I get the error from kabel/homebrew-php-ext:

fatal: couldn't find remote ref refs/heads/master
Error: Fetching /usr/local/Homebrew/Library/Taps/kabel/homebrew-php-ext failed!
kabel commented 3 years ago

https://github.com/kabel/homebrew-php-ext#troubleshooting

panosru commented 3 years ago

@kabel, even after running brew update-reset:

==> Fetching /usr/local/Homebrew/Library/Taps/kabel/homebrew-php-ext...
fatal: couldn't find remote ref refs/heads/master
error: Not a valid ref: refs/remotes/origin/main

==> Resetting /usr/local/Homebrew/Library/Taps/kabel/homebrew-php-ext...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.

I'm still getting an error when I run brew update:

fatal: couldn't find remote ref refs/heads/master
Error: Fetching /usr/local/Homebrew/Library/Taps/kabel/homebrew-php-ext failed!
panosru commented 3 years ago

btw, I think the error happens normally because inside /usr/local/Homebrew/Library/Taps/kabel/homebrew-php-ext/.git/config you can see:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
    autocrlf = false
[remote "origin"]
    url = https://github.com/kabel/homebrew-php-ext
    fetch = +refs/heads/master:refs/remotes/origin/master
[branch "master"]
    remote = origin
    merge = refs/heads/master
[homebrew]
    private = false

It is looking for master branch, but the master branch in this repo has been renamed to main due to the new politically correct crap, I mean policies that GitHub introduced.

Editing the file manually and replace master with main in the config file and then run brew update-reset fixed the issue.

DevDavido commented 3 years ago

As @panosru mentioned running brew update-reset brings up the same error like he posted. brew doctor didn't help either.

panosru commented 3 years ago

@DevDavido, just follow my latest post and you will be good to go ;)

kabel commented 3 years ago

Sad to see the brew commands are a bit fragile. The other option is to untap and retap.

panosru commented 3 years ago

@kabel, I believe that in current situation, brew is not to blame, github decided to go a more PC way, which many, including me, don't like, but still, it is githubs' decision; thus, when it came into effect, brew broke because it was pointing to a reference that no longer exists. Untap and tap is the easier solution, which actually I believe is the best compared to the one I provided above.

kabel commented 3 years ago

I appreciate your feedback, but please keep the divisive language to a minimum. I made the conscious decision to change default branch names, fully knowing there would likely be some hiccups.

panosru commented 3 years ago

Thankfully github gave the option to us to decide how we like to proceed, otherwise I would've be moving :) Cheers