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

hotfix-finish results in "ambiguous argument unknown revision or path not in the working tree" when done in a clean workspace #219

Closed kaszuster closed 4 years ago

kaszuster commented 4 years ago

Hi there,

i am using the maven gitflow plugin in conjunction with jenkins. One task is to open a support and a hotfix branch. At a late point in time a jenkins pipeline stage is used to finish the hotfix:

mvn -B -f pom.xml gitflow:hotfix-finish -DhotfixVersion=support/5.85.0/5.85.1-SNAPSHOT

This results in a [ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.14.0:hotfix-finish (default-cli) on project myProject: hotfix-finish: fatal: mehrdeutiges Argument 'support/5.85.0...origin/support/5.85.0': unbekannter Commit oder Pfad existiert nicht

AKA ambiguous argument unknown revision or path not in the working tree

Here is why:

hotfix-finish wants to compare support/5.85.0...origin/support/5.85.0 but there is no locally checked out support/5.85.0

git branch -a
* hotfix/support/5.85.0/5.85.1-SNAPSHOT
  remotes/origin/develop
  remotes/origin/hotfix/support/5.84.0/5.84.1-SNAPSHOT
  remotes/origin/hotfix/support/5.85.0/5.85.1-SNAPSHOT
  remotes/origin/master
  remotes/origin/support/5.84.0
  remotes/origin/support/5.85.0

This happens because the workspace where the hotfix branch was created is not the same it is about to be closed, its a fresh one on an other jenkins node thats why the branch support/5.85.0 was never checked out. For now ill go with -DfetchRemote=false to skip the comparison of these branches.

aleksandr-m commented 3 years ago

1.15.0 is out!