-
Notifications
You must be signed in to change notification settings - Fork 143
chore: Rename default branch to main #492
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
Conversation
Summary of ChangesHello @lahirumaramba, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request systematically updates all references to the default branch from 'master' to 'main' across the repository. This change impacts CI/CD scripts, release preparation tools, and contributor documentation, ensuring consistency with the new branch name and promoting inclusive language practices within the project. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the repository to reflect the change of the default branch from master to main. The changes in the shell scripts and the CONTRIBUTING.md file correctly replace references to master with main or use a branch-agnostic URL. The changes are correct and align with the PR's objective. I've added one suggestion to improve the robustness of a script. Overall, this is a good and necessary maintenance update.
| # Ensure the checked out branch is main | ||
| CHECKED_OUT_BRANCH="$(git branch | grep "*" | awk -F ' ' '{print $2}')" | ||
| if [[ $CHECKED_OUT_BRANCH != "master" ]]; then | ||
| read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'master'. Continue? (y/N) " CONTINUE | ||
| if [[ $CHECKED_OUT_BRANCH != "main" ]]; then | ||
| read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'main'. Continue? (y/N) " CONTINUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method for getting the current branch name is not very robust. It can fail in certain scenarios like a detached HEAD state. A more reliable way is to use git rev-parse --abbrev-ref HEAD.
Also, it's good practice to quote shell variables when they are used to prevent issues with spaces or other special characters in the value.
| # Ensure the checked out branch is main | |
| CHECKED_OUT_BRANCH="$(git branch | grep "*" | awk -F ' ' '{print $2}')" | |
| if [[ $CHECKED_OUT_BRANCH != "master" ]]; then | |
| read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'master'. Continue? (y/N) " CONTINUE | |
| if [[ $CHECKED_OUT_BRANCH != "main" ]]; then | |
| read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'main'. Continue? (y/N) " CONTINUE | |
| # Ensure the checked out branch is main | |
| CHECKED_OUT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" | |
| if [[ "$CHECKED_OUT_BRANCH" != "main" ]]; then | |
| read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'main'. Continue? (y/N) " CONTINUE |
jonathanedey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks!
Updated default branch name to main
If you have a local clone, you can update it by running the following commands:
Optionally, run the following command to remove tracking references to the old branch name.