aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
488 stars 180 forks source link

[FR] Extra push options #319

Closed lrkwz closed 2 years ago

lrkwz commented 2 years ago

feature request: It would be useful the ability to send extra push options at the start of tasks. As an example gitlab supports:

git push -o merge_request.create

though

https://git-scm.com/docs/git-push

-o

Transmit the given string to the server, which passes them to the pre-receive as well as the post-receive hook. The given string must not contain a NUL or LF character. When multiple --push-option=

(see also https://docs.gitlab.com/ee/user/project/push_options.html).

it would be useful have the chance to configure mvn gitflow:feature-start so that it automatically pushes the new branch as soon as it is locally created -DpushRemote=true decorating the push with extra options.

I imagine something like:

<plugin>
    <groupId>com.amashchenko.maven.plugin</groupId>
    <artifactId>gitflow-maven-plugin</artifactId>
    <version>1.16.0</version>
    <configuration>
        <pushRemote>true</pushRemote>
        <pushOptions>
             <merge_request.create />
             <merge_request.target>main</merge_request.target>
        </pushOptions>
    </configuration>
</plugin>
lrkwz commented 2 years ago

The only workaround so far is

git config --add push.pushOption merge_request.create