On Thu, 14 Aug 2014 15:14:46 -0500 "Edward K. Ream" <[email protected]> wrote:
> On Thu, Aug 14, 2014 at 3:00 PM, 'Terry Brown' via leo-editor > <[email protected]> wrote: > > > >> > So, we need a git commit hook to update version.py on every > >> > commit. > > > I have a draft hook written, will share soon. Ok, so this is way more complicated than it seems :-) 1) We can't put the sha1 of the commit into the version file, because that would change the version file, which would change the sha1... So I propose identifying builds with text of the form: 20140814161038 2) I've written two hooks, a pre-commit hook that checks if there's anything to commit, and if there is, updates leo/core/commit_timestamp.json, which looks like this: { "asctime": "Thu Aug 14 16:10:38 2014", "parent": "a69585e26f8162e652bee9eb6d982e55ec615e0e", "timestamp": "20140814161038" } hmmm, it occurs to me it should be possible to include the commit message in here, oddly enough. and a commit-msg hook that grabs the Leo Build ID (timestamp) from here, and adds it to the commit message. So when a user complains about build 20140814161038, a quick git log --grep=20140814161038 will report the commit. I usually browse the repo with gitk, which can also search for these build IDs easily. 3) Finally, I said this was complicated, hooks execute arbitrary code on your computer, so git won't install them automatically, hence: leo/extensions/hooks/install_hooks.py which a developer must run to install the hooks. Oh, and the hooks are written in Python and start with #!/usr/bin/python and install_hooks.py does os.chmod(data[hook+"PATH"], 0o744) but I don't know if that's sufficient on Windows. Cheers -Terry > Excellent. Thanks you. > > I'm investigating what happens without any settings file, except for > the file being loaded. > > Edward > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
