Opened 8 months ago

Last modified 8 months ago

#2800 new enhancement

Add git commit hash to RouterVersion to allow display from the command line / logs

Reported by: Reportage Owned by:
Priority: minor Milestone: undecided
Component: router/general Version: 0.9.48
Keywords: router, commit hash, git Cc:
Parent Tickets: Sensitive: no

Description

Extracting the current git commit hash via build.xml and inserting into RouterVersion?.java would be useful to determine the exact build of the router, and could be displayed via: java -jar ~/i2p/lib/router.jar coreversion perhaps replacing the current ID field which, though deprecated, still displays "Monotone" when queried via command line.

Subtickets

Change History (2)

comment:1 Changed 8 months ago by zzz

Yeah it's not a bad idea but it's only useful for dev builds, as release builds and just about all downstreams are not built from a git repo. And it would have to be yanked out of the manifest as we really can't have the build be modifying any source files. Probably more trouble than it's worth.

comment:2 Changed 8 months ago by Reportage

The commit hash would be inserted when a commit is made to git, separate from the actual build process. Not so different to the current "bump" target in build.xml which modifies RouterVersion?.java

{{{ <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"

match='(\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>}}}

Note: See TracTickets for help on using tickets.