Open pmeinhardt opened 7 years ago
Nice idea. π The advantages you named are totally valid and I'd be totally in to try that out. But to start a discussion, I'd throw in some advantages of the current approach as well:
herodot track
approach (or at least explicitly naming what you want to track) is that you may not want to track every repository.
Examples: However we could probably implement a herodot track
command for your approach as well, by using the .herodot.yml in a project, and explicitly enabling tracking.
As alternative for enabling tracking automatically, we could add something like herodot track --global
or herodot auto-track
or whatever, that writes git hook templates, that are used by git when cloning or initialising a repo.
In theory (and maybe a bit hacky) we could update the scripts of tracked repos, by using the paths recorded in the worklogs. Not a good solution, but one path we could go if we stick to the current approach and need to update the hooks.
First up: Nice work! π Really looking forward to using herodot and seeing it develop!
I was just wondering:
How about implementing the tracking functionality by setting up herodot as a git wrapper instead of relying on
post-checkout
andpost-commit
hooks?By "wrapper" I mean something along the lines of hub or rather the shims used in rbenv and asdf.
A few possible advantages of such an approach:
Allow tracking development activity for source code management tools other than git
When creating
git
,hg
, β¦ shims that are prepended to one'sPATH
, it would be possible to intercept branch-switching and commit activity, even if the SCM tool does not provide hooks for these activities.Theoretically, you could instrument other tools as well using this approach β it's probably better not to go totally crazy with it though.
Track all repos instantly without explicitly installing hooks into each of them
With the proposed approach, you wouldn't need to
herodot track β¦
all your repos first. Instead every call togit
β¦ could be tracked right away.Allow for easier updates
One possible problem of the hook approach is, that when you have to update the tracking logic, you will have to update the hook scripts in all tracked repos. With a shim/wrapper approach, it would be enough to update
herodot
itself as all the tracking logic is kept inside the tool. Doing this, you also avoid scattering the same hook code throughout all your repos.Those are just a few thoughts. Much looking forward to feedback and discussion. I would also be happy to contribute to/pair on an implementation of the described approach π