0

I am using Jenkins Git-Plugin to checkout in my CI pipeline. I want to generate changelog between the COMMIT and a predefined REF_COMMIT.

Is there a way to achieve this using changelog-extensions? I can see there is option to calculate change log against branch (refs/remote/branch) but nothing written for commits.

Is there any other way i can show the changelogs as git-plugin does in the build without using this changelog-extenstions?

Krishnom
  • 1,348
  • 12
  • 39

1 Answers1

1

This is a git question per se, not a Jenkins question.

The following may work for you:

git whatchanged --no-abbrev -M "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(76,4,4)%s%n%n%b" -n 1024 ${COMMIT} ^${REF_COMMIT}

To use it in Jenkins, wrap the above in sh "..." while in script.

MaratC
  • 6,418
  • 2
  • 20
  • 27
  • Thanks @Marat. With this command it's straight forward to calculate the change logs. But to show it in HTML format in jenkins build it slightly difficult. I came across https://github.com/jenkinsci/git-changelog-plugin which comes with some handy options to generate HTML page out from differences. – Krishnom Dec 15 '19 at 15:37