maven-changelog-plugin icon indicating copy to clipboard operation
maven-changelog-plugin copied to clipboard

Git 2.51.0 errors with changelog plugin

Open hazendaz opened this issue 4 months ago • 13 comments

Affected version

3.0.0-M1

Bug description

With git 2.51.0, plugin usage here now is failing with this error.

[INFO] [ERROR] Provider message: [INFO] [ERROR] The git-log command failed. [INFO] [ERROR] Command output: [INFO] [ERROR] 'git whatchanged' is nominated for removal. [INFO] If you still use this command, please add an extra [INFO] option, '--i-still-use-this', on the command line [INFO] and let us know you still use it by sending an e-mail [INFO] to [email protected]. Thanks. [INFO] fatal: refusing to run without --i-still-use-this

hazendaz avatar Aug 21 '25 21:08 hazendaz

This breaks many builds and prevents updating GitHubActions - e.g. actions/setup-java 4 to 5

  • https://github.com/apache/creadur-rat/pull/513
  • https://github.com/apache/creadur-tentacles/pull/201 and seems to happen with older versions of the plugin as well (2.3).

As it seems to relate to the git version used it makes using this plugin impossible at the moment and should be treated as a blocker.

ottlinger avatar Aug 25 '25 08:08 ottlinger

Just to provide a bit more log context of the failure:

[INFO] Generating "Change Log" report           --- maven-changelog-plugin:2.3:changelog
[INFO] Generating changed sets xml to: /home/runner/work/creadur-rat/creadur-rat/target/changelog.xml
[INFO] Executing: /bin/sh -c cd /home/runner/work/creadur-rat/creadur-rat && git whatchanged '--since=2025-07-26 13:37:23 +0000' '--until=2025-08-26 13:37:23 +0000' --date=iso -- /home/runner/work/creadur-rat/creadur-rat
[INFO] Working directory: /home/runner/work/creadur-rat/creadur-rat
Error:  Provider message:
Error:  The git-log command failed.
Error:  Command output:
Error:  'git whatchanged' is nominated for removal.
If you still use this command, please add an extra
option, '--i-still-use-this', on the command line
and let us know you still use it by sending an e-mail
to <[email protected]>.  Thanks.
fatal: refusing to run without --i-still-use-this

Not sure if a possible workaround/quickfix is to add an option '--i-still-use-this' to the changelog plugin OR if someone from the project could send the mail as mentioned above?

Thanks

ottlinger avatar Aug 25 '25 15:08 ottlinger

as workaround you can try to change scm provider to jgit

https://maven.apache.org/scm/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/index.html

https://maven.apache.org/plugins/maven-changelog-plugin/changing-scm-impl.html (second example)

by the way look like bug in

https://github.com/apache/maven-scm/blob/aef008167cb37f8cc70c7c0066679fef114aca92/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java#L254-L258

slawekjaranowski avatar Aug 25 '25 16:08 slawekjaranowski

@slawekjaranowski thanks for the additional information and digging into the code. Should I file a Jira or can you trigger the changes at maven-scm internally?

Who would be the correct sender of the mail to the git devs in order to keep "git whatchanged" alive or provide a working alternative?

Cheers

ottlinger avatar Aug 25 '25 19:08 ottlinger

We've switched to gh issues: https://github.com/apache/maven-scm/issues @kwin can you look?

slawekjaranowski avatar Aug 25 '25 20:08 slawekjaranowski

The change in maven-scm is now tracked in https://github.com/apache/maven-scm/issues/1310.

kwin avatar Sep 15 '25 10:09 kwin

@slawekjaranowski your hint did not work. Even with a different scm implementation the builds fail with above error:

[INFO] Generating "Change Log" report    --- maven-changelog-plugin:3.0.0-M1:changelog
[INFO] Change the default 'svn' provider implementation to 'javasvn'.
[INFO] Generating changed sets xml to: /Users/userspamschutz/target/changelog.xml
[INFO] Executing: /bin/sh -c cd '/Users/userspamschutz' && 'git' 'whatchanged' '--format=medium' '--decorate=short' '--raw' '--no-merges' '--date=iso' '--' '.'
[INFO] Working directory: /Users/userspamschutz
[ERROR] Provider message:
[ERROR] The git-log command failed.
[ERROR] Command output:
[ERROR] 'git whatchanged' is nominated for removal.
If you still use this command, please add an extra
option, '--i-still-use-this', on the command line
and let us know you still use it by sending an e-mail
to <[[email protected]](mailto:[email protected])>.  Thanks.
Schwerwiegend: Ausführung ohne --i-still-use-this verweigert

ottlinger avatar Sep 29 '25 08:09 ottlinger

Using the new v2.2.1 of maven-scm-provider-git-commons does not solve the problem. @kwin do I need to pull in other versions to get the changes you mentioned above?

https://github.com/ottlinger/spamschutz/commit/d7c355055d53b4fad4521c7ec0ea0fe4f78c245c did not help, unfortunately.

ottlinger avatar Sep 29 '25 08:09 ottlinger

It worked for me by overriding all of scm by 2.2.1 release. Its more than a single jar. However, it ignores the time range completely and is pulling all git results for all time. Even trying to set range, it still pulls all time. So either that is another existing bug not noticed before or its a result of those changes. I haven't looked further.

hazendaz avatar Sep 29 '25 13:09 hazendaz

As @hazendaz stated, you need to overwrite all plugin dependencies listed in https://github.com/apache/maven-changelog-plugin/blob/eee1fd4a20614be0fe7f035626c0c71028bc4365/pom.xml#L250-L290. Also don't use build extensions but just customize the plugin classloader via plugin->dependencies

kwin avatar Sep 29 '25 13:09 kwin

@hazendaz feel free to file a new bug in order to request the "old functionality" to be reinstated. Personally I'm not sure if it were easier to request to keep 'git whatchanged' .....

ottlinger avatar Sep 30 '25 07:09 ottlinger

I ran a quick query to chatgpt and got the following using this query

maven changelog plugin uses maven scm. scm used whatchanged but switched to log, now changelog no longer defaults output, it displays all git history
git whatchanged had an implicit “recent commit window” behavior built into the plugin’s logic.

git log is more explicit: it does not assume any timeframe.

The plugin didn’t change, but the SCM provider now just outputs everything because no --since/--until or revision range is being applied by default.

Considering I tried to add the ranges explicitly for last 30 days and still did not work, I'd assume some issue in how data is passed to scm since scm takes the arguments at least per its various test cases. I have not looked further as of yet so not sure if the issue belongs here or over at scm.

hazendaz avatar Oct 04 '25 02:10 hazendaz

@kwin can you provide a helping hand here - does the SCM library allow setting/having a timeframe in order to restore the old functionality? Thanks

ottlinger avatar Oct 14 '25 12:10 ottlinger