1.2.10 • Published 3 years ago

commit-time v1.2.10

Weekly downloads
4
License
MIT
Repository
-
Last release
3 years ago

Commit time

Configuration

Create a ~/.commit-time.json file:

{
    "minGap": 5,
    "maxGap": 30,
    "avoid": [{
        "day": "weekdays",
        "from": "8:00",
        "to": "18:00"
    }, {
        "day": "monday",
        "from": "14:00",
        "to": "23:59"
    }, {
        "day": "*",
        "from": "0:00",
        "to": "8:00"
    }]
}
  • minGap (number): Minimum amount of minutes between commits. Default 5.
  • maxGap (number): Maximum amount of minutes between commits. Default 30.
  • from, to (string): Time in HH:MM format
  • days (string): The days this rule applies. Valid values are:
    • monday
    • tuesday
    • wednesday
    • thursday
    • friday
    • saturday
    • sunday
    • weekends: Saturday and Sunday
    • weekdays: From Monday to Friday
    • *: All days

Installation

This will not work with npx. You have to install it globally.

npm i -g commit-time

Then you can create a configuration file with

commit-time config

Usage

Go to the repo you want to hook and execute commit-time

cd my-awesome-git-repo
commit-time

You can set DEBUG=commit-time:* for extra information.

Commands

  • install: Set the git hook in current repo.
  • uninstall: Remove the git hook from current repo.
  • config: Open editor with config file.
  • edit-hook: Edit the hook file manually.
  • hook: Execute the hook manually. Useful to test it.
  • history: Rewrite branch history with fixed dates.
    • It will create ${YOUR_BRANCH}-commit-time branch with the new history.
    • WARN: Merge commits might cause issues. A diff will be executed at the end to confirm the code hasn't changed.

Profit

When you try to commit in invalid time it will change it to a valid time after the last commit

NOTE: That may even, if required, be in the future

1.2.10

3 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago