Jenkins changelog garbled when using git SCM (Jenkins is deployed on Linux and the task is built on Windows slave)

Source: Internet
Author: User
Tags using git

Cause of the problem

How to get Changelog (git-client plugin):

    1. First call the git whatchanged command to read the output byte stream (UTF-8 encoded commit Message).
    2. Decodes a byte stream into a string and then writes the character file to the $jenkins_home/jobs/xxx/builds/xx/changelog.xml file.

In the 2nd step, the Git-client plugin now (the latest version of 1.19.2) is decoded using the default encoding of the operating system. The default encoding for Windows is GBK (chcp command View, cp936 is GBK), and the Linux system is encoded as UTF-8 by default. If slave is windows, then the changelog byte stream, which is encoded by UTF8, will be decoded with GBK, and the changelog character obtained is garbled.

Reference:

https://github.com/jenkinsci/git-client-plugin/blob/git-client-1.19.2/src/main/java/org/jenkinsci/plugins/ Gitclient/cligitapiimpl.java

Repair:

https://github.com/jenkinsci/git-client-plugin/pull/194

Https://github.com/gennady/git-client-plugin/commit/c99c91fcf497e784204398761be5c10f438d0e55

Processing

Repair is very simple, the 2nd step decoding when the UTF-8 encoding can be specified. The problem has been fixed and a merger request has been submitted to the official. It should be fixed in a future release.

A temporary workaround is to package and install the repair version. You can use the built-in repair plugin package directly:

Https://github.com/gennady/git-client-plugin/raw/8383bd7c222b52e26b0d1b395b2eb26766f86cf7/compiled-plugin/git-client.hpi

Jenkins changelog garbled when using git SCM (Jenkins is deployed on Linux and the task is built on Windows slave)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.