I find splitting hunks a pain. I wish I could just split by line, would be a great feature.
Sublime Merge for the win; a fantastic visual interface with context and reversible inputs. Don't leave home without it!
21–30 of 54 posts
I find splitting hunks a pain. I wish I could just split by line, would be a great feature.
Sublime Merge for the win; a fantastic visual interface with context and reversible inputs. Don't leave home without it!
Magit allows selective staging/unstaging, either of hunks, or by selecting lines (AKA Emacs's "region"). I avoid staging from the git commandline, unless I'm just doing whole files. PS: Majutsu provides this too (a magit-like tool for jj)
My biggest problem with `add -p` is correcting any patches I added or rejected by accident. Often times I skip through dozens of things I don’t want to add, then realized that last hunk was something I did need. But I can’t re-visit it, I have to start over and try extra hard to not skip past it again. I wish the j and k shortcuts could revisit hunks I’ve already added/rejected, not just ones I haven’t reviewed yet.…
Magit allows selective staging/unstaging, either of hunks, or by selecting lines (AKA Emacs's "region"). I avoid staging from the git commandline, unless I'm just doing whole files. PS: Majutsu provides this too (a magit-like tool for jj)
Neogit, Magit inspired, does the same for Neovim. Would recommend!
My biggest problem with `add -p` is correcting any patches I added or rejected by accident. Often times I skip through dozens of things I don’t want to add, then realized that last hunk was something I did need. But I can’t re-visit it, I have to start over and try extra hard to not skip past it again. I wish the j and k shortcuts could revisit hunks I’ve already added/rejected, not just ones I haven’t reviewed yet.…
> If you’re not already using git add -p to stage your commits then you’re missing out. After switching to jujutsu, I assure you I don't miss this feature. jj takes the opposite approach. It keeps staging things, and you use split whenever you want to separate things out. (And yes, it stores the staged changes as revisions, so you can always back out to a previous staged state).
You can use `git reset -p` to selectively unstage hunks the same way if you wanted to.
Magit allows selective staging/unstaging, either of hunks, or by selecting lines (AKA Emacs's "region"). I avoid staging from the git commandline, unless I'm just doing whole files. PS: Majutsu provides this too (a magit-like tool for jj)
Magit allows selective staging/unstaging, either of hunks, or by selecting lines (AKA Emacs's "region"). I avoid staging from the git commandline, unless I'm just doing whole files. PS: Majutsu provides this too (a magit-like tool for jj)
It releases me from having to have the "discipline" to stay 100% focused on the broader task at hand and say "hmm, I should fix that while I'm here", without co-mingling purposefully different commits.
Truly fantastic. Absurdly, I have no idea how to do this on the command line, though presumably it is possible from there too (just a lot, lot less convenient).