Coder Social home page Coder Social logo

Comments (10)

stefanleh avatar stefanleh commented on July 4, 2024

I've opened a pull request ...
#34

from gradle-release-plugin.

netzwerg avatar netzwerg commented on July 4, 2024

Thanks for the report and the PR.

this leads to the problem that when git command is called it cant interprete correctly

Could you please specify

  • how the problem manifests itself (build failure? truncated commit message?)
  • on which platform/setup (git version?) it occurs
  • possibly giving exacts steps of how to reproduce the problem

I am asking because nobody has ever had an issue with this and the code has been like this for ages...

from gradle-release-plugin.

stefanleh avatar stefanleh commented on July 4, 2024

git version 2.8.1.windows.1

14:37:29.002 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'git''. Working directory: D:\Projects\XYZ Command: git commit -m Release v0.0.1 version.txt

14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter]
14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':release'.
14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter] > Process 'command 'git'' finished with non-zero exit value 1
14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter]
14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
14:37:29.344 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
14:37:29.344 [LIFECYCLE] [org.gradle.BuildResultLogger]
14:37:29.344 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED

gradlew --version


Gradle 2.13

Build time: 2016-04-25 04:10:10 UTC
Build number: none
Revision: 3b427b1481e46232107303c90be7b05079b05b1c

Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_91 (Oracle Corporation 25.91-b14)
OS: Windows 10 10.0 amd64

from gradle-release-plugin.

stefanleh avatar stefanleh commented on July 4, 2024

But the same applies on our Teamcity build agent ....

from gradle-release-plugin.

netzwerg avatar netzwerg commented on July 4, 2024

Thanks, I will look into it.

from gradle-release-plugin.

stefanleh avatar stefanleh commented on July 4, 2024

Please also see my pull request. I guess my changes wont hurt anyway.

from gradle-release-plugin.

stefanleh avatar stefanleh commented on July 4, 2024
def git(Object[] arguments) {
    LOGGER.debug("git $arguments")
    def output = new ByteArrayOutputStream()
    def result = project.exec {
        executable 'git'
        args arguments
        standardOutput output
        ignoreExitValue = true
    }
    // output result to debug
    String gitOutput = output.toString().trim()
    if (!gitOutput.isEmpty()) {
        LOGGER.debug(gitOutput)
    }
    // check if successful after logging
    result.assertNormalExitValue()
}

I have changed the method for calling the git executable as throwing the error via "assertNormalExitValue()" surpressed logging of the output.

I get bad git exit status as i already have a commit wating for push.

15:50:21.504 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'git'' finished with exit value 1 (state: FAILED)
15:50:21.507 [DEBUG] [ch.netzwerg.gradle.release.ReleaseTask] On branch master
Your branch is ahead of 'origin/master' by 6 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean

That seems to be the real cause of my issue.
But i wasnt able to see that as the output was not logged correctly.

from gradle-release-plugin.

netzwerg avatar netzwerg commented on July 4, 2024

Thanks for the clarifications. Your changes with respect to logging make sense, thanks for updating the PR.

Concerning the quoting: Is this still an issue for you? If yes, we would need a platform-specific fix (possibly with more investigation/testing). If no, could you please create a new PR with just the logging changes – tia!

from gradle-release-plugin.

netzwerg avatar netzwerg commented on July 4, 2024

Release v1.2.5 including your logging changes should be available on Bintray jcenter soon...

from gradle-release-plugin.

stefanleh avatar stefanleh commented on July 4, 2024

Thank you very much.

from gradle-release-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.