Live data from Hacker News

Magit, the magical Git interface (2017)

emacsair.me

91–100 of 357 posts

Re: Magit, the magical Git interface (2017)

#91
post #64

Earlier quoted context omitted.

Magit is unfortunately so slow on Windows that it's unusable. This is a real shame, because the UI is fantastic. I think a better architecture would use libgit2 calls rather than launching multiple git processes for every single magit operation.

Is the launching of processes on Windows so much slower than on Unix-type OSes that it would cause it to be "so slow" for that reason? Maybe the reason is another? Personally, I once had Magit act real slow at times because git-annex had added some git hook for something that I didn't need. Just removing that hook improved performance massively. Perhaps something similar is happening. Also, I'm not sure Emacs Lisp ca…

I'm pretty sure it's the main reason. Look how many times Magit shells out to git to render the status buffer, too many to count: https://github.com/magit/magit/issues/1327

In a perfect world, Emacs would link to libgit2 and Magit would be adapted and folded into the core distribution.

Re: Magit, the magical Git interface (2017)

#92
post #59

I was pretty skeptical about magit at first because I know all the basic git commands for my daily workflows by heart and I don't find them to be very difficult or slow to use. But since I am also an Emacs user and everybody kept telling me to try it out I finally forced myself to use it. And I must say it is very easy to pickup and use productively. It is way better than most of the git integration features you get…

I find magit very nice for interactive rebases. The ability to instant fixup older commit is also nice.

But yes, I do drop to the shell for some actions when I know exactly the sequence of git commands that I need to execute. Also somehow I often use the shell to switch branches, some habits are hard to change.

Re: Magit, the magical Git interface (2017)

#93
post #43

Magit is such an unbelievably good piece of software. If you haven't used it, please at least take a look. It seems like "just a GUI for git", but that's missing the point — many operations suddenly become frictionless, so your entire workflow changes. I regularly do things like "stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one,…

Can I like magit if I don’t like emacs?

you can try https://github.com/jesseduffield/lazygit, i think its quite similar. It is a TUI for git. It has made my git workflow very friction-less. Makes it very easy to cherry-pick commits, rebases, selecting chunks of files to add in atomic commits, and simplifies the resolutions of merge conflicts. It is also integrated into lunar vim if vim is more up your alley

Re: Magit, the magical Git interface (2017)

#94
post #86
post #68

Earlier quoted context omitted.

Unfortunately, it's pretty slow on macOS, as well. I love Magit, but there are times when I feel like it's hindering me more than helping due to the performance.

I use it on a low spec MacBook Air, and it works just fine for me... never noticed any kind of slowness. I only work on Emacs in small projects though... so maybe that's why it's fast for me?!

Yes it will depend on repository size.

Re: Magit, the magical Git interface (2017)

#95

Earlier quoted context omitted.

Can I like magit if I don’t like emacs?

You can, but it will be worth it for you to spend a little effort to learn the basic buffer, window, and cursor management keystrokes. My 12 year old uses magit as a git interface and nothing else in emacs. That’s not a great testimonial as it was my direction to do that, but it seems to work just fine. The areas where magit earns outsized praise is not around a basic “pull, add and commit everything, push” workflow,…

> but rather around being selective about crafting self-consistent but single-theme revisions

Actually, I think git's got Magit beat on that. Magit might make it easier to stage specific lines, but git can stage specific parts of lines or even changes that are completely different than what's on the worktree, through the editing of diffs with `git add -p`'s `e` option.

Re: Magit, the magical Git interface (2017)

#96

For the sake of discussion, can we get some contrarian views? I'm using magit, along with tig, plain git and sometimes (!) even plain "vc", depending on context. I'm in the camp that thinks it's ok and it's pretty comfortable to use within emacs, but I don't see the earth shattering praise I see every time it's mentioned here. Tig for example is so much faster for history and blame perusal that I find it faster to ke…

Magit is unfortunately so slow on Windows that it's unusable. This is a real shame, because the UI is fantastic. I think a better architecture would use libgit2 calls rather than launching multiple git processes for every single magit operation.

Magit is not particularly fast on *nix either. Most of the UI operates on buffers which are prepared infrequently, so the latency doesn't have significant impact. This is a very good UI design for magit itself, since staying within emacs provides bigger benefits in most cases.

However, my own cited example about browsing history and blames is one case where I cannot just stomach the subpar efficiency. Tig also runs git as a subprocess, but every view is truly incremental and you can scroll through any buffer in any view and there's absolutely zero delay. Night and day even when comparing emacs with JIT.

Like for magit, tig has one keystroke shortcuts that make sense (which IMHO is pretty common on good TUI programs) and can perform many git operations directly from the spot you're looking at.

I also consider the visual space usage in tig to be much more efficient as well. Especially the blame view, which I find still wasteful in all modes compared to tig's. I frequently use a customized vc-annotate instead.

Magit hooks also considerably slow down operations on remote files, which can be quite annoying if you don't actively need to use git while editing.

Don't get me wrong - I like magit. But like org-mode, I don't get the glorification it gets.

Re: Magit, the magical Git interface (2017)

#97
post #46
post #34

Earlier quoted context omitted.

> Like how easy is it to selectively stage portions of files in the git CLI? git add -p Then you can decide if each hunk is staged or not.

In my experience magit version is much faster to use since you can simply select which lines you want to stage without having to refine the hunk.

Not even just lines - you can selectively stage arbitrary regions too.

Re: Magit, the magical Git interface (2017)

#98
I use git from the command line, so this looked like a tool i would use. I was able to install it with apt, but i could not find any information on how to run it. Manual says "C-x g" [1], which obviously does nothing in bash.

And I have no idea how to use emacs. Is there any helpful user manual? Should i give up on magit?

[1] https://magit.vc/manual/magit/Getting-Started.html

Re: Magit, the magical Git interface (2017)

#100
post #54
post #42

Earlier quoted context omitted.

Then this post may be more appropriate https://emacsair.me/2017/09/01/magit-walk-through/

Thank you for sharing. If the original post had included stuff from the one you sent, that would be a high-quality blog post worth reading.

On Magits homepage the articles are shared together as well https://magit.vc/
Post reply on HN