Readit News logoReadit News
Posted by u/NyuB a year ago
Show HN: I made a git rebase TUI editorgithub.com/NyuB/ocli...
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 !

hu3 · a year ago
I found this code interesting (not sarcasm) in demo/boiling.ml:

  let increase_level t =
    let level =
      match t.level with
      | No_Fire -> One_Fire
      | One_Fire -> Two_Fires
      | Two_Fires -> Three_Fires
      | Three_Fires -> Three_Fires
    in
    { t with level }
  ;;

  let decrease_level t =
    let level =
      match t.level with
      | No_Fire -> No_Fire
      | One_Fire -> No_Fire
      | Two_Fires -> One_Fire
      | Three_Fires -> Two_Fires
    in
    { t with level }
  ;;

ivanjermakov · a year ago
Hmm, is there OCaml equivalent of Haskell's `succ`[1], which is inplemented for all sum types deriving `Enum`?

It would simplify these two functions to just `succ` and `pred`

[1]: https://hackage.haskell.org/package/base-4.20.0.1/docs/GHC-E...

oniony · a year ago
Went to repository expecting a Git rebase editor and found a whole world of confusion.

Not sure what this project is now, it certainly does not seems to be a TUI focused on Git rebases.

OJFord · a year ago
It seems to be a demo app for the framework described, your 'whole world of confusion' is the framework and other demo app(s):

https://github.com/NyuB/ocli?tab=readme-ov-file#newbase

oniony · a year ago
Yeah, I got that eventually.

I can get behind installing a focused app to give it a whirl and see how it flies, but I draw the line at worlds of confusion. I don't need that on my PC (looking at you NPM).

Bigpet · a year ago
I was confused at first too because I tabbed out and came back to it.

You need to scroll down to the `Newbase` Section. It's apparently both the repo for some kind of cli framework and for the rebase tool.

NyuB · a year ago
For my defense, I'm pretty sure used this link https://github.com/NyuB/ocli#newbase but the #newbase part was stripped ;)

Deleted Comment

nesk_ · a year ago
I’ve been using rebase-editor for years and am pretty happy with it. Maybe it could be an inspiration for you?

Congrats for the release!

https://github.com/sjurba/rebase-editor

DarmokJalad1701 · a year ago
git-interactive-rebase-tool (https://github.com/MitMaro/git-interactive-rebase-tool) has been my go-to for many years now.

It is configured using `git config --global sequence.editor interactive-rebase-tool`. See if you are able to use that interface as well. That will make it easy to use without breaking existing workflows that use `git rebase -i`.

I will give it a try anyway.

lostdog · a year ago
I wish there were a good TUI for handling merge conflicts. Vimdiff seems to be the closest, but doesn't have keyboard bindings for 3-way merges.

Nothing beats Meld for me, but if you're on a remote GUI-less machine, there aren't good options.

arcanemachiner · a year ago
Lazygit works well for merge conflicts (and many other things):

https://github.com/jesseduffield/lazygit

(I am not actually sure what a three-way merge conflict is though TBH.)

shawn_w · a year ago
emacs' smerge has always worked well for me.
mro_name · a year ago
how is your tea different from https://opam.ocaml.org/packages/teash/?
Degorath · a year ago
Sorry for the less-than-useful reply, but I tried out most of the TEA TUI frameworks in OCaml and none of them worked very well or well updated.

I do not recall what problem I had with that particular one, but I ended up just using raw Notty in the end.

NyuB · a year ago
Thanks for the recommendations (which I will probably use rather than this hand-made version :P )
the_duke · a year ago
I think all of this is available in lazygit as well, which seems to still be way too unknown, despite the 50k stars: https://github.com/jesseduffield/lazygit
rkangel · a year ago
All I want is a good TUI git log viewer. I'm perfectly happy to do all the operations on the command line, but navigating the log works well interactively (e.g. start as --first-parent, with single line entries and then be able to selectively show branch commits, and patches for commits).

I end up with a log view and then copy and paste commit hashes to do different things. Or use Sublime Merge which is great, but doesn't work over SSH.

skydhash · a year ago
Not a great solution, but install emacs and then magit. A bit of a learning curve but works great.
keybored · a year ago
I was curious if tig(1) could do such a navigation. But I didn’t find anything.
amar-laksh · a year ago
Bloody love lazygit!
chb · a year ago
No other TUI for git is comparable to it.
jckahn · a year ago
lazygit is as necessary in my life as Vim. Absolutely incredible tool!
shafyy · a year ago
Fucking love lazygit

Deleted Comment