Permalink
Browse files

Singularize time unit in client banner build age

  • Loading branch information...
1 parent dc5350b commit a8748b82dee34d51c965770f7db4fe0cc1761c18 @zaeleus zaeleus committed Feb 7, 2014
Showing with 8 additions and 3 deletions.
  1. +8 −3 base/version.jl
View
11 base/version.jl
@@ -196,10 +196,15 @@ function banner(io::IO = STDOUT)
commit_string = ""
else
days = int(floor((ccall(:clock_now, Float64, ()) - GIT_VERSION_INFO.fork_master_timestamp) / (60 * 60 * 24)))
- if GIT_VERSION_INFO.fork_master_distance == 0
- commit_string = "Commit $(GIT_VERSION_INFO.commit_short) ($(days) days old master)"
+ unit = days == 1 ? "day" : "days"
+ distance = GIT_VERSION_INFO.fork_master_distance
+ commit = GIT_VERSION_INFO.commit_short
+
+ if distance == 0
+ commit_string = "Commit $(commit) ($(days) $(unit) old master)"
else
- commit_string = "$(GIT_VERSION_INFO.branch)/$(GIT_VERSION_INFO.commit_short) (fork: $(GIT_VERSION_INFO.fork_master_distance) commits, $(days) days)"
+ branch = GIT_VERSION_INFO.branch
+ commit_string = "$(branch)/$(commit) (fork: $(distance) commits, $(days) $(unit))"
end
end
commit_date = GIT_VERSION_INFO.date_string != "" ? " ($(GIT_VERSION_INFO.date_string))": ""

0 comments on commit a8748b8

Please sign in to comment.