Live data from Hacker News

A work-in-progress Magit clone for Neovim

github.com

21–30 of 80 posts

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

#21

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…

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 delete them with a full contextual overview, rather than sequentially.

If make multiple edits to different files before committing, this can be very useful to ensure that the commit makes sense, doesn't include logically unrelated changes, and so on. Or, if you follow a "commit early, commit often" approach, Magit's interface is also nice for restructuring those commits during a rebase/squash.

Perhaps it helps to think of commits as documents in their own right, as commits are effectively patch files, at which point it makes sense to use an editor to, well, edit them.

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

#22

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…

It's convenience and discoverability mainly. Usually a git operation in magit:

* Takes fewer keypresses - it has a very nice nested menu system based on single keypresses, which has been split out as "transient" and adopted by a number of other packages.

* Is easier to discover - I've learned of the existence of many things you can do with git by coming across them in the TUI (which is easier and more contextually relevant at any given time than reading the entire command line documentation)

* Generates less cognitive load - the set of available parameters and their default values is immediately visible, not buried in arcane man pages (which open in a separate web browser on Windows)

* Gives far richer and more interactive feedback - when reading the output of git log, the full contents of each commit is a single keypress away, as is checking out the commit in question; code can be blamed in the editor with syntax highlighting; conflicts can be resolved similarly and opened in ediff with a keypress; files and individual hunks can be staged/unstaged with a single keypress when viewing status, etc, etc.

The convenience and completeness of this has been so great that I've not felt the need to memorise the git CLI beyond the absolute basics. To turn the question around, is there any reason I should? Performance is the biggest bugbear, but hasn't been a dealbreaker for me, despite being on Windows most of the time (I've recently started using lazygit to perform simple operations more quickly, though).

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

#24

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…

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 objectively better in all ways - it depends on your values.

For me the most valued aspect is return on my investment for learning a tool... official git cli porcelain will be around for a _long_ time, it's available almost everywhere, it gives the most power and flexibility, I can combine it with all kinds of things for new problems - Magit (or otherwise) exists in a much narrower context, I know it's probably only a subset of git porcelain to smooth over the staging and committing etc, but I prefer to stay familiar with git cli... Perhaps more critically, I've already mastered 95% of the official git cli porcelain and then some, so I suppose from my perspective my return on investment for using yet another git porcelain feels fairly low, even for the specific case of staging, i've done it so much it's second nature, and I'm generally comfortable with the serial nature of globing files over the CLI.

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

#25

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 agree when it comes with cluttered UIs in main editors, but this is different.

Having a keystrokes based git interface can be a breeze. I was using GitSavvy in sublime text and it was just amazing.

You can handle annoying operations in milliseconds when you get used. And never the shell can give you that.

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

#27

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…

magit with emacs: C-x g, c c y, C-c C-c

git over command line: Alt + Tab(shell), git commit -a -m "" RET

You see the problem. Even assuming the message is short and typed on the command line without invoking the editor, the number of keystrokes is more. Of course number of keystrokes is a minor thing, when you compare rebase and other operations.

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

#28

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…

> 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 nice info in the other buffers. I use it for "git submodule update --init --recursive" for example.

I have seen people struggling with git log and understanding which commit is on which branch and all that. Of course you can use something like "git log --decorate --graph --color --oneline --all" or even alias that. In magit I do: "mag-stat" (Emacs completes this to "magit-status") which one does usually anyway, to see where the repository is at and whether there are uncommited changes and so on. When I need the graph, I do: "mag-log" "-" "c" "b". Then I can go to any line in the graph and check it out, because it becomes the default for when I type "mag-check" (completed to magit-checkout) and press RET. On command line I would be copying commit ids and branch names and would remember to use my alias for the long git log command.

Edit: Another great feature is how easy it is to commit only some hunks, instead of everything that has changed. Commiting hunks on command line is tedious afaik. You would have to specify row numbers.

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

#29

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…

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.

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

#30
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…

emacs predates git by decades and probably will outlast it. While magit is not emacs it is reasonable to expect that it will be maintained by someone for a long time.
Post reply on HN