115 points · by NyuB · 2y ago · 115 comments
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 !
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 }
;;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...
Not sure what this project is now, it certainly does not seems to be a TUI focused on Git rebases.
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).
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.
Congrats for the release!
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.
Nothing beats Meld for me, but if you're on a remote GUI-less machine, there aren't good options.
https://github.com/jesseduffield/lazygit
(I am not actually sure what a three-way merge conflict is though TBH.)
I do not recall what problem I had with that particular one, but I ended up just using raw Notty in the end.
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.
It's true that the juice may be worth the squeeze for some, but "a bit of a learning curve" undersells it a little bit, I fear LOL
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.
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.
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".
But if you already have that and want something specific and different for just git then yeah GIT_EDITOR.
git config --global core.editor "vim"Every time I see tools like this I think "ah, the normies are reimplementing Magit".
Never bothered learning the Git CLI since it's always seemed cumbersome compared to Magit. That is the other major advantage to Magit, the UI is discoverable, there is always a subwindow displaying all available commands and most of the commonly used flags. (Less commonly used flags can be displayed by adjusting the transient level.)
I'm comfortable git fooing w/e is necessary, but ever since we adopted this, git related conversations went to almost zero. It's great.
My reviewers love when I write “review commit by commit” in the PR description. Then each individual commit has its own reasoning, and you can mentally switch into reviewing if that commit does it’s one thing it’s supposed to do correctly. I will accept the argument that each commit should be its own PR though :)
The PR is just the best GitHub had to offer. There are other approaches to code review.
[1] Here we are generalizing.
The PR is the unit of work, people get too hung up on the PR's individual commits.
Worst: rebase and merge - you end up with your coworker's broken WIP commits all over master, and have a terrible git revert story
OK: merge commit - you can revert, but there is a less intuitive `-m 1` flag (IIRC?) you have to pass into revert, and IMO you rarely need the intermediate history.
Best: squash & merge - you get one single commit representing the unit of work merging in, git revert is dead easy
Also setting the commit message in main to the `{title} (#{prNum})\n\n{prDescription}` format preserves all the good context from your PR and lets you get back to it if you need.
1. You get rid of WIP commits, typo fix commits, all kinds of transient changes (for review and so on)
2. You keep the substantive ones
3. All changes are logically separated
I don’t see where you cover this option.
> Also setting the commit message in main to the `{title} (#{prNum})\n\n{prDescription}` format preserves all the good context from your PR and lets you get back to it if you need.
Again. It is ironic that people are so comfortable with dumping the history in a webapp when you are working with a version control system.
I am fine with a lot of the history being on GitHub or whatever other webapp. The review history, that is. But I’m not comfortable with leaving the history of the pre-squashed commits on GitHub if those pre-squashed commits were useful for the long-term history.
And if the PR author deems their commits insignificant, they can feel free to make one PR and they squash & merge.
IMHO the guideline should be "clean up your branch and rebase it before merging. Usually that means a single commit, but it can be multiple if that makes more sense to <future person> reading the history".
In my experience, engineers tend to fall into 1 of 2 camps: 'Deep' Git knowledge who routinely dig through reflog and keep backup branches, commit early/often and autosquash logcal chunks until their PRs tell a Story through their commit history. The other side pretends git is p4; and has no concept of fetch vs pull vs rebase. A base assumption that branches are expensive and to be avoided.
I'd like to think probably fall in the middle, but nearly every engineer I've worked with falls on those edges based on the number of DMs i get asking for help after after the rote `git stash; git pull; git stash pop` throws conflict.
Another nice thing with squashing is that merges into master always look the same regardless of individual engineer workflows.
Commit history on a (larger?) PR tends to be most useful during the PR itself; I tend try and make my commits tell a story I can walk people through (on the CLI during a call) moreso than anything that will be useful in 6mo/year.
I've been convinced on Squash/Merge. If the PR needs more granular commits; maybe it should be 2 independent PRs.
We constantly use that on the OSS project I’m occasionally involved with. “Well why is it like that…” and the project has enforced a good history so this can often be answered.
And that’s the primary benefit of Git. With some discipline the history becomes legible.
On the other hand it doesn’t give you much out of the box for code review. Unless the code review you use is covered by the email tooling.
And so there is no reason to interfere with anyone’s way of working.
I firmly believe GitHub makes reviewing individual commits in a PR so painful that I'd rather not do that.
No. This kind of policy has plenty of downsides[1] and the upsides are relatively minor.
But I can’t relate in general to those workflows where PRs have to be tiny and revertable (why need to revert so often).
Maybe AI is the answer for enforcing the format and for discoverability since it provides GUI-like hand holding without the hassle of actually writing GUI code.
https://hachyderm.io/@inthehands/112006855076082650
> You might be surprised to learn that I actually think LLMs have the potential to be not only fun but genuinely useful. “Show me some bullshit that would be typical in this context” can be a genuinely helpful question to have answered, in code and in natural language — for brainstorming, for seeing common conventions in an unfamiliar context, for having something crappy to react to.
> Alas, that does not remotely resemble how people are pitching this technology.
https://www.reddit.com/r/emacs/comments/14xwue3/chatgpt_visi...
Although it looks like someone had the doctor talking to ChatGPT.
"Show me some bullshit that would be typical in this context... And we'll build a multi-trillion dollar investment bubble with whatever you say."
Cheers! TYFTL (thank you for the laugh)