3 ms·
Why? I use git add -p absolutely all the time, its really simple to learn
by dgellow 3y ago
Why? I use git add -p absolutely all the time, its really simple to learn
- arcanemachiner 3y agoUse lazygit, it's faster.
- mstade 3y agoMe too, in fact I find it much easier to do with the terminal than a GUI.
- werdnapk 3y agoI use `git add -p` regardless if the whole file gets committed or not since I use it as a visual review tool to verify what I've changed.
- mksybr 3y agoTIL from another story on HN: commit.verbose true This adds the whole commit diff in the text editor where you’re writing your commit message, to help you remember what you were doing. https://jvns.ca/blog/2024/02/16/popular-git-config-options/#commit-verbose-true https://jvns.ca/blog/2024/02/16/popular-git-config-options/#...
- sodapopcan 3y agoIt's not the only sane way, it's just what IDE zealots say... even though you don't even need an IDE to do it the "IDE way". There are plugins to highlight and stage diffs in most text editors. Regardless I also really like `git add -p`. I don't use it often but it really makes me focus on and consider each hunk. It was the defacto way to do it at an old company I worked at and no, it was not a small startup "hipster" company, we built enterprise ERP software.
- n4r9 3y agoAlso use git add -p frequently. I can't understand why people are even discussing using other tools.
- IshKebab 3y agoIt's because other tools are much better.
- n4r9 3y agoMaybe for some people? git add -p does everything I need, directly from the terminal which is where I use git already. It's also super fast, the only limit being how quickly I can parse each hunk and type "y enter" or "n enter". Very occasionally I want to split a hunk up more than it allows, but it's easy to work around.
- iraqmtpizza 3y ago(1/1) Stage this hunk [y,n,q,a,d,s,e,?]? (2/5) Stage this hunk [y,n,q,a,d,K,j,J,g,/,e,?]? Wow, so intuitive! LOL. You really showed him. This UX is laughably bad. It presents you every hunk, one at a time, without context, and if you want to include some lines and not others, you can't unless all the sub-hunks are exactly one line or you let it launch a text editor and you dick around in the raw diff which is its own domain-specific language. Why don't people play starcraft like this? (1/1) Move this zergling [u,d,l,r,b,a,J,g,/,e?]? The fact that this needs a write-up and discussion is all you need to know. Where is the big how-to for committing partial files in GitHub Desktop? Oh, yeah, nobody needs one because it's obvious and right in front of your face. If you have no limbs and can't use a mouse to click on things then this UI is great though.
- dgellow 3y agoIt’s really easy to learn: one of the option is ‘?’, try it out, it will give you more explanation. The ‘s’ to split changes is one of my favorite feature. It takes a few minutes to get used to it, then becomes automatic: add the whole file ‘a’, skip file ‘d’, skip chunk ‘n’, stage chunk ‘y’, split ‘s’, stop here ‘q’, rollback ctrl-c. The “chunk per chunk” approach is actually really nice, you’re focusing on what exactly you want to get your commit to be about. You learn it once, that will never change, you’re set for decades.
- iraqmtpizza 3y agoIt's really easy to learn how to use a slot machine too. Or dwarf fortress. It's not productive -- it's a hobby at best. EDIT: You have extremely low standards for what constitutes a professional tool these days. You also didn't address my point. split is brain damaged and doesn't work: + assertEquals(byte[].class, p.get0().getClass()); + assertEquals(String.class, p.get1().getClass()); You try to split this hunk and it won't do it. This task is beyond trivial in any non-retarded GUI. -p makes you more productive because you don't know how to use an electron app or Java app
- dgellow 3y ago