/gir

Primary LanguagePythonMIT LicenseMIT

gir is a curses interface for editing git interactive rebase todo lists. Everyone wants it:

< mrozekma> somebody should really write a program specifically for interacting with the git rebase file. make it trivial to change the flag on each file, see more info about each commit, etc.
< mrozekma> somebody do this
< necroyeti> ... or just use vim?

Setup

Clone this repository wherever you prefer, then install the gir executable:

pip install --user -e .

You will need to add ~/.local/bin to your $PATH if it is not already set in your shell's configuration.

Then, simply configure git to use gir as your interactive rebase editor:

git config --global sequence.editor gir

How to use

gir is divided into two sections. The command pane shows the rebase todo list and is essentially the same view you would get from your text editor. The detail pane (if your window is large enough) shows a diff of the currently selected commit for context:

Hotkeys

This list of hotkeys is accessible within gir by pressing F1.

Navigation

  • k, Up — Scroll up
  • j, Down — Scroll down
  • h, Left — Scroll left
  • l, Right — Scroll right
  • Shift+k, Page Up — Scroll up (page)
  • Shift+j, Page Down — Scroll down (page)
  • Shift+h — Scroll left (page)
  • Shift+l — Scroll right (page)
  • Home — Scroll top
  • End — Scroll bottom

Windows

  • Shift+Up — Focus command pane
  • Shift+Down — Focus commit pane
  • F1 — Show help pane

Commands

These hotkeys will change the currently selected command.

  • p — Pick
  • r — Reword
  • e — Edit
  • s — Squash
  • f — Fixup
  • Del — Del (delete the current commit)

Done

  • q, Esc, Ctrl+c — Cancel rebase
  • Enter — Execute rebase