News for hackers. Stuff that matters.
Re:Magit, the magical Git interface (2017) by submeta on Friday October 22, 2021 @03:44AM (#28954607)
Magit is an exceptionally well made interface to Git. Yes, it’s built on top of Emacs, and that might stop many from even looking into it. - I am glad I made a deep dive into Emacs last year, and although I stopped using it as an IDE (VS Code is just too good), I still come back to it because of Magit (and macros, general text editing and org-mode). Yes, I have an interface for Git in VS Code as well, but it‘s very rudimentary compared to Magit, and it’s limited to the narrow left bar. And to give an example: Making „micro commits“ by staging various lines of changes is super easy in Magit, but I still haven‘t found out how to select several disconnected lines for staging in VS Code.
Re:Magit, the magical Git interface (2017) by kahole on Friday October 22, 2021 @04:11AM (#28954749)
You should check out edamagit, magit for vscode! https://github.com/kahole/edamagit
Re:Magit, the magical Git interface (2017) by jeremyjh on Friday October 22, 2021 @10:11AM (#28957391)
I just found this earlier this week and this as a key ingredient of VSpaceCode (Spacemacs bindings) enabled me to finally able to switch to VS Code for Elixir & Javascript programming, which has made me so much happier.
Re:Magit, the magical Git interface (2017) by ggregoire on Friday October 22, 2021 @11:06AM (#28958180)
> I still haven‘t found out how to select several disconnected lines for staging in VS Code.

In the Source Control window, select your file then in the right panel:

- Select the first range of lines

- Alt + select the second range of lines

- Cmd + Shift + P > "Git: Stage Selected Ranges"

or in multiple steps (I usually do it like that):

- Select the first range of lines

- Cmd + Shift + P > "Git: Stage Selected Ranges"

- Select the second range of lines

- Cmd + Shift + P > "Git: Stage Selected Ranges"

Re:Magit, the magical Git interface (2017) by pitaj on Friday October 22, 2021 @06:17PM (#28963459)
Or just right click on the selected lines and Stage Selected Range
Re:Magit, the magical Git interface (2017) by k4rli on Friday October 22, 2021 @06:33AM (#28955528)
VSCode with Gitlens is the best git GUI experience I've had. I prefer most operations via git cli, but for commiting partial changes and merge conflicts, it's everything I could ask for.
Re:Magit, the magical Git interface (2017) by piaste on Friday October 22, 2021 @09:43AM (#28957095)
I just discovered that GitLens has been acquired by GitKraken. Considering that GK's entire business is "buy our premium Git GUI because the free ones suck", I have to wonder if they'll try going to intentionally wreck the extension. Fortunately it's MIT licensed.
Re:Magit, the magical Git interface (2017) by IshKebab on Friday October 22, 2021 @07:59AM (#28956173)
I disagree. It's ok. But it doesn't even have a DAG viewer. What kind of GUI doesn't even have `git log --tree`?

Hopefully that's just because VSCode didn't allow arbitrary widgets until recently. Presumably they're working on it.

Re:Magit, the magical Git interface (2017) by piaste on Friday October 22, 2021 @09:42AM (#28957089)
Git Graph [0] already exists as a different extension from GitLens. It works quite well, although of course it would be nice if the two extensions could integrate with each other.

[0] https://marketplace.visualstudio.com/items?itemName=mhutchie...

Re:Magit, the magical Git interface (2017) by IshKebab on Friday October 22, 2021 @12:21PM (#28959126)
That looks nice! Yeah these things are so integral to development it would be nice if they were just core features of VSCode.
Re:Magit, the magical Git interface (2017) by stOneskull on Friday October 22, 2021 @09:31AM (#28956965)
i agree. vscode is my magic these days.
Re:Magit, the magical Git interface (2017) by smitty1e on Friday October 22, 2021 @04:25AM (#28954837)
Spacemacs.org brings the vi modal editing configuration to bear and is highly recommended.
Re:Magit, the magical Git interface (2017) by brabel on Friday October 22, 2021 @06:33AM (#28955533)
If you just want that you don't need spacemacs, just evil mode.
Re:Magit, the magical Git interface (2017) by smitty1e on Friday October 22, 2021 @07:23AM (#28955883)
Well, I physically cannot take the keystroke geometry if stock emacs for any stretch of time; the space bar approach is crucial for me.
Re:Magit, the magical Git interface (2017) by snicker7 on Friday October 22, 2021 @09:09AM (#28956769)
Evil mode supports leader keys. It’s pretty trivial to setup.
Re:Magit, the magical Git interface (2017) by Spivak on Friday October 22, 2021 @02:06PM (#28960491)
The real value of Spacemacs is which-key and having everything already configured with semantic leader key setups. Like you can absolutely do that yourself but at that point you're implementing Spacemacs.
Re:Magit, the magical Git interface (2017) by pault on Friday October 22, 2021 @04:57AM (#28955051)
Open the diff, select the lines, right click, "stage selected lines".
Re:Magit, the magical Git interface (2017) by submeta on Friday October 22, 2021 @04:59AM (#28955059)
But how do you select lines / changes spread all over the file? Doesn‘t work via Shift or Command click.
Re:Magit, the magical Git interface (2017) by pault on Friday October 22, 2021 @05:02AM (#28955085)
Actually it might require the gitlens extension. It's very well integrated and I've been using it for so long I don't know where one ends and the other begins. Regardless, if you open the diff view, the right hand side is editable and you can make selections like any other view.
Re:Magit, the magical Git interface (2017) by pitaj on Friday October 22, 2021 @06:18PM (#28963471)
You can either do it multiple times (my preference), or you can use Alt for multiple selections.
Re:Magit, the magical Git interface (2017) by dunefox on Friday October 22, 2021 @05:58AM (#28955365)
Have you used Git Lens yet?