Use git default branch #2214

Closed
benlangfeld opened this Issue Dec 17, 2012 · 6 comments

Comments

Projects
None yet
5 participants

Bundler always falls back to 'master' if I don't specify a branch when using a gem from git: https://github.com/carlhuda/bundler/blob/master/lib/bundler/source/git.rb#L25

It would be more sensible to fall back to the default branch of the remote repo. It is common to set the default branch (eg on github) to 'develop' when using git-flow, for example.

Owner

indirect commented Dec 17, 2012

I'm not sure how to detect a default branch, but that seems like a useful change. Any interest in writing a pull request?

On Dec 17, 2012, at 6:14 AM, Ben Langfeld notifications@github.com wrote:

Bundler always falls back to 'master' if I don't specify a branch when using a gem from git: https://github.com/carlhuda/bundler/blob/master/lib/bundler/source/git.rb#L25

It would be more sensible to fall back to the default branch of the remote repo. It is common to set the default branch (eg on github) to 'develop' when using git-flow, for example.


Reply to this email directly or view it on GitHub.

Contributor

rohit commented Dec 20, 2012

How will you get the default branch from Github? If it's stored as a config option in the repository itself then may be you can get it from git config. I'm not knowledgeable w.r.t Git but maybe .git/HEAD points to the default branch?

If it's not possible to get the default git branch I'd say the current fallback, i.e master is a good choice and this issue should be closed.

I'm going to see if I can get this working in the next few days. I'd like
to keep this ticket open as a reference. I don't see any reason why my
proposal would not be possible.

Regards,
Ben Langfeld

On 20 December 2012 06:32, Rohit Arondekar notifications@github.com wrote:

How will you get the default branch from Github? If it's stored as a
config option in the repository itself then may be you can get it from git
config. I'm not knowledgeable w.r.t Git but maybe .git/HEAD points to the
default branch?

If it's not possible to get the default git branch I'd say the current
fallback, i.e master is a good choice and this issue should be closed.


Reply to this email directly or view it on GitHubhttps://github.com/carlhuda/bundler/issues/2214#issuecomment-11563916.

Contributor

radar commented Aug 8, 2013

@benlangfeld Are you still working on getting this to work?

@radar: I havn't had a go at it yet, no. If you fancy doing so, be my guest :)

Contributor

xaviershay commented Aug 20, 2013

Closing because this isn't a bug, please do open on bundler features if you want to track it.

xaviershay closed this Aug 20, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment