Granted I don't use Emacs but I haven't found any plugin in any editor that gives the same confidence and flexibility as git add -p.
Granted I don't use Emacs but I haven't found any plugin in any editor that gives the same confidence and flexibility as git add -p.
For hunk-level staging, you put your cursor on the hunk you want to add and press "s". If you want to split that and only stage a few lines, you just select those lines and press "s".
This demo is pretty good I think: https://www.youtube.com/watch?v=rzQEIRRJ2T0
I get the feeling that people don't really know about the interactive git commands.
TBQH most people don't explore git beyond the pull-add-commit-push flow, the ones that do immediately feel like they need a GUI where a TUI would do just as well.
Oh, talking about TUI, I also use https://jonas.github.io/tig/ sometimes.
Hunk level commits is what git add -p [s/e] lets you do.
You can split hunks with s, and if you need even more fine grain control you can hit e which opens that specific hunk in your $EDITOR and then you can pick whatever you want to commit.
It's better than editing a patch file; it's much better than `git add -i`.
Sublime Text and Sublime Merge are works off art in terms of speed and usability.
Although I tend to use vscode more now for editing, I use Sublime Merge every day at work. Worth every penny.
You don't need to own this program for long, before it has saved you more than an hour or 2 of work. And the fee is not recurring.
Now, convincing management that this is a good investment, is of course a completely different story :)