SD-220 building without being in a git repository#5411
Merged
adriaanm merged 1 commit intoscala:2.12.0from Sep 26, 2016
Merged
Conversation
This allows building from the scala sources tarball or similar situations where there is no local git repository: - the git commit date becomes the local date - the short git sha1 becomes "unknown" ``` Welcome to Scala 2.12.0-20160920-155429-unknown (OpenJDK 64-Bit Server VM, Java 1.8.0_102). ```
Member
|
LGTM (I tested locally on OS X) |
janekdb
reviewed
Sep 21, 2016
| lastcommitdate=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 1) | ||
| lastcommithours=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 2) | ||
| if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then | ||
| lastcommitdate=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 1) |
Member
There was a problem hiding this comment.
Restrict to one log message in the first step?
20:38 $ git log -1 --format="%ci"|cut -d' ' -f1
2016-09-15
20:38 $ git log -1 --format="%ci"|cut -d' ' -f2
14:07:08
I'm in British Summer Time TZ so I have a TZ part. Not sure if this matters for the purposes of this change,
20:38 $ git log -1 --format="%ci"|cut -d' ' -f2-3
14:07:08 +0100
Contributor
Author
There was a problem hiding this comment.
Yeah, the head -n 1 part isn't very efficient.
As for TZ, that time ends up in the scala version number, so maybe it should be UTC or something, for the sake or consistency. I honestly don't know if it matters very much.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows building from the scala source tarball or similar
situations where there is no local git repository: