News for hackers. Stuff that matters.
Re:The values of Emacs, the Neovim revolution, and the VSCod... by aldanor on Sunday January 17, 2021 @10:07AM (#25811224)
Same here in regards to Magit. I've tried seriously using Emacs (Spacemacs) for a year or two, but something always doesn't work as intended, code completion and static analysis is extremely hard to configure, especially you have some non-standard project setups. Then switched to a mix of vim for simple stuff or clion/pycharm in vim mode for rust/cpp/python... BUT, subjectively, Magit is the best git client ever created; Magit in evil-mode easily beats all of the 20+ git clients I've used. So I keep emacs/spacemacs on every machine now solely to be able to use magit.
Re:The values of Emacs, the Neovim revolution, and the VSCod... by beojan on Sunday January 17, 2021 @10:17AM (#25811322)
Try Doom Emacs (https://github.com/hlissner/doom-emacs) instead of Spacemacs. It's much lighter weight and doesn't replace the configuration system to nearly the extent Spacemacs does.
Re:The values of Emacs, the Neovim revolution, and the VSCod... by slightwinder on Sunday January 17, 2021 @10:57AM (#25811709)
Doom is not really better than spacemacs. It's just the same pain in a different flavor. Sure, in the micro-cosm of emacs it's pretty good, but in the macro-cosm it's still a pain and can't lift the limitations and problems of emacs.
Re:The values of Emacs, the Neovim revolution, and the VSCod... by moocowtruck on Sunday January 17, 2021 @11:18AM (#25811935)
sincerely curious, what are the limitations and problems of emacs? I use both vs code and emacs. I've been using vs code a bit more these days because I feel like the UI itself is a bit more powerful and modern. I've also come to like that If i want a language support it often installs all the things I'd want to make a good experience, and I have less to mix and match. I like the mix and match approach I've always used in emacs, but it turns out there fewer scenario where I want that power then I'd have thought, and more where I just want some out of the box functionality from an extension author
Re:The values of Emacs, the Neovim revolution, and the VSCod... by perryizgr8 on Sunday January 17, 2021 @11:21AM (#25811971)
Why do you need to use a git "client"? What's wrong with just using the standard CLI? I use VS code and never bother with its git ui. Just open a terminal and use git commands.
Re:The values of Emacs, the Neovim revolution, and the VSCod... by kubanczyk on Sunday January 17, 2021 @12:19PM (#25812565)
Git CLI is fantástico if you want to do two things per hour. If you want to do twenty, it's just too many keystrokes. Even if we only talk basic add/commit/push.

Two especially laborious operations are `git add -p` and `git rebase -i`. Try them out on magit, you'll see the difference.

Re:The values of Emacs, the Neovim revolution, and the VSCod... by hawski on Sunday January 17, 2021 @04:04PM (#25814943)
git gui is way to go.
Re:The values of Emacs, the Neovim revolution, and the VSCod... by submeta on Sunday January 17, 2021 @01:27PM (#25813342)
How do you selectively stage several hunks from command line in git? - Imagine you edited a large file, fixed two different things, now you‘d like to select the changes related to one thing first and commit them. And then the next changes.

In Magit you visit the file you changed, hit `C-x g' and see all diffs. Now you can review and select hunks by hitting „s“ (stage), go to the next relevant hunk and hit „s“ again to mark for staging. And when you‘re done selecting all changes that are relevant for one ticket, you hit „c“ twice to write a commit message. And off to the modifications/ hunks regarding second ticket.

So how‘d you do this in command line?

Re:The values of Emacs, the Neovim revolution, and the VSCod... by psYchotic on Sunday January 17, 2021 @01:47PM (#25813567)
This may have been semirecently been added to git, but look into [0]: git add -i It launches a fairly simple interactive text UI that allows you to select files to stage, and it allows one to "patch" into the staging area, which works by showing you a bunch of hunks, asking for each if you want to stage it (or you can even edit a hunk in your $EDITOR).

I'm sure it's not nearly as nice as Magit's UI, but I've been a happy user of this feature for a while.

[0]: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging

Re:The values of Emacs, the Neovim revolution, and the VSCod... by codethief on Sunday January 17, 2021 @01:33PM (#25813424)
How about

$ git add -p path/to/the/file

?

Combine this with your favorite tool for command line auto-completion of paths (and, maybe, a git alias to avoid typing `git add -p` all the time) and it's extremely fast.

Re:The values of Emacs, the Neovim revolution, and the VSCod... by submeta on Sunday January 17, 2021 @01:49PM (#25813592)
I am presented with one hunk at a time, and have to decide if I want to stage or not (with a text "menu" underneath it: "(2/2) Stage this hunk [y,n,q,a,d,k,K,g,/,e,?]?"

And then I navigate with j/k (down/up).

Yes, it does the job. Matter of preference.

But if you worked eagerly on three / four different topics and try next to create several different commits by getting a visual overview of all hunks with the abilitiy to selectively stage is a little more comfortable.

Re:The values of Emacs, the Neovim revolution, and the VSCod... by nickjj on Sunday January 17, 2021 @02:33PM (#25814051)
If you have multiple files then you can choose to omit the file name and git will let you decide on each hunk for each file.

You can also hit "s" to split a hunk to only commit a part of a hunk of if you want fine grained control you can hit "e" to edit just that hunk in your $EDITOR to only select a specific line or whatever you want.

Personally I tried fugitive and other git clients in the past and always come back to git add -p on the command line. It just feels the most natural and it also forces you to look at the hunks, so there's really no chance you'll accidentally forget to add something.

When using GUIs with sidebars showing what files changed, etc. it's easy to forget to add something because you skim it without really paying attention to what was changed.

Re:The values of Emacs, the Neovim revolution, and the VSCod... by akho on Sunday January 17, 2021 @02:16PM (#25813886)
Try Magit. You’ll know whether it works for you. It clearly does for many people.

Or fugitive in Vim.

The difference is like that between using Ed and Vi. Seeing things as you do them is valuable.

Re:The values of Emacs, the Neovim revolution, and the VSCod... by jidiculous on Friday January 22, 2021 @09:11PM (#25878870)
imo the strength of Magit (and its author has certainly said so) is that while the Git CLI provides a slightly different interface that you have to learn for each different operation, Magit provides a consistent UI for every single Git operation it supports (around 90% of Git features).
Re:The values of Emacs, the Neovim revolution, and the VSCod... by ttt0 on Sunday January 17, 2021 @12:32PM (#25812714)
Nothing's wrong with using CLI. You might not need it, but sometimes it's nice to have something with more. Most people on this planet think that managing files from terminal is pure insanity, and I do just that, I didn't even bothered to install a graphical file manager. And yet I use a git client/front-end in my text editor, because it's nicer to do some things that way. The most useful feature is probably interactively staging hunks just like you'd edit a text file over what standard git does.