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

hotfix-finish: plugin fails when remote already up to date #296

Open Steph0 opened 3 years ago

Steph0 commented 3 years ago

Hello, First of all, thanks for this amazing pluging I come across a very strange case where the plugin fails for a reason that does not seem right.

What happens is that for some reason, 'master' and 'dev' are already merged. I would expect not to fail and just continue (and updating the version in snapshot for example).

Note: same error in version 1.16.0 of this roject

Error:

[INFO] Committing changes.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:14 min
[INFO] Finished at: 2021-05-05T16:35:46Z
[INFO] Final Memory: 27M/302M
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.15.1:hotfix-finish (default-cli) on project api-ecm: hotfix-finish: On branch dev
Error:  Your branch is up to date with 'origin/dev'.
Error:  
Error:  nothing to commit, working tree clean
Error:  -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Command:

./mvnw -B gitflow:hotfix-finish -Prelease -DpushRemote="true" -DhotfixVersion="${hotfix_version}" \
            -DkeepBranch=false -DmvnExecutable="./mvnw"

Maven profile:

<profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.amashchenko.maven.plugin</groupId>
                        <artifactId>gitflow-maven-plugin</artifactId>
                        <version>1.15.1</version>
                        <configuration>
                            <gitFlowConfig>
                                <productionBranch>master</productionBranch>
                                <developmentBranch>dev</developmentBranch>
                            </gitFlowConfig>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- gitflow release plugin configuration -->
                <digitsOnlyDevVersion>true</digitsOnlyDevVersion>
                <skipTestProject>true</skipTestProject>
                <versionDigitToIncrement>1</versionDigitToIncrement>
            </properties>
        </profile>

Maven version: Apache Maven 3.5.0 JDK: 8 (latest)

Thanks for your help!

aleksandr-m commented 3 years ago

It would be nice to have this controlled by some parameter, but then we need to check diff or dry-run it first.

asterioproba commented 1 year ago

Is there any workaround for this bug?

OldIMP commented 1 year ago

Same problem for release-finish. Is there any update? Thx!