Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Cannot use master branch for local override #1957

Closed
ntalbott opened this issue May 30, 2012 · 9 comments
Closed

Cannot use master branch for local override #1957

ntalbott opened this issue May 30, 2012 · 9 comments

Comments

@ntalbott
Copy link

I'm trying to use a local override, and it's almost working. I have the config set:

local.jamsession
  Set for the current user (/Users/ntalbott/.bundle/config): "../jamsession/"

When I try to bundle, I get an error about the branch not being specified:

ntalbott@joshua:~/git/spreedly/subscriptions$ bundle
Cannot use local override for jamsession at ../jamsession/ because :branch is not specified in Gemfile. Specify a branch or check `bundle config --delete` to remove the local override

Which makes sense, except I do have the branch specified, it just happens to be master:

gem "jamsession", git: 'git@github.com:spreedly/jamsession', branch: 'master'

Note that if I change the branch to something else, I get a different error message, so I know my Gemfile change is being picked up:

ntalbott@joshua:~/git/spreedly/subscriptions$ bundle
Local override for jamsession at ../jamsession/ is using branch master but Gemfile specifies bogus

Is it expected behavior for master to not be a valid branch for local overrides?

@ntalbott
Copy link
Author

I should note that I'm using version 1.2.0.pre.1.

@indirect
Copy link
Member

Hmm... I haven't seem that before. Your local copy is a checked out git repo, right?

On May 30, 2012, at 8:08 AM, Nathaniel Talbottreply@reply.github.com wrote:

I'm trying to use a local override, and it's almost working. I have the config set:

local.jamsession
 Set for the current user (/Users/ntalbott/.bundle/config): "../jamsession/"

When I try to bundle, I get an error about the branch not being specified:

ntalbott@joshua:~/git/spreedly/subscriptions$ bundle
Cannot use local override for jamsession at ../jamsession/ because :branch is not specified in Gemfile. Specify a branch or check `bundle config --delete` to remove the local override

Which makes sense, except I do have the branch specified, it just happens to be master:

gem "jamsession", git: 'git@github.com:spreedly/jamsession', branch: 'master'

Note that if I change the branch to something else, I get a different error message, so I know my Gemfile change is being picked up:

ntalbott@joshua:~/git/spreedly/subscriptions$ bundle
Local override for jamsession at ../jamsession/ is using branch master but Gemfile specifies bogus

Is it expected behavior for master to not be a valid branch for local overrides?


Reply to this email directly or view it on GitHub:
#1957

@ntalbott
Copy link
Author

Yes, local copy is just a normal git repo:

ntalbott@joshua:~/git/spreedly/jamsession$ git st
# On branch master
nothing to commit (working directory clean)

@indirect
Copy link
Member

That is really, really odd. We're thinking of possibly removing the branch requirement for local overrides, and I'm guessing that would solve things? Without a solid repro of this case, I'm not sure what to suggest.

@ntalbott
Copy link
Author

ntalbott commented Jun 4, 2012

Yah, I tend to think removing the requirement is better in general. I'll try to get a reproduction for the issue, though, just in case.

@ntalbott
Copy link
Author

ntalbott commented Jun 4, 2012

OK, steps to reproduce:

  • Lock with bundler 1.1.4 without a branch specified:

Gemfile:

gem "test2", git: "/Users/ntalbott/tmp/test2"
ntalbott@joshua:~/tmp/test1$ bundle _1.1.4_
Updating /Users/ntalbott/tmp/test2
Using test2 (0.0.1) from /Users/ntalbott/tmp/test2 (at master) 
Using bundler (1.1.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
  • Set up local override, add branch as master, then attempt to bundle with 1.2.0.pre.1:
ntalbott@joshua:~/tmp/test1$ bundle config local.test2 ../test2

Gemfile:

gem "test2", git: "/Users/ntalbott/tmp/test2", branch: "master"
ntalbott@joshua:~/tmp/test1$ bundle _1.2.0.pre.1_
Cannot use local override for test2 at ../test2 because :branch is not specified in Gemfile. Specify a branch or check `bundle config --delete` to remove the local override

Good news: the workaround is as simple as removing Gemfile.lock and re-bundling. But if you decide to keep the branch requirement, you'll probably want to fix this edge case to smooth the path for upgraders.

@indirect
Copy link
Member

indirect commented Jun 4, 2012

Ah, yup! Thanks for figuring that out. I suspect we're going to take out the branch requirement before final.

@knzconnor
Copy link

Did the branch requirement get pulled for release? The docs still mention it, so it's easier to use a manual override still.

@xaviershay
Copy link
Contributor

This seems like a totally weird requirement to me but whatever. The current docs say to use:

bundle config disable_local_branch_check true

Not sure why that isn't just the default but I'll fight that fight another day.

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

No branches or pull requests

4 participants