4 ms·
For making commits, does anyone else still stick with using git add -p , along with the s/e options? Granted I don't use Emacs but I haven't found any plugin i
by nickjj 6y ago
For making commits, does anyone else still stick with using git add -p , along with the s/e options?
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.
- nicoburns 6y agoAdvanced committing (hunk level) is the one thing I use a GUI for. Sublime merge is pretty ideal for this as it opens instantly, and you can open it from the command line with the `smerge` command.
- nickjj 6y ago> Advanced committing (hunk level) is the one thing I use a GUI for. 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.
- nicoburns 6y agoYeah, I know you can do that. It's just that while I prefer the CLI for most tasks, I find it's much easier to do hunk selection using a GUI.
- barrkel 6y agomagit lets you stage each hunk, or if you want finer grained control, simply select the lines you want to commit or exclude and it will just stage / unstage those lines. It's better than editing a patch file; it's much better than `git add -i`.
- heavenlyblue 6y agoSublime merge looks great, but it costs quite close to what I would be paying for a full IDEA licence yearly: $100? This is ridiculous.
- emptysea 6y agoIt's a one time fee and IMHO is totally worth it. 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.
- wodenokoto 6y agoIt is ridiculously expensive, until you realize that a professional software engineer quite often cost a company more than $100/hour 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 :)
- ryukafalz 6y agoNot sure about other editors, but Magit's hunk- and line-level staging/unstaging is hard to beat, IMO. 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 https://www.youtube.com/watch?v=rzQEIRRJ2T0
- thom 6y agoAnd of course you can select an arbitrary region to stage if you like.
- reegnz 6y agoI regularly use git add -p. Also git rebase -i. 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/ https://jonas.github.io/tig/ sometimes.