Skip to main content

Interactive terminal diff chunk splitter

Project description

Tweezers

Interactive terminal tool for splitting unified diffs by chunk.

Install

pip3 install diff-tweezers

On Windows, also install:

pip3 install windows-curses

Usage

Git Mode (recommended)

Stage hunks interactively (like git add -p, but better):

tweezers --git

Select hunks to stage, then they're added to the index. Unselected hunks remain in your working tree.

Cherry-pick hunks from a commit:

tweezers --git <commit>
tweezers --git HEAD~3
tweezers --git feature-branch

Select hunks to apply to your working tree. Useful for partially applying commits or extracting changes from another branch.

File Mode

Process a standalone patch file:

tweezers my.patch

Outputs left.patch (unselected hunks) and right.patch (selected hunks).

Options

Option Description
--git Stage hunks from working tree (like git add -p)
--git <commit> Cherry-pick hunks from a commit to working tree
--save Save right.patch file in git mode
--version Show version

Keybindings

Key Action
j / Move down
k / Move up
Space Toggle selection
s Split chunk at context boundaries
l / Unfold
h / Fold
] / } Next file
[ / { Previous file
c Confirm and exit

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diff_tweezers-0.2.5.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diff_tweezers-0.2.5-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file diff_tweezers-0.2.5.tar.gz.

File metadata

  • Download URL: diff_tweezers-0.2.5.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for diff_tweezers-0.2.5.tar.gz
Algorithm Hash digest
SHA256 e5059fc0a3bc27a9e5f9199d35d04551108ba852db51569506c6bf332f0fd8b9
MD5 36ade82c43740607b55b57a5ad77b7c4
BLAKE2b-256 5bbd8153ecd9d57d3d81420cd36e5950e075eafc87c399d583c3e1a02e33fa67

See more details on using hashes here.

File details

Details for the file diff_tweezers-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: diff_tweezers-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for diff_tweezers-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 db593935d350f29402d7789953a03a7638ff2504c31bdad078db912d039b08de
MD5 79ebbbb40fb15cfcf90ff27cbbe6a6b4
BLAKE2b-256 f2faddf30bca409dba39556c081415497bcd0d72eb8b0fde78b0f36e07d3b5b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page