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

Allow use of main as primary branch in edge cases like migrate #281

Open
pboling opened this issue Oct 5, 2021 · 7 comments
Open

Allow use of main as primary branch in edge cases like migrate #281

pboling opened this issue Oct 5, 2021 · 7 comments

Comments

@pboling
Copy link

pboling commented Oct 5, 2021

🚀 Feature Proposal

Github now defaults to main for new repositories. I'd like to be able to use meta with those repositories. A hybrid approach seems ideal so we don't have to touch legacy repos, so it could work with both main and master. Perhaps it could detect the primary branch name? Or use a preset list of fallbacks, like:

main
master

Motivation

When creating a new repository on Github via the UI the default branch is now main, which doesn't work with meta.

Example

For a new repository, attempting to add it to a meta repo I get this error:

fatal: Remote branch master not found in upstream origin

I'd like to be able to do this:

meta project import projects/the-project git@giturl

and have it work regardless of the primary branch name.

@patrickleet
Copy link
Collaborator

patrickleet commented Oct 5, 2021

if some repos use main, and some master, you're gonna have other problems as well, such as scripting checking out the repos, as for that command you specify which branch you are checking out, and a mixed bag will just fail on half of them

meta git checkout master

for example

or rebasing

so it's better to use one or the other - that said - I don't know a good solution to this at the moment - maybe a project level config that meta can look at and use

@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Mar 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 30, 2022
@patrickleet
Copy link
Collaborator

@rikkit has a simple version of using main in his branch of meta project mateodelnorte/meta-project#95

@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 13, 2022
@emahuni
Copy link

emahuni commented Sep 1, 2022

why not just pass everything to the executable when the command is not in the plugin and let the executable complain if there are any errors?

If I say meta git blah, the meta-git plugin should send that blah as a command it doesn't know to git, eg: git blah. Probably blah is now a new command that this plugin never knew about. The idea here is that any new conventions are covered and this future proofs the Meta lib and its related plugin. So this master | main issue is solvable by not constraining what a user can do with git, meta git should simply handle custom commands / overrides and then pass on any weird unknown ones to git.

a simple example here is
image

Meta plugin is trying to work on every command, why not let git/yarn (in this case) do it? everything else it doesn't know just ends up as silent. I think this is where that forwarding needs to happen.

@stale stale bot removed the wontfix label Sep 1, 2022
@patrickleet
Copy link
Collaborator

@emahuni fwiw you can do that with meta exec already meta exec "git blah"

I think in most cases as long as you're using all master or all main everything should work just fine - there are some edge cases like in migrate where this is not the case though.

@patrickleet patrickleet changed the title Allow use of main as primary branch Allow use of main as primary branch in edge cases like migrate Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants