Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent git describe during rebase --exec #186

Open
JacekLach opened this issue Sep 22, 2019 · 1 comment
Open

Inconsistent git describe during rebase --exec #186

JacekLach opened this issue Sep 22, 2019 · 1 comment

Comments

@JacekLach
Copy link

It seems that the way gradle-git-version calculates native description makes assumptions that don't always hold. I expected it was just using git describe --tags --first-parent, but that works just fine:

$ git rebase --exec 'git describe --tags' develop
Executing: git describe --tags
2.71.0-30-g4bdd087aa
Executing: git describe --tags
2.71.0-31-g028a32eb8
Executing: git describe --tags
2.71.0-32-g26ccc19be
Executing: git describe --tags
2.71.0-33-g7e8a0d669
Executing: git describe --tags
2.71.0-34-g693f9688d
Executing: git describe --tags
2.71.0-35-g42549d503
Executing: git describe --tags
2.71.0-36-g2e8b418fc
Executing: git describe --tags
2.71.0-37-g2055391f7
Executing: git describe --tags
2.71.0-38-g0363cc265
Executing: git describe --tags
2.71.0-39-g9d79059fe
Executing: git describe --tags
2.71.0-40-g9fdd91a56
Executing: git describe --tags
2.71.0-41-g6957552f4
Successfully rebased and updated refs/heads/jl/foo.
 $ git rebase --exec './gradlew printVersion' develop
Executing: ./gradlew printVersion

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/Volumes/git/foo/build.gradle' line: 47

* What went wrong:
A problem occurred evaluating root project 'foo'.
> Inconsistent git describe: native was 4bdd087 and jgit was 2.71.0-30-g4bdd087. Please report this on github.com/palantir/gradle-git-version
@JacekLach
Copy link
Author

Workaround: break git, so that the 'native' git describer fails instaed of producing wrong output:

$ git rebase --exec 'GIT_DIR=/tmp/.git ./gradlew printVersion' develop
(.. happy gradlew output)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant