GithubHelp home page GithubHelp logo

aleclearmind / split-patch Goto Github PK

View Code? Open in Web Editor NEW
103.0 2.0 5.0 187 KB

Split your patch similarly to `git add -p` but supporting multiple buckets

License: MIT License

Python 79.90% Shell 20.10%
git patch-management

split-patch's Introduction

split-patch.py

asciicast

This is git add -p on steroids for patches.

Given a my.patch you can run

./split-patch.py my.patch

You can choose in which bucket to put each hunk.

At any moment, you can quit and my.patch will contain unassigned hunks while all the other hunks will be moved to $BUCKET_NAME.patch.

git-split-commit

The git-split-commit command uses split-patch.py to split the HEAD commit in multiple commits.

# Create backup tag
git tag backup-$(date +'%s')

# Split HEAD
./git-split-commit

By default, it first git revert HEAD and then commit all the patches resulting from the split.

If you don't care about the original commit + revert commit pair, you can run:

./git-split-commit --reset

Usage in interactive rebase

You can use git-split-commit during interactive rebase, assuming you have it in $PATH:

git rebase -i HEAD^^^^

Your $EDITOR will pop up with a series of pick commands. After the commit you want to split add:

exec git split-commit

split-patch's People

Contributors

aleclearmind avatar

Stargazers

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