Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RescueTime/git-commits-to-rescuetime-daily-highlights
An example script to show how to log code commits as Daily Highlights in RescueTime
https://github.com/RescueTime/git-commits-to-rescuetime-daily-highlights
Last synced: 3 months ago
JSON representation
An example script to show how to log code commits as Daily Highlights in RescueTime
- Host: GitHub
- URL: https://github.com/RescueTime/git-commits-to-rescuetime-daily-highlights
- Owner: RescueTime
- Created: 2014-10-30T22:35:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-12T23:57:57.000Z (about 8 years ago)
- Last Synced: 2024-07-04T04:31:56.685Z (4 months ago)
- Language: Shell
- Size: 149 KB
- Stars: 101
- Watchers: 6
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Log Git commit messages as RescueTime Daily Highlights
==========================================An example script to show how to log code commits as Daily Highlights in RescueTime
Daily highlights are a part of RescueTime Premium that allows you to keep a log of the things you are accomplishing.
You can learn more on the [RescueTime website](https://www.rescuetime.com/rescuetime-pro?detail=highlights)Highlights can be entered manually on the website, or submitted programmatically via the API. This script shows how to use a Git post-commit hook to log a highlight.
## To use this script
1. Copy the file `post-commit.sample` into your `.git/hooks` directory and rename it to `post-commit`
2. Update the `API_KEY` value to use a valid RescueTime API key - [More info](https://www.rescuetime.com/anapi/manage)
3. Add any logic you'd like to use to restrict when highlights are logged
4. Save the file and make sure it's executableAfter you commit your code, you should see highlights start to show up [here](https://www.rescuetime.com/daily-highlights).
## Configuration
### LABEL field:
This will collapse commits under a common label, which is quite helpful if you have a lot of commits. If omitted all commit messages will be shown at the top level alongside any highlights you enter manually on the website.
If you would like to use a different label, change this value to any singular noun. You may, for example, want to reflect the repository in your label if you work on multiple projects - "Rails Commits".
### Filtering highlights
You may not want to log all commit messages, especially if they are just for small changes. You can wrap the highlight submission in an if statement to filter out unwanted highlights.
**Examples:**
To ignore a short commit message:
if [[ ${#MESSAGE} -gt 15 ]]; then
curl ...
fiTo ignore a commit message containing the string '_IGNORE_':
if [[ "$MESSAGE" != *_IGNORE_* ]]; then
curl ...
fiTo ignore both of the above conditions:
if [[ ${#MESSAGE} -gt 15 && "$MESSAGE" != *_IGNORE_* ]]; then
curl ...
fi