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

fix(git): fix fallback to develop branch if master not found #11966

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

mcornella
Copy link
Member

Standards checklist:

  • The PR title is descriptive.
  • The PR doesn't replicate another PR which is already open.
  • I have read the contribution guide and followed all the instructions.
  • The code follows the code style guide detailed in the wiki.
  • The code is mine or it's from somewhere with an MIT-compatible license.
  • The code is efficient, to the best of my ability, and does not waste computer resources.
  • The code is stable and I have tested it myself, to the best of my abilities.
  • If the code introduces new aliases, I provide a valid use case for all plugin users down below.

Changes:

  • Return error code if no main or develop branch were found
  • Fall back to git_develop_branch if git_main_branch was not found in gbda function

Other comments:

Fixes #11964

Copy link
Member

@carlosala carlosala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
It indeed fixes the issue for me.
It might be nice maybe to default to main instead of master, seems to be more common nowadays.

@LunarWatcher
Copy link
Contributor

LunarWatcher commented Oct 14, 2023

I wouldn't recommend hard switching from master to main. master is still widely used, especially in old repos. Consider checking both by default instead (which appears to already be done?)

@carlosala
Copy link
Member

@LunarWatcher I was talking about the branch name we output if no one is found.

@mcornella
Copy link
Member Author

I'd rather not over-rely on the default here and not introduce a breaking change if it's possible, so I'll merge it directly.

Thanks for the review!

@mcornella mcornella merged commit f939768 into ohmyzsh:master Oct 14, 2023
2 checks passed
@mcornella mcornella deleted the fix/gbda-develop-branch branch October 14, 2023 14:40
QwertyMax pushed a commit to QwertyMax/ohmyzsh that referenced this pull request Nov 8, 2023
claudenm pushed a commit to claudenm/ohmyzsh that referenced this pull request Jan 9, 2024
fdelacruz pushed a commit to fdelacruz/ohmyzsh that referenced this pull request Jan 21, 2024
jmussmann pushed a commit to jmussmann/oh-my-zsh that referenced this pull request Feb 17, 2024
lukaselmer pushed a commit to lukaselmer/ohmyzsh that referenced this pull request Apr 16, 2024
cschuyle pushed a commit to cschuyle/ohmyzsh that referenced this pull request Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

gbda no longer works when the default branch is called something other than main, trunk, mainline, default
3 participants