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

submodule file conflicts break glide/git #581

Closed
vikstrous opened this issue Apr 3, 2017 · 9 comments
Closed

submodule file conflicts break glide/git #581

vikstrous opened this issue Apr 3, 2017 · 9 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.

Comments

@vikstrous
Copy link

vikstrous commented Apr 3, 2017

We use glide to vendor this repo and a recent change broke glide's ability to depend on old versions of this repo.

The issue is that glide clones the latest version of Azure/azure-sdk-for-go and then tries to check out an old version. When it does that, it gets the following errors:

[ERROR]	Failed to set initial config references: Unable to update checked out version
[DEBUG]	Output was: error: The following untracked working tree files would be overwritten by checkout:
	storage/blob.go
	storage/blob_test.go
	storage/client.go
	storage/client_test.go
	storage/file.go
	storage/file_test.go
	storage/queue.go
	storage/queue_test.go
	storage/util.go
	storage/util_test.go

This happens because the storage directory was replaced with a submodule.

See Masterminds/glide#749

We can blame git, glide or azure-sdk-for-go, but I think the simplest solution that doesn't require new code to be written is here. That's why I'm hoping that you guys can simply rename the storage directory on master to something else. That way these conflicts won't exist and we can move on without having to wait for code changes elsewhere.

Meanwhile, we'll probably just fork this repo and remove the latest commits as a workaround :(

Edit: I believe the breaking change was introduced in #569

@marstr marstr self-assigned this Apr 4, 2017
@marstr marstr added P1 question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 4, 2017
@marstr
Copy link
Member

marstr commented Apr 4, 2017

Howdy, @vikstrous sorry you're running into trouble.

Assuming you don't have any alterations to the SDK that you need to keep, the easiest way forward is to checkout a fresh copy of the SDK. For the benefit of others who have found this thread, I'll include instructions for folks using glide and otherwise.

edit: the advice below doesn't address @vikstrous's problem. It applies only to people having trouble adopting the latest bits, not folks running into trouble with checking out older commits that didn't contain the submodule. That said, if I delete the vendor'd copy as mentioned below, glide does seem to work with all versions of the SDK.

edit2: I cleared my glide cache, and I'm now able to repro this issue reliably. I'll work on this. Thanks for bringing it to my attention, @vikstrous.

Glide

  1. cd <project directory>/vendor/github.com/Azure
  2. rm -rf azure-sdk-for-go
  3. cd ../../..
  4. glide install

Go Get

  1. cd $GOPATH/src/github.com/Azure/
  2. rm -rf azure-sdk-for-go
  3. go get -u github.com/Azure/azure-sdk-for-go

@vikstrous
Copy link
Author

vikstrous commented Apr 4, 2017 via email

@marstr
Copy link
Member

marstr commented Apr 4, 2017

Sorry @vikstrous, I'm having trouble repro'ing your issue. When I go to migrate our samples (e.g. Azure-Samples/network-go-manage-network-security-group) to the latest version, I don't get a conflict. Mind sharing some details about the version of glide you're using, maybe send me a link to the repository where you're running into trouble?

edit: grammar

@rogpeppe
Copy link

rogpeppe commented Apr 5, 2017

We also have been running into problems from this issue. We use a different
dependency management system, but the issue is the same - git submodules
make it very hard to checkout different commits when the submodules change.

For example:

git clone git@github.com:Azure/azure-sdk-for-go
cd azure-sdk-for-go
git submodule update --init --recursive              # "go get" does this.
git checkout 902d95d9f311ae585ee98cfd18f418b467d60d5a

This fails with the "error: The following untracked working tree files would be overwritten by checkout:" problem, and has broken our continuous integration process.

Unfortunately no automatic dependency management system
can switch between pinned commits when there are submodules without
potentially destroying valuable information held in the .git directories
in the submodules.

Perhaps git subtree might be a better fit here?

Another more conventional possibility might be to move the storage package into its own repository outside of azure-sdk-for-go. That would require clients to change their import paths, but that might be acceptable depending on your API compatibility guarantees.

@marstr
Copy link
Member

marstr commented Apr 5, 2017

I just updated my first comment. After clearing my glide cache I'm running into the same issue. Thanks for bringing this to my attention, @vikstrous and @rogpeppe.

@marstr
Copy link
Member

marstr commented Apr 5, 2017

Alright, my knee-jerk plan here is that we NEED to revert the addition of the submodule and replace it with the actual source files in order to unblock folks using older versions. We'll release that as version v9.1.0-beta.

The plan will still be to move storage into its own repository. But we'll have to do something else to support folks still using it through this repository.

edit: Because it was just a bug fix and didn't actually change anything contractually, I released it as v9.0.1-beta instead of v9.1.0-beta.

@marstr marstr added P0 bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed P1 question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 5, 2017
@marstr
Copy link
Member

marstr commented Apr 5, 2017

Alright, this should be resolved for now. Can you confirm @vikstrous and/or @rogpeppe?

@marstr marstr added the resolved label Apr 5, 2017
@vikstrous
Copy link
Author

works for me!

@marstr marstr closed this as completed Apr 5, 2017
@rogpeppe
Copy link

rogpeppe commented Apr 6, 2017

Works for me too. Thanks very much for the quick fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.
Projects
None yet
Development

No branches or pull requests

3 participants