Skip to content

Commit b7c8405

Browse files
authored
Merge pull request #1 from MitMaro/0.3.0
Version 0.3.0
2 parents 637796c + 0836083 commit b7c8405

7 files changed

Lines changed: 153 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/).
6+
7+
## [0.3.0] - 2017-01-21
8+
### Changed
9+
- Cleaned up help
10+
11+
### Added
12+
- Build setup
13+
- Documentation with `README.md`
14+
- LICENSE
15+
16+
### Changed
17+
- `Cargo.toml` cleaned up
18+
19+
## [0.2.0] - 2017-01-07
20+
### Added
21+
- `Q` key that immediately aborts
22+
- `W` key that immediately resumes rebase
23+
24+
### Fixed
25+
- Fixed actions for `j` and `k` keys
26+
27+
### Changed
28+
- Complete rewrite of the project
29+
- Removed `exec` support
30+
- Friendlier selection indicator
31+
32+
## 0.1.0 - 2016-12-22
33+
### Added
34+
- Initial project release
35+
36+
[Unreleased]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/0.3.0...HEAD
37+
[0.3.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/0.2.0...0.3.0
38+
[0.2.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/0.1.0...0.2.0

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
[package]
2-
name = "git-interactive-tool"
3-
version = "0.1.0"
2+
name = "git-interactive-rebase-tool"
3+
version = "0.3.0"
44
authors = ["Tim Oram <mitmaro@gmail.com>"]
5+
license = "ISC"
6+
description = "Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses."
7+
repository = "https://github.com/MitMaro/git-interactive-rebase-tool"
8+
keywords = [ "git", "editor", "tool", "rebase", "interactive", "ncurses" ]
9+
readme = "README.md"
510

611
[dependencies]
712
pancurses = "0.7"
13+
14+
[package.metadata.deb]
15+
maintainer = "Tim Oram <me@mitmaro.ca>"
16+
copyright = "Tim Oram <me@mitmaro.ca>"
17+
license_file = ["LICENSE", "2"]
18+
extended_description = """\
19+
Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses."""
20+
depends = "$auto"
21+
section = "utility"
22+
priority = "optional"
23+
assets = [
24+
["target/release/git-interactive-tool", "usr/bin/interactive-rebase-tool", "755"],
25+
["README.md", "usr/share/doc/cargo-deb/README", "644"],
26+
]

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright (c) 2015, Tim Oram and all contributors
2+
3+
Permission to use, copy, modify, and/or distribute this software
4+
for any purpose with or without fee is hereby granted, provided
5+
that the above copyright notice and this permission notice appear
6+
in all copies.
7+
8+
The software is provided "as is" and the author disclaims all
9+
warranties with regard to this software including all implied
10+
warranties of merchantability and fitness. In no event shall the
11+
author be liable for any special, direct, indirect, or
12+
consequential damages or any damages whatsoever resulting from
13+
loss of use, data or profits, whether in an action of contract,
14+
negligence or other tortious action, arising out of or in connection
15+
with the use or performance of this software.

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Git Interactive Tool
2+
3+
Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses.
4+
5+
![Image](git-interactive-tool.gif?raw=true)
6+
7+
## Install
8+
9+
#### Debian (and similar)
10+
11+
Download the `.deb` file from the releases page and install. The executable will be installed to `/usr/bin`.
12+
13+
#### MacOS and OSX
14+
15+
Download the `interactive-rebase-tool` from the releases page and copy it to a location on your `PATH`.
16+
17+
## Configure Git
18+
19+
In your command line run:
20+
21+
git config --global sequence.editor interactive-rebase-tool
22+
23+
## Usage
24+
25+
### Getting Help
26+
27+
The tool has built in help that can be accessed by hitting the `?` key.
28+
29+
30+
### Key Bindings
31+
32+
| Key | Description |
33+
| ----- | ----------- |
34+
| Up | Move selection up |
35+
| Down | Move selection Down |
36+
| `q` | Abort interactive rebase |
37+
| `Q` | Immediately abort interactive rebase |
38+
| `w` | Write interactive rebase file |
39+
| `?` | Immediately write interactive rebase file |
40+
| `j` | Show help |
41+
| `k` | Move selected commit up |
42+
| `p` | Move selected commit down |
43+
| `r` | Set selected commit to be picked |
44+
| `e` | Set selected commit to be reworded |
45+
| `s` | Set selected commit to be edited |
46+
| `f` | Set selected commit to be squashed |
47+
| `x` | Set selected commit to be fixed-up |
48+
| `d` | Set selected commit to be dropped |
49+
50+
## License
51+
52+
Git Interactive Rebase Tool is released under the ISC license. See [LICENSE](LICENSE).

git-interactive-tool.gif

114 KB
Loading

src/main.rs

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,33 +279,43 @@ impl Window {
279279
fn draw_footer(&self) {
280280
self.set_color(Color::White);
281281
self.set_dim(true);
282-
self.window.addstr("\nActions: [ up, down, q, w, j, k, p, r, e, s, f, d, ? ]\n");
282+
self.window.addstr("\nActions: [ up, down, q/Q, w/W, j, k, p, r, e, s, f, d, ? ]\n");
283283
self.set_dim(false);
284284
}
285285

286286
fn draw_help(&self) {
287287
self.window.clear();
288288
self.draw_title();
289289
self.set_color(Color::White);
290-
self.window.addstr(" Up and Down arrow keys to move selection\n");
291-
self.window.addstr(" q, abort interactive rebase\n");
292-
self.window.addstr(" Q, abort interactive rebase, without confirm\n");
293-
self.window.addstr(" w, write and continue interactive rebase\n");
294-
self.window.addstr(" W, write and continue interactive rebase, without confirm\n");
295-
self.window.addstr(" ?, show this help message\n");
296-
self.window.addstr(" j, move selected commit up\n");
297-
self.window.addstr(" k, move selected commit down\n");
298-
self.window.addstr(" p, pick: use commit\n");
299-
self.window.addstr(" r, reword: use commit, but edit the commit message\n");
300-
self.window.addstr(" e, edit: use commit, but stop for amending\n");
301-
self.window.addstr(" s, squash: use commit, but meld into previous commit\n");
302-
self.window.addstr(" f, fixup: like 'squash', but discard this commit's log message\n");
303-
self.window.addstr(" d, drop: remove commit\n");
290+
self.window.addstr(" Key Action\n");
291+
self.window.addstr(" --------------------------------------------------\n");
292+
self.draw_help_command("Up", "Move selection up");
293+
self.draw_help_command("Down", "Move selection Down");
294+
self.draw_help_command("q", "Abort interactive rebase");
295+
self.draw_help_command("Q", "Immediately abort interactive rebase");
296+
self.draw_help_command("w", "Write interactive rebase file");
297+
self.draw_help_command("W", "Immediately write interactive rebase file");
298+
self.draw_help_command("?", "Show help");
299+
self.draw_help_command("j", "Move selected commit up");
300+
self.draw_help_command("k", "Move selected commit down");
301+
self.draw_help_command("p", "Set selected commit to be picked");
302+
self.draw_help_command("r", "Set selected commit to be reworded");
303+
self.draw_help_command("e", "Set selected commit to be edited");
304+
self.draw_help_command("s", "Set selected commit to be squashed");
305+
self.draw_help_command("f", "Set selected commit to be fixed-up");
306+
self.draw_help_command("d", "Set selected commit to be dropped");
304307
self.window.addstr("\n\nHit any key to close help");
305308
self.window.refresh();
306309
self.window.getch();
307310
}
308311

312+
fn draw_help_command(&self, command: &str, help: &str) {
313+
self.set_color(Color::Blue);
314+
self.window.addstr(&format!(" {:4} ", command));
315+
self.set_color(Color::White);
316+
self.window.addstr(&format!("{}\n", help));
317+
}
318+
309319
fn set_color(&self, color: Color) {
310320
match color {
311321
Color::White => self.window.attrset(pancurses::COLOR_PAIR(0)),

0 commit comments

Comments
 (0)