Skip to content

SD-220 building without being in a git repository#5411

Merged
adriaanm merged 1 commit intoscala:2.12.0from
gourlaysama:ticket/sd-220-build-without-git
Sep 26, 2016
Merged

SD-220 building without being in a git repository#5411
adriaanm merged 1 commit intoscala:2.12.0from
gourlaysama:ticket/sd-220-build-without-git

Conversation

@gourlaysama
Copy link
Contributor

This allows building from the scala source 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).

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).
```
@SethTisue
Copy link
Member

SethTisue commented Sep 20, 2016

LGTM (I tested locally on OS X)

@SethTisue SethTisue modified the milestones: 2.12.0-RC2, 2.12.1 Sep 20, 2016
@SethTisue SethTisue changed the base branch from 2.12.x to 2.12.0 September 20, 2016 16:29
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@adriaanm adriaanm merged commit d35a7bd into scala:2.12.0 Sep 26, 2016
@gourlaysama gourlaysama deleted the ticket/sd-220-build-without-git branch September 27, 2016 15:53
@adriaanm adriaanm added the 2.12 label Oct 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants