Live data from Hacker News

A work-in-progress Magit clone for Neovim

github.com

41–50 of 80 posts

Re: A work-in-progress Magit clone for Neovim

#41
post #13

Although I'm a heavy Emacs user, I never understood why is magit so praised. IMHO, source control just doesn't belong to IDE. Why learn how to use git with Emacs/magit, vim, IntelliJ IDEA, Eclipse, Visual Studio / Code, ... when you can just master the official command line client and forget about the rest? It's available and usable everywhere, while each of these IDE plugins is different and one need to learn and ge…

In general I agree, but one thing I've never learned is resolving merge conflicts in the CLI. I've always just used IDEA's merge resolution tools. Does CLI git provide any tools to help with merging?

You resolve conflicts by staging the resolution and then continuing (rebase) or committing the result (merge, cherry pick). I generally just use git citool/gui for staging my resolutions, which I make in whatever editor I fancy.

Re: A work-in-progress Magit clone for Neovim

#42

Although I'm a heavy Emacs user, I never understood why is magit so praised. IMHO, source control just doesn't belong to IDE. Why learn how to use git with Emacs/magit, vim, IntelliJ IDEA, Eclipse, Visual Studio / Code, ... when you can just master the official command line client and forget about the rest? It's available and usable everywhere, while each of these IDE plugins is different and one need to learn and ge…

>Although I'm a heavy Emacs user, I never understood why is magit so praised. IMHO, source control just doesn't belong to IDE.

Well, then there are two things you never understood, the second being that source control totally belongs to an IDE :)

>Why learn how to use git with Emacs/magit, vim, IntelliJ IDEA, Eclipse, Visual Studio / Code, ... when you can just master the official command line client and forget about the rest

(1) Because you don't want the mental switch.

(2) Because you get better and more immediate visibility (from changed file markers to inline diff).

(3) Because you can do things faster (e.g. right click a file and chose "show file history" or "compare with version...").

(4) Because you can use the same shortcuts, scripting, and other facilities you use elsewhere in the IDE to work with your SCM

(5) Because it has immensely better discoverability (cli discoverability being usually low, with git flags being much worse than the typical case).

and several more reasons besides...

Not to mention that the very same (non-)argument could be said against running your build from the IDE, for doing debug in the IDE ("just master GDB, etc."), for searching on the IDE ("just use grep"), and so on...

Re: A work-in-progress Magit clone for Neovim

#43
post #40

Earlier quoted context omitted.

> Why learn how to use git with Emacs/magit, vim, IntelliJ IDEA, Eclipse, Visual Studio / Code, ... when you can just master the official command line client and forget about the rest? Because it is faster, has great visualization and most importantly magit has great fallbacks. You can still use the command line from magit! Pressing "!!" in a magit-status buffer will get you there, while still showing you all the nic…

> Commiting hunks on command line is tedious afaik. You would have to specify row numbers. Not necessarily tedious - you can just use "git add -p" to stage hunks individually.

In Magit you can easily select arbitrary regions of code to stage (or chunks as you would via the command line). I haven't seen any git interface that is as intuitive for this task.

Re: A work-in-progress Magit clone for Neovim

#44

Earlier quoted context omitted.

I've started using lazygit for simple operations on Windows as magit can be slooooow there. I fall back to magit where needed. Initial impression is that lazygit is much less mature and complete than magit. There's essentially nothing git can do that I can't make it do via magit. Lazygit in comparison is quite limited, often dropping out of the TUI to the command line to perform operations the TUI can't represent or…

If you run Emacs on WSL it is way faster. Creating processes on Windows is more expensive compared to Linux. And magit suffers. You can use a Windows X11 server for the GUI, but I think (?) there is native support for running GUI apps these days.

I've tried it but it's unfortunately not viable for my use. The (large) codebase needs to be in an ntfs filesystem for reasons beyond my control. With WSL1 the process startup is even slower than starting windows git and with WSL2 the process startup is fast but the filesystem access is slow. In both cases it ends up much slower even than native windows git.

Re: A work-in-progress Magit clone for Neovim

#46
post #40

Earlier quoted context omitted.

> Why learn how to use git with Emacs/magit, vim, IntelliJ IDEA, Eclipse, Visual Studio / Code, ... when you can just master the official command line client and forget about the rest? Because it is faster, has great visualization and most importantly magit has great fallbacks. You can still use the command line from magit! Pressing "!!" in a magit-status buffer will get you there, while still showing you all the nic…

> Commiting hunks on command line is tedious afaik. You would have to specify row numbers. Not necessarily tedious - you can just use "git add -p" to stage hunks individually.

`git add -p` is nice, but Magit's UI is superior, IMO.

I don't know a way to stage individual lines from a given hunk separately in Git's interactive add, but in Magit's that's easy - just select the line you want and press s.

I've even occasionally staged part of a line via selection, when I've actually had two distinct bugfixes on the same line.

Re: A work-in-progress Magit clone for Neovim

#47
post #24

Earlier quoted context omitted.

For me, Magit's killer feature is that it provides something equivalent to "git add --interactive" but with a much nicer UI. If you're interactively adding things to a commit then you are effectively editing a text file, and that's always going to be easier in a proper text editor than on the command line. Magit can show you all of the hunks that can be staged simultaneously, allowing you to choose, split, edit, and…

I think your argument pretty much boils down to the same as for most GUI vs CLI arguments: parallel vs serial, intuitive vs abstract etc... but it all comes at a cost, less flexibility, less power, more complexity, less combinability (less unixy). Just saying, the argument is the same as for any other GUI version of a particular CLI tool, and so it's inevitable we end up with an opinionated divide, because it's not o…

I felt exactly like you do for years before I finally learned Magit - as a competent CLI user, most of the Git GUIs I'd poked at were frustratingly limited and seemed worse than pointless for someone who had gotten a handle on the Git CLI.

Once I took a little while to learn Magit, it significantly reduced the number of keystrokes I needed for normal git operations.

It also made rebasing less of a chore in several ways.

It's still a bit of a tossup whether I'll use the terminal UI or Magit for a given operation, depending if I'm already in the terminal, but unlike most GUIs, I've found Magit actually reduced my friction for day-to-day work relative to the Git CLI.

Re: A work-in-progress Magit clone for Neovim

#48

Although I'm a heavy Emacs user, I never understood why is magit so praised. IMHO, source control just doesn't belong to IDE. Why learn how to use git with Emacs/magit, vim, IntelliJ IDEA, Eclipse, Visual Studio / Code, ... when you can just master the official command line client and forget about the rest? It's available and usable everywhere, while each of these IDE plugins is different and one need to learn and ge…

I'm with you. I've tried a number of VCS "clients" and most of them are pretty bad, have poor defaults, encourage poor workflows, don't really understand how git works, and consequentially, frequently break down or run into situations the UI cannot handle. I always tell people to stick to the offical git tools (git CLI, git-gui, gitk). They upper-case Work. They understand git's model, unlike generic VCS frontends. T…

Yep, I have this frustration with most Git GUIs too.

I've not found that they apply to Magit.

That may just be that most Magit users are also heavy CLI users, though.

Re: A work-in-progress Magit clone for Neovim

#49
post #11
post #3

Magit is a git porcelain inside emacs: https://magit.vc/

Thanks. Can't say I'm surprised of developers not including relevant links on their readme page.

To me this just says that they assume magit is so well known that everyone knows what they are referring to.

Re: A work-in-progress Magit clone for Neovim

#50

Earlier quoted context omitted.

The killer feature for me on IntelliJ Idea Git is: * that I can reorder the (local) commits * mark with the mouse and right-click to squash them No other git tool I know has these features.

magit does similar things with interactive rebases, although it is keyboard driven (I never tried to use the mouse). Another nice feature is the instant fixup where you can easily commit+rebase+fixup (think of commit --amend, but against any commit).

FYI, command-line Git is where fixup and autosquash come from:

https://blog.sebastian-daschner.com/entries/git-commit-fixup...

Magit makes the feature easier to use and more discoverable, though.

Post reply on HN