Hacker News new | past | comments | ask | show | jobs | submit login

> Like how easy is it to selectively stage portions of files in the git CLI?

It’s not hard (`git add -p`) unless you need line-wise selection.

The main issue in my experience is that it’s completely linear so you need perfect memory and to never make any mistakes: git shows each hunk individually and tells you to make your choice before it shows the next, no take-backs.

Magit shows the entire diff and lets you jump around, and selectively unstaging is just a “d s” away.




>not hard[...] you need perfect memory and to never make any mistake

As someone without perfect memory and makes mistakes, I consider git add -p ergonomics very user unfriendly. But I guess that's your point :)

I also routinely use line-wise selection and often revert unnecessary lines when crafting the index.


I very often do line wise selection with magit, so that my commits are atomic and single-topic.


I think 'git reset -p' lets you unstage a selection, and I'd use '/' in both searching for the chunk to unstage and to continue where I left off.


> I think 'git reset -p' lets you unstage a selection

That requires finishing the current staging, moving to unstaging, processing the unstaging (also a linear hunk-wise process), restarting the ataging, and remembering to skip the stuff you’d mistakenly staged.

The workflow of magit is much easier here, and the staging / unstaging integrates very well with reviewing the local or staged diff. Crafting good commits has way less friction and error recovery is much better.


Importantly, and this is why Emacs users tend to love Magit, the workflow integrates well with rest of Emacs. Your staging and diff buffers are just that - Emacs buffers. Meaning all your quality-of-life configurations and extensions are available as well.

For example, the fact that you can just jump around the buffer and stage/unstage things as you go, means you're free to use whatever you most like for that "jumping around" part. Incremental search? Sure. Ace-jump? Yes. M-x occur? If you must.

Magit on a bare-bones Emacs is extremely ergonomic on its own, but if you use and adapt Emacs for yourself, all the improvements compound on each other.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: