-
Notifications
You must be signed in to change notification settings - Fork 452
godep restore makes impossible to update project with go get #453
Comments
Longer term, yes, by removing the need to |
PS: godep restore is doing what it's always done, restore the recorded versions to the $GOPATH. it can only do this by checking out the various shas (AFAIK) it's recorded. As a temp work around I could implement a Thoughts? |
I was about to implement a Also, can you give me the detail of this change in 1.6 you are mentioning above? |
PRs welcome. I don't have an exact commit to golang where this broke. Let me see if I can dig it up though. |
It was likely this one: golang/go@4220659 |
@Raffo What would you suggest be added to the README? It states what |
Thanks for the link to the commit. Do you think that a warning like " |
How about NOTE: godep restore leaves git repositories in a detached state. Then if you land an |
Sounds good to me. |
👍 |
As I imagined, it's very easy to hack an "unrestore" command to checkout the master, but it's not so easy to make the unrestore command so general that can handle cases in which the default remote branch is different from the master. I would have to add this information to Godeps.json (the remote HEAD), but I'm not sure we want that. |
@freeformz Any input on what I wrote above? |
Why does the remote branch matter? I don't think we want to pull new code with unrestore, just check out the local master. |
@freeformz because it's not obvious that the main branch is the master. If you clone a repository which remote HEAD is not the master you will end up with something different than a master branch. In such a case, if |
It only matters what it's merged to locally AFAIK, so I could totally be wrong here, I don't think I've ever worked with remotes who HEAD was not |
Take the gin repository: the |
I see. If there is only one branch returned from |
Or we just modify
And use the |
I'm not sure I really want to require people to populate that field manually. Also AFAICT RemoteHEAD is detectable through either: $ git remote show origin
...
HEAD branch: develop
... or $ git branch -r | grep "origin/HEAD ->"
origin/HEAD -> origin/develop possibly some other means as well. |
This is exactly what I meant, RemoteHEAD would be populated when |
I'm not sure we should save RemoteHEAD though and just honor the remote head from git info for what's already there. |
So, what you suggest is to just use the info from
Is this right? |
FWIW, today I got fed up with this and just _banned_ https://github.com/eduncan911/dotfiles/blob/master/bin/godep If you want it, first make sure your personal
If so, you are good to go. If not, you may want to tweak your Get the file locally:
Use it normally:
...etc. And when you try to do
hehe. 👍 I'm in the habit of using the
...etc. But I've accidently used No more! |
No need to spend an hour restoring them all, just do:
|
i have to exclude the dozen or so that I am working on... that do have pending commits, on different branches, etc. |
Note: due to issue 453 [1], there's currently a bit of legwork involved in updating dependencies. I used the approach of first switching all repos in `$GOPATH` to master as a workaround. [1] tools/godep#453 [2] tools/godep#453 (comment)
Currently
godep restore
puts the repositories in detached HEAD and this makes impossible to execute ago get -u github.com/foo/bar
. If a high number of projects using godeps are used and if godep restore is used frequently, this leads to a very high number of projects in detached state which makes very hard to update them.Are we able to avoid this somehow?
The text was updated successfully, but these errors were encountered: