|
@@ -103,6 +103,27 @@ git_lasthash() {
|
103
|
103
|
git_bool dirty && echo -n ".dirty"
|
104
|
104
|
}
|
105
|
105
|
|
|
106
|
+git_lastsummary() {
|
|
107
|
+ #
|
|
108
|
+ # Show last commit summary
|
|
109
|
+ #
|
|
110
|
+ # We can't do it outside git repo (or without git) but we should
|
|
111
|
+ # not be asked to; targets that don't require git should make use
|
|
112
|
+ # of cache built by dist target.
|
|
113
|
+ #
|
|
114
|
+ git_present || {
|
|
115
|
+ echo UNKNOWN_SUMMARY
|
|
116
|
+ warn "no git present; could not determine last summary"
|
|
117
|
+ return 3
|
|
118
|
+ }
|
|
119
|
+ git_bool dirty && {
|
|
120
|
+ echo "(index is dirty)"
|
|
121
|
+ return
|
|
122
|
+ }
|
|
123
|
+ git log -1 --format=oneline HEAD \
|
|
124
|
+ | cut -d' ' -f2-
|
|
125
|
+}
|
|
126
|
+
|
106
|
127
|
semver() {
|
107
|
128
|
#
|
108
|
129
|
# Build proper SemVer version string
|
|
@@ -171,7 +192,7 @@ semver() {
|
171
|
192
|
if ! git describe --tags --exact-match HEAD >&/dev/null;
|
172
|
193
|
then # we are at a later commit than the last tag
|
173
|
194
|
is_tagged=F
|
174
|
|
- brname=$(git_fact current_branch)
|
|
195
|
+ brname=$(git_fact current_branch | sed 's/[^[:alnum:]]/_/g')
|
175
|
196
|
ghash=$(git_fact latest_sha)
|
176
|
197
|
fi
|
177
|
198
|
git_bool dirty && is_dirty=T
|