Skip to content

Commit 2a49d2f

Browse files
committed
Add dirty Git repo information to BuildInformation
1 parent bd9fc28 commit 2a49d2f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/processor/java/org/truffleruby/processor/BuildInformationProcessor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class BuildInformationProcessor extends TruffleRubyProcessor {
4646
private String buildName;
4747
private String shortRevision;
4848
private String fullRevision;
49+
private boolean isDirty;
4950
private String compileDate;
5051
private int copyrightYear;
5152
private String kernelMajorVersion;
@@ -58,6 +59,7 @@ public synchronized void init(ProcessingEnvironment env) {
5859
buildName = System.getenv("TRUFFLERUBY_BUILD_NAME");
5960
fullRevision = runCommand("git rev-parse HEAD");
6061
shortRevision = fullRevision.substring(0, 8);
62+
isDirty = !runCommand("git status --porcelain").isBlank();
6163
compileDate = runCommand("git log -1 --date=short --pretty=format:%cd");
6264
copyrightYear = Integer.parseInt(compileDate.split("\\-")[0]);
6365
kernelMajorVersion = findKernelMajorVersion();

src/shared/java/org/truffleruby/shared/BuildInformation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public interface BuildInformation {
2020

2121
String getFullRevision();
2222

23+
boolean isDirty();
24+
2325
int getCopyrightYear();
2426

2527
String getCompileDate();

0 commit comments

Comments
 (0)