-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Choosing a different default branch name than master
#241
Comments
I had been thinking about this recently and had settled on "main" as well. I believe new repositories should use "main", but I don't really understand what it would take to update existing repos so I can't comment there. Would we have to create a new branch called "main" and then update the default branch from "master" to "main"? I know how to do this in GitHub but not Git. Would it break code anywhere? For instance, we would need to update the Colab links to our Jupyter Notebooks from e.g. colab.research.google.com/github/edgi-govdata-archiving/ECHO-Cross-Program/blob/master/facility-all-programs.ipynb to colab.research.google.com/github/edgi-govdata-archiving/ECHO-Cross-Program/blob/main/facility-all-programs.ipynb |
Pretty much (but don’t forget to delete “master” on the GitHub side at the end). The complexity I’d worry about here isn’t really technical — it’s more the human fuzziness of everyone using the repo needs to update their local copies and/or forks, remember to stop using “master” on their end, etc. (The downside of git being distributed! Everyone’s forks and local copies are independent repos.)
Oh, yeah, links from other places could definitely break. 😬 (Side note: anywhere you don’t need a link to the latest version of a thing, it’s almost always a good idea to to the commit hash instead of the branch, for exactly this reason. e.g. |
Seems like a nice & easy gesture. I support this! +1 to I wanted to ack that someone can recognize
Could leave it there, but just switch default branch to new |
Agree! Although, super interesting note… the “master” in git is about “master/slave,” not “master copy:” https://mail.gnome.org/archives/desktop-devel-list/2019-May/msg00066.html (I only found this the other day because I also had the exact same thought as you here, but was curious if I was assuming correctly about the history.)
We could. I worry it would lead to maximum confusion for someone who didn’t read this issue discussion, though.
🤣 |
Thought experiments:
To me, (2) feels like much more inconvenience to people less likely able to remedy the situation. It will be experienced by people just passing through or finding links scattered around the internet. A person experiencing (1) will be closer to the project, likely willing to put in more effort, and will be around ppl who can easily answer and support them :) For me personally, de-emphasizing/hiding the |
+1 to all this! Heads up to @lourdesvera that upon implementation of this change in the EEW notebooks all the links to the colabs would change – are they linked to anywhere other than the EEW Tracking spreadsheet and the Congressional District primer? (Updating these links in a thorough way would likely be the most challenging aspect of this change at the moment, but this is a good moment to do it as we haven't really kicked the EEW project into full gear yet) |
The other kind of confusion I foresee with this is: a month or more after the change, someone clicks a link that works, but leads to code that is way out of date without any clear indicators that’s the case. (Best case, it’s just old code/documentation; worst case, it’s totally broken code/inaccurate documentation. In either case, it has similar broad impacts to the broken link problem from point 2, but the brokenness is not obvious.) BUT! Maybe putting a big notice in the README on the |
Ah good point! Or maybe add a final commit to master that changes every file to a simple link to the new place. (could even make reference to the rationale, so that it's not a silent swap, but a mild moment of enlightenment) |
Biggest failure mode I'd expect is someone thoughtlessly pushing to master instead of main, in which having links in the files wouldn't work. (I mean, one should pull request, but EDGI doesn't have a great track record on this) Is there a way to explicitly archive the branch in github/git so it doesn't accept new commits? |
Oh, yeah, we can protect the branch so you can’t push to the copy in GitHub. See the branch settings page, e.g: https://github.com/edgi-govdata-archiving/overview/settings/branches |
(Has to be done on each repo, though.) |
Did some testing on template repos. The default branch applies to the new repo (yay!), but branch protection rules do not come along for the ride (even if you check “include all branches”). So we might leave the As far as branch names, it seems like everyone likes “main,” so I’ll file PRs to update instructions and update the template repo. |
See #241 for more discussion of this. We’re switching from `master` to `main` for the default branch name in new repos, and possibly for existing repos as maintainers are able to do so.
*main :) |
Ugh, fixed! 😅 |
I like So, sounds like to transition old repos we would need to:
Is that right? Anything else? I can create an issue and checklist and begin working on transitioning next week, when we agree to steps. |
If the only reason we're leaving Running this should iterate through all files in git, and point them to their new equivalents on the new branch, if that's what we want to do -- I don't have a strong opinion, just wanted to make it easy :) Run this oneliner from the root of any repo, with adjustments for repo name: git ls-files | xargs -E $'\n' sh -c 'for arg do echo "This file has moved to https://github.com/edgi-govdata-archiving/overview/tree/main/$arg." > $arg; done' |
I think that might be problematic for things that aren’t linking for the purpose of web browsing, e.g. the Google Colab notebooks @ericnost mentioned above would break if we did that: #241 (comment) |
making sure @maalvikabhat also sees this is going on as it may have ramifications for EEW notebook links |
thank you so much |
Yea, I wouldn't want to edit all files in case it breaks something. If there's no other objections or concerns, I'll start working on the steps I outlined above tomorrow. |
Haven't looked closely yet, but see this: https://twitter.com/jywarren/status/1279856631271100416 |
Thanks @ericnost! That's extremely helpful! |
Closing and tracking progress here: #243 |
See edgi-govdata-archiving/overview#241 for more discussion of this. We’re switching from `master` to `main` for the default branch name in new repos, and for existing repos as maintainers are able to do so.
See edgi-govdata-archiving/overview#241 for more discussion of this. We’re switching from `master` to `main` for the default branch name in new repos, and for existing repos as maintainers are able to do so.
See edgi-govdata-archiving/overview#241 for more discussion of this. We’re switching from `master` to `main` for the default branch name in new repos, and for existing repos as maintainers are able to do so.
See edgi-govdata-archiving/overview#241 for more discussion of this. We’re switching from `master` to `main` for the default branch name in new repos, and for existing repos as maintainers are able to do so.
One thing that’s come up recently in some software development fora is renaming the default branch in Git repositories from “master” to something else (“master” actually doesn’t mean anything special in Git — it’s just the default chosen when you run
git init
— so you are always free to choose a different name for your default/main/primary/base branch).Unfortunately, it’s pretty early for this, so there doesn’t seem to be an especially clear consensus on an ideal alternative name. Some I’ve seen or that make a lot of sense:
git-the-latest
NPM module)I prefer and recommend “main.”
I’d love to know whether others have any particular thoughts on whether this would be a good idea, and what a good name would be.
While it’s a small gesture, it seems to me that making some change, at least for new repositories, is pretty easy and worthwhile (we’d update the template repository and add a not in
repo_guidelines.md
). BUT if folks think it’s better to let this lie for a while and see what starts to shake out as a common name, that’s also OK.Should we also update existing repositories? That’s messier, and a little more intensive.
/cc @Frijol @lightandluck @danielballan @shansen5 @ericnost
The text was updated successfully, but these errors were encountered: