git-changelog-gradle-plugin icon indicating copy to clipboard operation
git-changelog-gradle-plugin copied to clipboard

Only one commit is shown

Open sforner405 opened this issue 4 years ago • 4 comments

We are using the current version (1.63) to generate a Changelog file with the following template:

task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
    fromRepo = file(".")
    file = new File("CHANGELOG.md")
    templateContent = """
# Git Changelog

Changelog of ${project.name}.

{{#tags}}
## {{name}}
 {{#issues}}
  {{#hasIssue}}
   {{#hasLink}}
### {{name}} [{{issue}}]({{link}}) {{title}}
   {{/hasLink}}
   {{^hasLink}}
### {{name}} {{issue}} {{title}}
   {{/hasLink}}
  {{/hasIssue}}
  {{^hasIssue}}
### {{name}}
  {{/hasIssue}}

  {{#commits}}
**{{{messageTitle}}}**

{{#messageBodyItems}}
 * {{.}}
{{/messageBodyItems}}

[{{hash}}](https://dev.azure.com/xyz/{{ownerName}}/_git/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

  {{/commits}}

 {{/issues}}
{{/tags}}
 """
}

The output does not show a complete commit history. It only shows the initial commit. Is there a possibility to get a debug log or check why it does not show all commits?

Thanks

sforner405 avatar Jul 09 '19 12:07 sforner405

Perhaps you dont have a master branch? Or just one commit on master...

You may try specifying references explicitely: https://github.com/tomasbjerre/git-changelog-gradle-plugin/blob/master/git-changelog-gradle-plugin-example/build.gradle#L30

Or try to reproduce the problem in an open repository that I can review.

tomasbjerre avatar Jul 09 '19 12:07 tomasbjerre

Master branch is present, but I'm trying to get the Changelog from another branch. If is set toRef = "HEAD" it looks better, but I am still missing some commits. Are there standard filters for the commits? Is it even ok to generate from a branch other than master?

sforner405 avatar Jul 09 '19 12:07 sforner405

Yes: https://github.com/tomasbjerre/git-changelog-lib/blob/master/src/main/java/se/bjurr/gitchangelog/api/GitChangelogApiConstants.java#L11

And you can change it like this: https://github.com/tomasbjerre/git-changelog-gradle-plugin/blob/master/git-changelog-gradle-plugin-example/build.gradle#L220

tomasbjerre avatar Jul 09 '19 12:07 tomasbjerre

Thanks. I am checking if I can get all commits I wan't by editing the filters.

sforner405 avatar Jul 10 '19 10:07 sforner405