-
Notifications
You must be signed in to change notification settings - Fork 132
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
The default branch "master" is now configurable #308
Conversation
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.
@Adysone Thanks for your contribution.
I have not reviewed in detail or tested yet, but I noticed that you only updated the Gitlab plugin whereas the new config would also apply to other VCS plugins (at least the Git-based ones, GitHub, BitBucket, Cgit, GitWeb).
Also, please make sure you follow MantisBT coding guidelines (e.g. spacing around parenthesis in SourceGitlab.php changes).
… hardcoded "master" branch
All should be good now. I can't test other VCS than GitLab but it should be fine. Thanks for your answer. |
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.
Thanks for the update. I had a closer look at this, and there is one thing that bothers me.
The new default_branch setting only applies to Git-based repositories, and does not make any sense in the context of other repo types (e.g. SVN). However, since the setting is global, the config page always displays it, which could be confusing to users of other VCS especially if they don't use any Git-based repositories.
IMO, the new setting should clearly indicate that it only applies to Git-based plugin types, and ideally should only be available if one of these is installed.
Moreover, it would be good to uniformize the labelling (the setting is called Primary Branch in the child plugins), and give an indication that it can be a comma-separated list of branches (or *
).
I would also advise to avoid code duplication, and retrieve the default value via the MantisSourceGitBasePlugin abstract class. Maybe the display on config page could be handled from there as well, although that might be a bit tricky (might need creation of a new internal plugin event).
Now indicates that "default_master_branch" is only for Git based repositories.
I can't check if a plugin is installed (I don't know Mantis API enough), but I improved labelling. 👍
I can't do that either, I'm not good enough. 😄 If all I did is not enough, nevermind, you can close que PR, I will use my fork as plugin. At least I tried 😉 Thank you for your interest btw. |
@Adysone I implemented your feature into the Git base plugin class as per my earlier comment. This means that your original code is all but gone, but thanks anyway for your contribution. |
Creates a new configuration variable 'default_branch' to fill automatically the "branch" input when creating a repository on MantisBT.