Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use magit in emacs and I can create any commit I want by slicing out a bunch of characters in a diff.

The git CLI is workable for a lot of things,but the experience of higlighting an arbitrary block of text and saying "commit THIS" has not been matched in any other git UI. We're not talking about hunks or lines here, but literally committing an abitrary range of characters.



> committing an abitrary range of characters

Honest question: what is the practical use case for this? I'm a fan of small, atomic commits but I don't recall ever wanting to commit just a range of characters.


It could be useful for changes in CSV files or text files with table-like formatting where you want to commit the change in just one specific column of a row, but not the other. I could also see it for binary files which aren't structured into lines.


I use it quite a lot to stage a subset of a change, and then drop the rest of it. In that sense, it's like an overpowered undo tool that helps me keep a change I want without having to rewrite the whole thing.




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

Search: