Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad suggested remote url correction #6909

Closed
3 tasks done
qayshp opened this issue Jan 9, 2020 · 0 comments · Fixed by #6914
Closed
3 tasks done

bad suggested remote url correction #6909

qayshp opened this issue Jan 9, 2020 · 0 comments · Fixed by #6914
Labels
outdated PR was locked due to age

Comments

@qayshp
Copy link

qayshp commented Jan 9, 2020

Checklist

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
    -- not exactly, as the bug comes from doctor
  • ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

running brew doctor to check my configuration for errors.
The git repositories had been switched from http to ssh protocol (fetch and push) by accident (automated action done by Sourcetree).

What happened (include command output)

It suggested I set my remote origin to a URL that had an extra https://github.com/ preppended to it.

Command output
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Suspicious https://github.com/Homebrew/brew git origin remote found.
The current git origin is:
ssh://git@github.com/Homebrew/brew

With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
git -C "/usr/local/Homebrew" remote set-url origin https://github.com/https://github.com/Homebrew/brew

What you expected to happen

I would have expected either this not to be a warning in brew doctor or for a correct URL to have been provided in the warning.
For example:
git -C "/usr/local/Homebrew" remote set-url origin https://github.com/Homebrew/brew

Step-by-step reproduction instructions (by running brew commands)

  1. $ git -C "/usr/local/Homebrew" remote set-url origin ssh://git@github.com/Homebrew/brew
  2. $ brew doctor

Output of brew config and brew doctor commands

$ brew config
HOMEBREW_VERSION: 2.2.2-65-gbcb8f4d
ORIGIN: ssh://git@github.com/Homebrew/brew
HEAD: bcb8f4da5f48bb4ad96c1c66af0a3b5996f711d1
Last commit: 5 hours ago
Core tap ORIGIN: ssh://git@github.com/Homebrew/homebrew-core
Core tap HEAD: f9c54e5886912d9fda2ba6fb69de815c8f95bf6e
Core tap last commit: 28 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_BREW_GIT_REMOTE: https://github.com/Homebrew/brew
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.1 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 13.0.1
macOS: 10.15.2-x86_64
CLT: N/A
Xcode: 11.3
XQuartz: 2.7.11 => /opt/X11

Git config file for example from brew repository:

[remote "origin"]
	url = ssh://git@github.com/Homebrew/brew
	fetch = +refs/heads/*:refs/remotes/origin/*
	pushurl = ssh://git@github.com/Homebrew/brew

Relevant line of code with instructions:

git -C "#{repository_path}" remote set-url origin #{Formatter.url("https://github.com/#{desired_origin}")}

@lock lock bot added the outdated PR was locked due to age label Feb 9, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant