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

New "branch" argument for wflow_start() #271

Open
pcarbo opened this issue May 5, 2022 · 1 comment
Open

New "branch" argument for wflow_start() #271

pcarbo opened this issue May 5, 2022 · 1 comment

Comments

@pcarbo
Copy link
Member

pcarbo commented May 5, 2022

@jdblischak @stephens999 Very recently, git2r added a "branch" argument to init:

     init(path = ".", bare = FALSE, branch = NULL)
  branch: Use the specified name for the initial branch in the newly
          created repository. If ‘branch=NULL’, fall back to the
          default name.

I suggest we add a "branch" option to wflow_start with a default setting of "main" to align with GitHub.

@jdblischak Do you forsee any issues with doing this? Do you think that using a "main" branch instead of master could create problems on GitLab or BitBucket? If not, do you mind if I implement this in a development branch?

@jdblischak
Copy link
Member

This is a good idea. I've been waiting for git2r/libgit2 to provide better support for default branch names.

The main complication I see is how do we want to handle if a user configured a default branch name. That's how I've been defaulting to using "main" as this change is slowly rolled out to Git/libgit2.

$ git config --get init.defaultBranch
main

We could either 1) ignore it, and document that a user needs to change branch if they don't want it to be "main", or 2) try to do something like git2r::init(). In other words, if branch = NULL and no default is explicitly set in .gitconfig, then use "main".

The other task related to this technical change is to update the documentation to refer to "main" instead of "master".

As for backwards compatibility, my main concern would be outdated versions of GitHub Enterprise. I have access to one, so I can test if this is a problem.

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

No branches or pull requests

2 participants