git-templates
Features
- Copies hooks into
.git/hooks
ongit clone
andgit init
given the install settings in this README - Fork from greg0ire/git_template and add aw hooks there (advantage: activate and deactivate hooks, e.g., depending on language, use of aw)
ActivityWatch (aw)
- Send events to bucket
aw-git-hooks_$HOSTNAME
on post-commit or post-checkout - Add unique list of issues to the aw event
- Support Jira issues, e.g.,
MYPROJECT-123
- Support GitHub/GitLab issues, e.g.,
#123
- Use commit timestamp for post-commit event
- Check effect wenn using duration (e.g., 1h) in event. Needs duration > 0 to be visible in timeline -> 2s. If set to 1h and another event is sent to the bucket within the same hour, the events are overlapping, i.e., a new event does not stop the previous one.
- Add remote.origin.url
- Add branch
- Add first line of commit message (summary/title)
Install
Make this repository the template for the .git
directory of a repository.
$ git clone git@github.com:dratasich/git-templates.git
$ ln -s git-templates/template $HOME/.git-template
$ git config --global init.templatedir '~/.git-template'
As soon as a new repo is cloned or initialized the hooks are copied to the repo's .git/hooks
folder.
To update an existing .git
directory use:
$ cd <a-repository>
$ rsync --archive --verbose --compress --cvs-exclude $HOME/.git-template/hooks/ .git/hooks --delete
For convenience you can use the update
script
to recursively sync all .git
folders given a root directory.
$ ./update.sh <path-to-repos>
For more infos check ./update.sh -h
.