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
490 stars 182 forks source link

feature-finish does not always commit everything and leaves uncommitted changes in master #292

Open ziad-aouad opened 3 years ago

ziad-aouad commented 3 years ago

I have a simple project that has the configuration below for the plugin

<plugin>
    <groupId>com.amashchenko.maven.plugin</groupId>
    <artifactId>gitflow-maven-plugin</artifactId>
    <version>1.16.0</version>
    <configuration>
        <gitFlowConfig>
            <developmentBranch>master</developmentBranch>
        </gitFlowConfig>
        <skipTestProject>true</skipTestProject>
        <fetchRemote>false</fetchRemote>
        <pushRemote>false</pushRemote>
        <skipFeatureVersion>true</skipFeatureVersion>
        <preFeatureFinishGoals>groovy:execute</preFeatureFinishGoals>
        <preReleaseGoals>groovy:execute</preReleaseGoals>
    </configuration>
</plugin>

The preFeatureFinishGoals inserts some changes in my tracked files. This makes them modified from a git perspective. When the mvn gitflow:feature-finish terminates, the changes are not committed into master. I rather end up with uncommitted changes in my master.

Funny thing is when I comment the <skipFeatureVersion> tag, then everything behaves as expected and no uncommitted edits end up in my master branch.

Any idea what I might be doing wrong?

aleksandr-m commented 2 years ago

@ziad-aouad Yes, this is because of the commit which happens only if skipFeatureVersion is set to false. If you know that your script changes tracked files maybe you can commit them in the script as well.