Giter VIP home page Giter VIP logo

git-commits-to-rescuetime-daily-highlights's Introduction

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

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
  3. Add any logic you'd like to use to restrict when highlights are logged
  4. Save the file and make sure it's executable

After you commit your code, you should see highlights start to show up here.

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 ...
fi

To ignore a commit message containing the string 'IGNORE':

if [[ "$MESSAGE" != *_IGNORE_* ]]; then
  curl ...
fi

To ignore both of the above conditions:

if [[ ${#MESSAGE} -gt 15 && "$MESSAGE" != *_IGNORE_* ]]; then
  curl ...
fi

git-commits-to-rescuetime-daily-highlights's People

Contributors

cedrickchee avatar robby1066 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.