-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-revision.pl
executable file
·25 lines (20 loc) · 1.08 KB
/
get-revision.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env perl
###############################################################################
# This script finds the unique identifier for the current SCM revision. #
# #
# Input: None #
# Output: A single line of text of the format: #
# {commit ID}[-modified] #
# #
# Note: #
# If the current state of the local repository does not match the latest #
# commit, the suffix "-modified" is added" #
###############################################################################
use strict;
use warnings;
my $revision = `git rev-parse HEAD`;
$revision =~ s/\s+$//;
if(`git status --short | grep -v [Dd]ocker` ne ""){
$revision = $revision . "-modified";
}
print($revision);