voxpupuli / modulesync

Synchronize common files across your Git repositories.
Apache License 2.0
104 stars 48 forks source link

PR/MR feature should honor the repository default branch name as target branch #207

Closed neomilium closed 3 years ago

neomilium commented 3 years ago

Using msync with --pr, without specifying a target branch, the PR/MR will be made against master.

master branch name is hardcoded in cli.rb, github.rb and gitlab.rb while it should rely on repository information.

bittner commented 3 years ago

It's true, the default is set to master.

You should be be able to override this with the --pr-target-branch option. Can you try?

EDIT Unfortunately, there's more to it: When using the branch: option the hard-coded value origin/master is used, which makes MRs/PRs impossible towards anything else than a master target branch. This value needs to be replaced. – Only when dropping the branch: option the automatic detection of the default branch works. But then this is without PR/MR, obviously.

Related

If in any case we have to maintain a hard-coded value we should at least update this value to remove slavery terminology.

Technical side note

Apart from the specific issue, IIUC, there should not be any need for defaults in the pr/github and pr/gitlab modules, as this is set in cli already, isn't it?

neomilium commented 3 years ago

FYI, I already fixed this one in the code cleaning process I started few weeks ago. Unfortunately, I'm doing it on my spare time ATM and I dont have so much these days. I hope to finalize my pending PR to improve code and fix few issues.