-
Notifications
You must be signed in to change notification settings - Fork 652
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
[Improvement] Confusing Exception message: "Could not find a 'develop' or 'main' branch, neither locally nor remotely." #2598
Comments
I guess even better would be if we could use the actual names found in the configuration, as not all are using |
Yes, I suppose it'd be even better, but this is raised by an Exception... Note that I didn't have a look at the code (yet), so I can't say whether this is easy or not. For information, here is the Exception trace:
|
|
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
I am having this exact problem here when using the default config and I agree that the error seems almost intentionally misleading. I think the error should be more explicit than the original @odalet suggests: 'Gitversion could not determine which branch to treat as the development branch (default = develop) nor release branch (default = main or master), neither locally nor remotely. Consider diagnosing with |
I agree the error message is bad. Pull requests to improve it are welcome. |
@asbjornu - yes I actually submitted a PR against this issue. |
@DarwinJS, which PR is that? |
Opps I had done it back to my own fork - fixed now! |
🎉 This issue has been resolved in version 5.6.11 🎉 Your GitReleaseManager bot 📦🚀 |
When I read this error message, I thought my 'master' branch was not recognized by GitVersion whereas the problem was completely unrelated.
Detailed Description
I was trying to have GitVersion work on a private GitLab instance of ours (I'm still a beginner concerning GitLab) and was presented with this exception. I wrongly assumed there was a problem with GitVersion not finding my 'master' branch... Even tried to declare it in
GitVersion.yml
but that was for naught. It appears the problem was on the GitLab side due to how we had configured the way it retrieves a git clone (a detached head only listing a unique (non-master) remote branch, no wonder GitVersion didn't work).I understand, by reading GitVersion code, that 'develop' and 'main' are not real branch names, but rather monikers to whatever the development and the main/principal branch are, but the quotation and the fact they can be real branch names as well is, I suppose, the source of my confusion.
I think that the message either:
Context
I think this (obvioulsy simple and dispendable) change may help diagnose issues like the one I had.
Possible Implementation
If one or the other of my propositions is accepted, I'll gladly modify the relevant string in a PR
The text was updated successfully, but these errors were encountered: