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

Case-sensitive VCS endpoint check #868

Open
jgiokas opened this issue Jul 6, 2017 · 1 comment
Open

Case-sensitive VCS endpoint check #868

jgiokas opened this issue Jul 6, 2017 · 1 comment

Comments

@jgiokas
Copy link

jgiokas commented Jul 6, 2017

Hi, I'm currently experiencing troubles with a mismatch between local and remote VCS endpoint names. An example follows:

glide.yaml

package: test
import:
  - package: github.com/sirupsen/logrus

main.go

package main

import (
	"github.com/Sirupsen/logrus"
)

func main() {
	logrus.WithFields(logrus.Fields{
		"animal": "walrus",
	}).Info("A walrus appears")
}

When you run:
$ glide up
You get the following output:

[INFO]	Downloading dependencies. Please wait...
[INFO]	--> Fetching updates for github.com/sirupsen/logrus.
[INFO]	Resolving imports
[INFO]	--> Fetching updates for golang.org/x/sys.
[INFO]	Downloading dependencies. Please wait...
[INFO]	--> Fetching updates for github.com/Sirupsen/logrus.
[ERROR]	Update failed for github.com/Sirupsen/logrus: The Remote does not match the VCS endpoint
[ERROR]	Could not update packages: The Remote does not match the VCS endpoint

I understand that the comparison between local and remote VCS is case-sensitive. But in my opinion it shouldn't matter because it's the same thing to do:
$ git clone https://github.com/sirupsen/logrus.git
or:
$ git clone https://github.com/Sirupsen/logrus.git

However, I've inspected the glide code and and the vcs package is calling:
git config --get remote.origin.url internally to get the VCS endpoint name for the localRemote.
This command gives different output which depends on the name of the git URL you used to clone the repo.

What I propose is a change in:
https://github.com/Masterminds/glide/blob/master/vendor/github.com/Masterminds/vcs/git.go
Line 47
Change:
if remote != "" && localRemote != remote {
To:
if remote != "" && !strings.EqualFold(localRemote, remote) {

For me this change solve my issues, but I don't know if will cause new ones. Also, I don't know if my logic behind this request is wrong because I'm missing something.

Thanks,
Yannis

@pzduniak
Copy link

pzduniak commented Jul 14, 2017

I am against it, we should not patch issues caused by ignorant developers. In this comment I initially wrote about how "Sirupsen/logrus" works, but they for some reason went through with the change that was heavily opposed by the community. I think the best solution is to vendor the library and/or absolutely avoid the library when possible. Introducing this change would cause mess on case-sensitive filesystems like pretty much everything on Linux. Per the README this is the "official" solution to this problem: sirupsen/logrus#553 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants