<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 2 April 2018 at 20:26, Alistair Grant <span dir="ltr"><<a href="mailto:akgrant0710@gmail.com" target="_blank">akgrant0710@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On Sun, Apr 01, 2018 at 10:46:14AM -0700, Eliot Miranda wrote:<br>
> Hi Alistair,<br>
><br>
> _,,,^..^,,,_ (phone)<br>
><br>
> > On Mar 31, 2018, at 1:42 PM, Alistair Grant <<a href="mailto:akgrant0710@gmail.com">akgrant0710@gmail.com</a>> wrote:<br>
> ><br>
> > git doesn't provide a substitution mechanism like sccs, but the script<br>
> > we have that embeds the date can just as easily embed the hash.  In<br>
> > .git_filters/RevDateURL.smudge there's a line that retrieves the<br>
> > commit date from git:<br>
> ><br>
> > $date = `git log --format=%ad -1`;<br>
> ><br>
> > to get the (short) hash we can simply add:<br>
> ><br>
> > $shorthash = `git log --format=%h -1`;<br>
> ><br>
> > The string substitution can then proceed as for the date.<br>
> ><br>
> > I think it would be worthwhile having both the date and hash in the<br>
> > --version info.<br>
> ><br>
> > I'm happy to add this in and update the --version output if there's<br>
> > general agreement.<br>
><br>
> Yes please!!! The conventional alternative is to invoke git log from<br>
> the makefiles and lass in the commit hash as a compiler-line default<br>
> me.  But this is messy and slows down compilation (unless there is a<br>
> special rule for just one file, and that's fragile).  I much prefer<br>
> having the commit somewhere in source.<br>
<br>
Done:<br>
<br>
$ git log --oneline | head<br>
5a5b1c7 vm version string: add commit short hash<br>
4c4686e Skip SUnit testing in Sista builds<br>
79c0809 Merge pull request #230 from smalltalking/Cog<br>
804ed5c Fixed typo in the download URL<br>
<br>
<br>
$ products/cogspur64linuxht/<wbr>pharo --version<br>
5.0-201804012008-version_hash  Sun Apr  1 22:15:07 CEST 2018 gcc 5.4.0 [Production Spur 64-bit VM]<br>
CoInterpreter VMMaker.oscog-eem.2361 uuid: 7ca2f89a-de70-422f-b92b-<wbr>54f91ac4e47b Apr  1 2018<br>
StackToRegisterMappingCogit VMMaker.oscog-eem.2361 uuid: 7ca2f89a-de70-422f-b92b-<wbr>54f91ac4e47b Apr  1 2018<br>
VM: 201804012008-version_hash alistair@4c0a4b2bdb79:vmmaker/<wbr>opensmalltalk-vm $<br>
Date: Sun Apr 1 22:08:11 2018 +0200 $ Hash: 5a5b1c7 $<br></blockquote><div><br></div><div>Maybe 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">rather than just "Hash:" </span>could it be more explicit as "GitHash:" or even "GitSHA1:" </div><div>One day the algorithm is likely to change... "Moving Git past SHA-1" (<a href="https://lwn.net/Articles/715716/">https://lwn.net/Articles/715716/</a>)<br></div><div>and it may be useful later to be able to distinguish.  </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Plugins: 201804012008-version_hash alistair@4c0a4b2bdb79:vmmaker/<wbr>opensmalltalk-vm $<br>
Linux 4c0a4b2bdb79 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux<br>
plugin path: products/cogspur64linuxht/lib/<wbr>pharo/5.0-201804012008-<wbr>version_hash [default: /home/alistair/vmmaker/<wbr>opensmalltalk-vm/products/<wbr>cogspur64linuxht/lib/pharo/5.<wbr>0-201804012008-version_hash/]<br>
<br>
<br>
As expected, the hash is also included in:<br>
<br>
- the VirtualMachine object (in Pharo, and the equivalent in squeak)<br></blockquote><div><br></div><div>I presume this is what shows up under System > System Reporter ?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- crash.dmp<br>
- kill -USR1 output<br>
<br>
<br>
<a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/233" rel="noreferrer" target="_blank">https://github.com/<wbr>OpenSmalltalk/opensmalltalk-<wbr>vm/pull/233</a><br>
if anyone wants to take a look.<br></blockquote><div><br></div><div> </div><div>

An interesting insight for me into how the version info is generated. thx.<br class="gmail-Apple-interchange-newline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">cheers -ben</span>

<br></div></div></div></div>