<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 3 April 2018 at 07:02, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Alistair, Hi Ben,<br>
<div><div class="h5"><br>
<br>
> On Apr 2, 2018, at 9:28 AM, Alistair Grant <<a href="mailto:akgrant0710@gmail.com">akgrant0710@gmail.com</a>> wrote:<br>
><br>
><br>
> Hi Ben,<br>
><br>
><br>
>> On 2 April 2018 at 15:42, Ben Coman <<a href="mailto:btc@openinworld.com">btc@openinworld.com</a>> wrote:<br>
>><br>
>><br>
>><br>
>>> On 2 April 2018 at 20:26, Alistair Grant <<a href="mailto:akgrant0710@gmail.com">akgrant0710@gmail.com</a>> wrote:<br>
>>><br>
>>><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>
>><br>
>><br>
>> Maybe rather than just "Hash:" could it be more explicit as "GitHash:" or even "GitSHA1:"<br>
>> One day the algorithm is likely to change... "Moving Git past SHA-1" (<a href="https://lwn.net/Articles/715716/" rel="noreferrer" target="_blank">https://lwn.net/Articles/<wbr>715716/</a>)<br>
>> and it may be useful later to be able to distinguish.<br>
><br>
> I like "GitHash" as it may not be obvious what the hash refers to for<br>
> a newcomer.  Even if/when git moves away from sha1, from a cli/ui<br>
> perspective presumably it will still just be "the hash".<br>
<br>
</div></div>Commit Hash?<br></blockquote><div><br></div><div>I see Alistar went with this one. A reasonable choice.  </div><div><br></div><div>cheers -ben</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Commit Hash (git)?<br>
C Commit Hash?<br>
Repository Commit Hash?<br>
<br>
We've already moved from one sccs to another for the C code and may move again if anyone improves on git, which is not inconceivable.<br>
<div class="HOEnZb"><div class="h5"><br>
>>> 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>
>><br>
>><br>
>> I presume this is what shows up under System > System Reporter ?<br>
><br>
> Yes.<br>
><br>
><br>
>>> - 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>
>><br>
>><br>
>><br>
>> An interesting insight for me into how the version info is generated. thx.<br>
><br>
> Glad it was useful. :-)<br>
><br>
> Thanks for your feedback.  I'll update the PR (probably tomorrow).<br>
><br>
> Cheers,<br>
> Alistair<br>
</div></div></blockquote></div><br></div></div>