danielflower / maven-gitlog-plugin

Generates a change log for maven projects using git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Define a range of dates for the change log

erikryverling opened this issue · comments

Hi, and thank's for a good plugin!

It would be great if you provided a way to specify a date range from which the log is generated to limit the size of the log.

An example of this behaviour:
http://maven.apache.org/plugins/maven-changelog-plugin/changelog-mojo.html#range

This plugin provides includeCommitsAfter.

I'd really like the date range as proposed by @erikryverling. I know of the includeCommitsAfter, which is what I use currently, but since I only want to see commits of the last three months, I have to update that date every month or so, which is just annoying.

I would have liked something more flexible than this (e.g. being able to specify something like 2m4d for 2 months and 4 days), but since I did not find an easy way to parse such Strings - and I guess parsing them would be something for Apache's DateUtils, not this plugin - I went for the cheap "just pass a number of dates".

@j-be you could use java.time.Period#parse and strings like P2M and P56D etc.

@talios java.time.Period#parse is exactly what I would need, but it is a Java 8 feature, and the POM of this plugin sets the language level to 6. I'm not sure whether this is intended or just a leftover from long time ago - README.md doesn't mention. But I didn't want to mess with it.

To keep the possibility open, I introduced a parameter called includeCommitsDuringTheLastDays, which could later be deprecated in favor of a more generic includeCommitsDuringPeriod, backed by java.time.Period#parse.

@j-be Joda-Time could be an option then - altho adding a dependency for a single function kinda sucks.

@talios My thoughts exactly. After all: just the days is what was requested in the first place.

Just merged the pull request, thanks. Released in version 1.13.17