eclipse-egit / egit

EGit, the git integration of Eclipse IDE
https://www.eclipse.org/egit/
Eclipse Public License 2.0
13 stars 6 forks source link

Add Ant task to output info about the current commit #38

Closed ahelwer closed 3 weeks ago

ahelwer commented 3 weeks ago

Description

I would like to add an Ant task which emits info about the current commit into Ant properties.

Motivation

For rolling releases, it is desirable to extract properties from the current commit so they can be embedded in the build version that is displayed to the user (example: 1.8.0-alpha (rev: abcdef) 19 July 2024). While the Ant exec task could be used to run git and parse its output, it is desirable to take a dependency on JGit instead of whatever version of git is installed and on the system path (if any). It would thus be desirable to add an Ant task exposing this functionality that is closely tied to JGit itself.

Alternatives considered

Currently we use one of the many unmaintained JGit wrapper Ant tasks floating around github (this one, specifically). However, it does not expose the info we want - in our case, the commit time which is desired so we can embed the time in the build and users can enjoy the benefits of knowing how old their version of our app is without sacrificing build reproducibility by taking the build time from the system clock. Various other wrappers were evaluated but they are all similarly unmaintained.

Additional context

I am willing to implement this feature. If I write it, is it likely to be merged?

ahelwer commented 3 weeks ago

Accidentally opened this on the egit repo instead of the jgit repo, my apologies.