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

Use git default branch #2214

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

Use git default branch #2214

benlangfeld opened this issue Dec 17, 2012 · 6 comments

Comments

@benlangfeld
Copy link

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.

@indirect
Copy link
Member

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.

@rohitarondekar
Copy link
Contributor

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.

@benlangfeld
Copy link
Author

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//issues/2214#issuecomment-11563916.

@radar
Copy link
Contributor

radar commented Aug 8, 2013

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

@benlangfeld
Copy link
Author

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

@xaviershay
Copy link
Contributor

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

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

5 participants