#commit #ui #git #component #hg #interactive #control

bin+lib scm-record

UI component to interactively select changes to include in a commit

3 releases (breaking)

0.3.0 May 26, 2024
0.2.0 Dec 25, 2023
0.1.0 Aug 19, 2023

#99 in Text editors

Download history 1292/week @ 2024-03-14 1242/week @ 2024-03-21 1882/week @ 2024-03-28 1680/week @ 2024-04-04 1278/week @ 2024-04-11 1305/week @ 2024-04-18 1093/week @ 2024-04-25 1420/week @ 2024-05-02 1990/week @ 2024-05-09 1595/week @ 2024-05-16 1985/week @ 2024-05-23 1139/week @ 2024-05-30 1124/week @ 2024-06-06 1953/week @ 2024-06-13 2335/week @ 2024-06-20 2523/week @ 2024-06-27

8,100 downloads per month
Used in 17 crates (5 directly)

MIT/Apache

235KB
6K SLoC

License

MIT OR Apache-2.0

scm-record

scm-record is a UI component to interactively select changes to include in a commit. It's meant to be embedded in source control tooling.

You can think of this as an interactive replacement for git add -p, or a reimplementation of hg crecord/hg commit -i. Given a set of changes made by the user, this component presents them to the user and lets them select which of those changes should be staged for commit.

scm-record was originally developed as a supporting library for git-branchless.

scm-diff-editor

The scm-diff-editor binary is available when compiled with --features scm-diff-editor.

This is a standalone binary that uses the scm-record library as a front-end, and can be integrated directly into some source control systems:

Integration with other projects

Here's some projects that don't use scm-record, but could benefit from integration with it (with your contribution):

Feature wishlist

Here are some features in the UI which are not yet implemented:

  • Make the keybindings easier to discover, allow accessing the menu with the keyboard.
  • Jump to next/previous element of same kind.
  • Edit one side of the diff in an editor.
  • Multi-way split UI to split a commit into more than 2 commits.
  • Support for use as a mergetool.
  • Commands to select ours/theirs for diffs representing merge conflicts.

Dependencies

~6–16MB
~178K SLoC