diff options
author | Tim Oram <me@mitmaro.ca> | 2017-01-21 23:11:17 -0330 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-21 23:11:17 -0330 |
commit | b7c840533ce0cb6363992ba25fe991a333140299 (patch) | |
tree | 49513a2be9c51e47e0007154a697e128592688bf | |
parent | 637796c96a029c874985d59044fb612d584b0534 (diff) | |
parent | 0836083206193466db0e061d341ce9144afa0a03 (diff) |
Merge pull request #1 from MitMaro/0.3.00.3.0
Version 0.3.0
-rw-r--r-- | CHANGELOG.md | 38 | ||||
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | Cargo.toml | 23 | ||||
-rw-r--r-- | LICENSE | 15 | ||||
-rw-r--r-- | README.md | 52 | ||||
-rw-r--r-- | git-interactive-tool.gif | bin | 0 -> 116434 bytes | |||
-rw-r--r-- | src/main.rs | 40 |
7 files changed, 153 insertions, 19 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..eb85112 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,38 @@ +# Change Log +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [0.3.0] - 2017-01-21 +### Changed +- Cleaned up help + +### Added +- Build setup +- Documentation with `README.md` +- LICENSE + +### Changed +- `Cargo.toml` cleaned up + +## [0.2.0] - 2017-01-07 +### Added +- `Q` key that immediately aborts +- `W` key that immediately resumes rebase + +### Fixed +- Fixed actions for `j` and `k` keys + +### Changed +- Complete rewrite of the project +- Removed `exec` support +- Friendlier selection indicator + +## 0.1.0 - 2016-12-22 +### Added +- Initial project release + +[Unreleased]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/0.3.0...HEAD +[0.3.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/0.2.0...0.3.0 +[0.2.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/0.1.0...0.2.0 @@ -1,6 +1,6 @@ [root] -name = "git-interactive-tool" -version = "0.1.0" +name = "git-interactive-rebase-tool" +version = "0.3.0" dependencies = [ "pancurses 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1,7 +1,26 @@ [package] -name = "git-interactive-tool" -version = "0.1.0" +name = "git-interactive-rebase-tool" +version = "0.3.0" authors = ["Tim Oram <mitmaro@gmail.com>"] +license = "ISC" +description = "Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses." +repository = "https://github.com/MitMaro/git-interactive-rebase-tool" +keywords = [ "git", "editor", "tool", "rebase", "interactive", "ncurses" ] +readme = "README.md" [dependencies] pancurses = "0.7" + +[package.metadata.deb] +maintainer = "Tim Oram <me@mitmaro.ca>" +copyright = "Tim Oram <me@mitmaro.ca>" +license_file = ["LICENSE", "2"] +extended_description = """\ +Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses.""" +depends = "$auto" +section = "utility" +priority = "optional" +assets = [ + ["target/release/git-interactive-tool", "usr/bin/interactive-rebase-tool", "755"], + ["README.md", "usr/share/doc/cargo-deb/README", "644"], +] @@ -0,0 +1,15 @@ +Copyright (c) 2015, Tim Oram and all contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice appear +in all copies. + +The software is provided "as is" and the author disclaims all +warranties with regard to this software including all implied +warranties of merchantability and fitness. In no event shall the +author be liable for any special, direct, indirect, or +consequential damages or any damages whatsoever resulting from +loss of use, data or profits, whether in an action of contract, +negligence or other tortious action, arising out of or in connection +with the use or performance of this software.
\ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1bbfda2 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# Git Interactive Tool + +Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses. + +![Image](git-interactive-tool.gif?raw=true) + +## Install + +#### Debian (and similar) + +Download the `.deb` file from the releases page and install. The executable will be installed to `/usr/bin`. + +#### MacOS and OSX + +Download the `interactive-rebase-tool` from the releases page and copy it to a location on your `PATH`. + +## Configure Git + +In your command line run: + + git config --global sequence.editor interactive-rebase-tool + +## Usage + +### Getting Help + +The tool has built in help that can be accessed by hitting the `?` key. + + +### Key Bindings + +| Key | Description | +| ----- | ----------- | +| Up | Move selection up | +| Down | Move selection Down | +| `q` | Abort interactive rebase | +| `Q` | Immediately abort interactive rebase | +| `w` | Write interactive rebase file | +| `?` | Immediately write interactive rebase file | +| `j` | Show help | +| `k` | Move selected commit up | +| `p` | Move selected commit down | +| `r` | Set selected commit to be picked | +| `e` | Set selected commit to be reworded | +| `s` | Set selected commit to be edited | +| `f` | Set selected commit to be squashed | +| `x` | Set selected commit to be fixed-up | +| `d` | Set selected commit to be dropped | + +## License + +Git Interactive Rebase Tool is released under the ISC license. See [LICENSE](LICENSE). diff --git a/git-interactive-tool.gif b/git-interactive-tool.gif Binary files differnew file mode 100644 index 0000000..5ce19e7 --- /dev/null +++ b/git-interactive-tool.gif diff --git a/src/main.rs b/src/main.rs index 8616733..eb97568 100644 --- a/src/main.rs +++ b/src/main.rs @@ -279,7 +279,7 @@ impl Window { fn draw_footer(&self) { self.set_color(Color::White); self.set_dim(true); - self.window.addstr("\nActions: [ up, down, q, w, j, k, p, r, e, s, f, d, ? ]\n"); + self.window.addstr("\nActions: [ up, down, q/Q, w/W, j, k, p, r, e, s, f, d, ? ]\n"); self.set_dim(false); } @@ -287,25 +287,35 @@ impl Window { self.window.clear(); self.draw_title(); self.set_color(Color::White); - self.window.addstr(" Up and Down arrow keys to move selection\n"); - self.window.addstr(" q, abort interactive rebase\n"); - self.window.addstr(" Q, abort interactive rebase, without confirm\n"); - self.window.addstr(" w, write and continue interactive rebase\n"); - self.window.addstr(" W, write and continue interactive rebase, without confirm\n"); - self.window.addstr(" ?, show this help message\n"); - self.window.addstr(" j, move selected commit up\n"); - self.window.addstr(" k, move selected commit down\n"); - self.window.addstr(" p, pick: use commit\n"); - self.window.addstr(" r, reword: use commit, but edit the commit message\n"); - self.window.addstr(" e, edit: use commit, but stop for amending\n"); - self.window.addstr(" s, squash: use commit, but meld into previous commit\n"); - self.window.addstr(" f, fixup: like 'squash', but discard this commit's log message\n"); - self.window.addstr(" d, drop: remove commit\n"); + self.window.addstr(" Key Action\n"); + self.window.addstr(" --------------------------------------------------\n"); + self.draw_help_command("Up", "Move selection up"); + self.draw_help_command("Down", "Move selection Down"); + self.draw_help_command("q", "Abort interactive rebase"); + self.draw_help_command("Q", "Immediately abort interactive rebase"); + self.draw_help_command("w", "Write interactive rebase file"); + self.draw_help_command("W", "Immediately write interactive rebase file"); + self.draw_help_command("?", "Show help"); + self.draw_help_command("j", "Move selected commit up"); + self.draw_help_command("k", "Move selected commit down"); + self.draw_help_command("p", "Set selected commit to be picked"); + self.draw_help_command("r", "Set selected commit to be reworded"); + self.draw_help_command("e", "Set selected commit to be edited"); + self.draw_help_command("s", "Set selected commit to be squashed"); + self.draw_help_command("f", "Set selected commit to be fixed-up"); + self.draw_help_command("d", "Set selected commit to be dropped"); self.window.addstr("\n\nHit any key to close help"); self.window.refresh(); self.window.getch(); } + fn draw_help_command(&self, command: &str, help: &str) { + self.set_color(Color::Blue); + self.window.addstr(&format!(" {:4} ", command)); + self.set_color(Color::White); + self.window.addstr(&format!("{}\n", help)); + } + fn set_color(&self, color: Color) { match color { Color::White => self.window.attrset(pancurses::COLOR_PAIR(0)), |