Coder Social home page Coder Social logo

git-decent's Introduction

Git-Decent is a small tool designed to help you, night owls ๐Ÿฆ‰, maintain appearances while working during unconventional hours.

Some individuals prefer to work during the night or other quiet hours, such as weekends. However, this can create pressure on the rest of the team to work during those hours or to be around to check pull requests and commits outside of their regular working schedule.

asciicast

Configuration

The configuration for git-decent is simple and intuitive. By using a configuration file, you can define the desired "decent time frames" for commits.

Here's an example of how the configuration seciton inside git config will look like:

[decent]
    Monday = 09:00/13:00, 14:00/17:00
    Tuesday = 09:00/13:00, 14:00/17:00
    Wednesday = 09:00/13:00, 14:00/17:00
    Thursday = 09:00/13:00, 14:00/17:00
    Friday = 09:00/13:00, 14:00/17:00

This is the default configuration which contains the typical 9 to 5 schedule.

Commands

  • git decent: Unpushed commits are amended if needed to fit the schedule
  • git decent amend: Amend the last commit, if needed
  • git decent install: Installs the pre-push and post-commit [1] hooks
  • git decent pre-psuh: This is the hook that prevents pushes at undecent times
  • git decent post-commit: This is the hook that automatically amends commits [1]

Commit Amendment Example

Suppose a commit is made during off-hours on a weekend, such as Saturday at 02:00, git-decent will amend the commit to have a datetime corresponding to the next available "decent" time frame, which in this case is Monday from 09 to 13.

If another commit is done on Saturday, then it will be placed after the latest unpushed commit.

Privacy Considerations

It is important to note that git-decent is not designed to preserve privacy. Its purpose is solely to make your working time less conspicuous to others.

Pre-Push Hook

git-decent also provides a pre-push hook to prevent the pushing of commits made in the future. It will also prevent pushes outside of decent time frames.

Post-Commit hook

This commit will automatically amend the recently created commit. We are abusing the intent of this hook which is just notification to do our business, so please be careful while using it and use it under your responsability.

The commit tries really hard not to execute when it is not required (rebases, merges, cherry picks, etc).

Feel free to contribute to Git-Decent and make your nocturnal coding sessions a bit more "decent"!

git-decent's People

Contributors

afiestas avatar

Watchers

 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.