pre-commit plugin to improve default commit messages when reverting reverts
Project description
reinstate-revert-revert
A tool for cleaning up reverted-revert git commit messages. It will turn
Revert "Revert "Experiment on the flux capacitor""
This reverts commit deadc0dedeadc0dedeadc0dedeadc0dedeadc0de.
into
Reinstate "Experiment on the flux capacitor"
This reverts commit deadc0dedeadc0dedeadc0dedeadc0dedeadc0de.
And reinstates commit 0d15ea5e0d15ea5e0d15ea5e0d15ea5e0d15ea5e.
And, if you have gotten yourself into a bind, it will also convert this:
Revert "Revert "Revert "Revert "Revert "Experiment on the flux capacitor"""""
into this, making it easier to follow the chain:
Revert "Experiment on the flux capacitor"
This reverts commit deadc0dedeadc0dedeadc0dedeadc0dedeadc0de.
And reinstates commit 0d15ea5e0d15ea5e0d15ea5e0d15ea5e0d15ea5e.
And reverts 1337beef1337beef1337beef1337beef1337beef.
And reinstates 1337f0011337f0011337f0011337f0011337f001.
And reverts 1337c0de1337c0de1337c0de1337c0de1337c0de.
Installation
As a git hook
The simplest way to use this package is as a plugin to pre-commit.
A sample configuration:
# Without default_stages, all hooks run in all stages, which means all your
# pre-commit hooks will run in prepare-commit-msg. This is almost certainly
# not what you want. This example will run for the default hooks installed,
# but you might have to adjust it for your environment, if you have changed
# the defaults.
default_stages:
- commit
- merge-commit
repos:
# […]
- repo: https://github.com/erikogan/reinstate-revert-revert
rev: v1.0.1
hooks:
- id: reinstate-revert-revert
stages:
- prepare-commit-msg
By default, pre-commit does not install a hook for the prepare-commit-msg
stage. You probably need to add it for this to work:
pre-commit install -t prepare-commit-msg
As a standalone script
pip install reinstate-revert-revert
See reinstate-revert-revert --help
for a full set of options.
reinstate-revert-revert
takes log message file names as positional arguments.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for reinstate-revert-revert-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b636dab1d0cdd9edc2d1a8912786604863638233370cdf23355ef4227c7be52 |
|
MD5 | facce81e64152f54c90d318110fdb36a |
|
BLAKE2b-256 | a715b5c0d82ec2a720a6d739d84507dfa4ebfc717a4dbe83e88bfca6804df60c |
Close
Hashes for reinstate_revert_revert-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fbca05e098c40052cb8dbf5336162d0002fbfe9ff8539e7ba9ef539eacbd5e2 |
|
MD5 | c351a4a08d361231a3d5f2c9c551bc56 |
|
BLAKE2b-256 | f218f84dd886953b834cddbebea10f38b9b0d446e3268d00939a38855de6fb33 |