Closed 4soft-liebig closed 2 years ago
@4soft-liebig Maybe it is related to origin change with git remote set-url
? Can you reproduce this error locally?
@aleksandr-m Hi thanks for the fast response.
I cannot reproduce the error locally. The orgin change on the other side is required, since we add authentication information for accessing the "git server". Interestingly, after creating a release with the plugin locally and pushing it to gitlab the next release could be created on the gitlab instance again. So far I'm investigating into the direction that the cloned repository in gitlab may have a problem due to the fact that the HEADs for different branches are not setup correctly.
@aleksandr-m I'm still getting the error sometimes. git remote set-url
is required, so that git/gitflow can push changes to remote, since the original clone does not contain credentials in it's remote definition.
Is there a way to get more information on the error?
Well, you can run git merge
directly e.g. w/o plugin, but I doubt there will be more info.
I have exactly the same problem. Do you success to close the problem using release finish command ?
@ari1008: I'm afraid not.
Hi,
I could fix the problem setting gitlab-config variable GIT_DEPTH
to 0
. gitlab makes use of git clone --depth
to improve the performance during checkout, since most git operations do not require the complete repository to be cloned. Standard depth is 20
. Sometimes the release-finish operation worked, when the number of commits is less than 20. Sometimes it did not.
Running release-finish locally always succeeded, since the local git clone is complete (i.e., not shallow).
The following setup worked for me:
release-finish:
stage: Release
variables:
# Change strategy to git clone, since changelog generation together with additional commits pushed manually to
# the release branch results in remote being ahead.
GIT_STRATEGY: clone
# Make a full clone. This is required, since otherwise we get an error regarding unrelated merge histories.
GIT_DEPTH: 0
before_script:
- *git_setup
only:
- /^release\/.*$/
when: manual
script:
- 'mvn gitflow:release-finish -DskipTestProject=true -DversionDigitToIncrement=1'
@4soft-liebig Thank you for sharing your solution!
Hi,
I'm using gitflow-maven-plugin with gitlab-ci for release generation. We split the release generation using release-start and release-finish to generate the changelog from the git history automatically in between.
I'm running into a problem when running gitflow:release-finish. According to the git output develop, release-branch, and master are up2date. Nevertheless, I'm getting "refusing to merge unrelated histories" when running the command.
Interestingly, creating releases work the previous releases 0.0.1 to 0.0.14. I'm getting the error when creating the new release 0.0.15.
What do i miss? I'm using gitflow-maven-plugin version 1.18.0.
gitlab-ci configuration:
gitflow-maven-plugin configuration:
mvn log: