A Version Control Menu tool.
Simply wraps the output of git status in a useful menu, so you can quickly view, edit, diff, revert, and commit changes, etc., often with single keystrokes.
Also works with Subversion. Additionally offers a limited filesystem browser.
Typical view after making a change to the kernel:
git@github.com:torvalds/linux.git . @master
1) _M CREDITS
==> 2) _M net/handshake/netlink.c
3) A_ note-to-linus.txt
X 4) ?? note-to-self.txt
GIT:
In the current state:
-
Typing
cwill commitnote-to-linus.txt -
Typing
Xwill deletenote-to-self.txt(it was already marked for deletion withx -
Typing
awill addnetlink.cto the git index -
Typing
dwill show the diff fornetlink.c. Typingewill open it for viewing and typingvwill open it for editing.
$ git clone https://github.com/j-woz/virken.git $ pip install virken
Run with virken.
See virken -h.
Use virken-debug to run from the source tree (not the pip installed code).
Requires Python 3.6 for PosixPath iterable stuff. No other packages.
Implemented using Python’s curses library and typical command-line tools.
We simply show the output from git status (or svn status or ls), then capture a keystroke and run the corresponding shell command. We have to fall out of curses to run other tools that use curses (like the pager, editor, etc.); this is the most complicated part of the control logic.
Type h for help and get:
VIRKIN HELP Space: select item Enter: refresh Number: select menu item a: Add to VC UP: Move up A: Select all P: Page up b: Show blame DOWN: Move down c: Change directory N: Page down C: VC commit selected+ ^: Go up a directory d: VC diff+ <: Back directory* D: Two file diff >: Forward directory* e: Examine file in PAGER +: Create directory* g: Glob f: Toggle FS mode G: Git subcommand h: Show this help I: Toggle show ignored files j: Jump to number k: Mark: Move to backup file K: Mark: Copy to backup file l: Load marks L: View VC log q: Quit s: Save marks S: Subversion subcommand (resolve@, stash@, un-add*) t: Toggle show file status v: Launch editor V: reVert w: Where (search) x: Mark: Delete X: Expunge marked deletes and backups z: Select zero (hide arrow) :: Control line (like vi)* + Command will operate with no arguments if nothing is selected. @ Command will operate with current argument if nothing is selected. * Not yet implemented
Virken automatically detects the relevant version control (VC) system (Git, Subversion, or plain FS). The commands use the correct tool based on the detected VC.
Files may be "marked" as "select", "backup", or "delete". The marks apply to many of the commands. So, for example, you can select multiple files, diff all of them, and then quickly commit them with very few keystrokes.
You can save the marks with s, quit Virken, then launch it again, and your marks will automatically be reloaded. The marks are stored in ./.virken.json .
These environment variables have an effect on Virken:
VIRKEN_EDITORorEDITOR-
Used to select the editor for key
v. VIRKEN_PAGERorPAGER-
Used to select the pager for key
e.