Live data from Hacker News

A work-in-progress Magit clone for Neovim

github.com

31–40 of 80 posts

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

#31

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.

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).

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

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

You're assuming magit is less flexible than the command line porcelain, but it's not materially so afaik. It's pretty complete and claims to be the only actual "porcelain" besides the cli. I've certainly never encountered an operation I couldn't perform in magit.

Edit: the relevant claim from the docs is

> Magit is an interface to the version control system Git, implemented as an Emacs package. Magit aspires to be a complete Git porcelain. While we cannot (yet) claim that Magit wraps and improves upon each and every Git command, it is complete enough to allow even experienced Git users to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains.

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

#33

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 in Emacs/vim? Because I am already in there staring at text and it's less of a context switch than switching desktops/windows/tabs.

Why not just use cli? I definitely champion _knowing_ cli git for when you need it, but at some point the standard workflows become tedious with the amount of typing required, even using shorthand.

magit provides some super accessible and efficient workflows when paired with e.g. doom-emacs or similar mnemonic keybinds.

Other have mentioned the equivalent of git add -p and believe me using vim's visual selection instead of manually editing out that one line of the patch is a breeze.

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

#34
Very early on in my vim journey, I used to use fugitive[1], which is sort of a lighter equivalent of magit for vim. However, I found that too overkill and unwieldy. I never really found any benefits to forcing myself to stay inside vim to run some git command.

These days, I just use git in a tmux split rather than trying to force vim to show some arbitrary git UI. For a nice interactive git UI, I use tig[1]. Tig is essentially like fugitive/magic insofar as it allows me to interactively view a nice graphical log, stage/commit, traverse a file's historical blame, etc. It's a nicer UI compared to something like `gitk`.

I have these mappings in my `~/.vim/vimrc` for git/tig functionalities:

    nnoremap gb :echo system('git rev-parse --abbrev-ref @  tr -d "\n"')
    nnoremap gB :silent !tig blame =shellescape(expand("%")) +=expand(line('.')):silent redraw!
    nnoremap gO :silent !tig:silent redraw!

[1]: https://github.com/tpope/vim-fugitive

[2]: https://github.com/jonas/tig

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

#35

As a vim user, I'm using lazygit[1] for handling git operations. What am I missing w.r.t a EMACS+Magit workflow? [1]: https://github.com/jesseduffield/lazygit

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.

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

#37

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. The GUIs are not the best-looking in the world, but very efficient and fast. Lots stick to IDE integrations and don't then don't know how to help themselves if those break, which they frequently do. "I'll just delete my repository and clone again"...

Asides from actually working, which many of the other tools don't really, git's stuff is available everywhere you have git, and also works the same way everywhere.

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

#38
post #19

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…

> ... when you can just master the official command line client and forget about the rest? I generally agree, I want the full git interface, which is available everywhere and has no limitations and is not bound to a particular editor. There is however one area I do find useful to have integrated into an editor, various kinds of code annotations... e.g gitgutter, I use this in vim - these type of features compliment g…

Magit has a blame annotation mode, no gitgutter, although there's an unrelated emacs port of that one.

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

#39

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…

You mean the git cli often acclaimed for it's poor ergonomics? In any case, Magit is great for two things: easy to use and learn, and interactive features. If you made two separate changes in a single file, you might want to have them on different commits. Doing that on the CLI is tedious at best. Magit makes doing things like that trivial, which results in better commit hygiene.

git cli has great ergonomics because almost everything is quite straightforward to do.

git cli is confusing, because commands are not orthogonal and flags often change behavior drastically. "git checkout 1.2-dev" checks a branch out, "git checkout src/AceGraph.cpp" checks a file out (i.e. reverts it to checked in state), "git checkout -b feature1234" creates a new branch. These are all ergonomic (easy to use and remember), but also confusing commands (why does git-checkout do three different things depending on arguments?).

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

#40

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 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.

Post reply on HN