←back to thread

115 points NyuB | 9 comments | | HN request time: 0.758s | source | bottom

I use interactive rebase quite often, and particularly like the editor bundled with IntelliJ. But I do not always work with IntelliJ, and am not 'fluent' with Vim, so I tried to replicate roughly the same rebase experience within a TUI. I used a small TUI OCaml project i made last year.

The notable features are: - Move commits up and down, fixup, drop - Rename commits from the editor (without having to stop for a reword during the rebase run) - Visualize modified files along commits - 'Explode' a commit ,creating a commit for each modified file (a thing I found myself doing quite often)

Feedbacks (both on the tool and the code) and contributions welcome, hope it could fit other people needs too !

1. 3D39739091 ◴[] No.41838530[source]
Not trying to downplay your work, making cool tools is always cool, BUT:

1. You can also just configure Git to use whatever editor you'd like.

https://git-scm.com/docs/git-config#Documentation/git-config...

2. You don't need to be a Vim pro to interactive rebase effectively. Most of it will be `dd` to remove a line, `p` to paste a line, `j`/`k` to move up and down lines, and `cw` to change `pick` to `edit`, etc. Spend 15m with `vimtutor` (which is probably available on your system) and you'll never be afraid of vim again.

replies(3): >>41838930 #>>41839226 #>>41843151 #
2. samtheprogram ◴[] No.41838930[source]
Second this. Just change the EDITOR variable.

You’re getting downvoted (probably because of the mini Vim tutorial in #2) while the author of the post wrote a whole TUI because they didn’t know to change their EDITOR variable.

Learn your tools, people. This is the equivalent of a contractor taping rulers together because they didn’t realize their bag comes with a tape measure.

replies(2): >>41839644 #>>41841317 #
3. serced ◴[] No.41839226[source]
TIL there is 'vimtutor'. I barely new the basics for quickly creating a file and inserting stuff. Will have a look if there is something to learn there, thanks for the pointer.
4. unfunco ◴[] No.41839644[source]
It's GIT_EDITOR first, then EDITOR if GIT_EDITOR is not set.
replies(2): >>41840381 #>>41840952 #
5. Jenk ◴[] No.41840381{3}[source]

    git config --global core.editor "vim"
6. codetrotter ◴[] No.41840952{3}[source]
Yes, but EDITOR is also read by a lot of other tools. And if you want to use a particular editor with git, and didn’t know about EDITOR, you probably want to set EDITOR so that when other tools open an editor it will be the same one.

But if you already have that and want something specific and different for just git then yeah GIT_EDITOR.

7. 3D39739091 ◴[] No.41841317[source]
> Learn your tools, people. This is the equivalent of a contractor taping rulers together because they didn’t realize their bag comes with a tape measure.

I feel like this is one of the big things we lose when working completely remote and disconnected: missing out on all these chances to help each other. We don't know the things we don't know.

Imagine OP was going to do a rebase -i, sitting next to a teammate and said, "man, I would do anything to be able to use interactive rebase without having to learn vim", and their teammate turned back and said, "Oh, you can use any editor you want".

replies(1): >>41842884 #
8. appendix-rock ◴[] No.41842884{3}[source]
No. Didn’t you hear? There’s zero benefits to working in an office, at all. It’s all lies because of commercial real estate or something. /s
9. ◴[] No.41843151[source]