Live data from Hacker News

Magit, the magical Git interface (2017)

emacsair.me

151–160 of 357 posts

Re: Magit, the magical Git interface (2017)

#151

I love magit, I’ve been using it for a year, which is as long as I’ve been using Emacs. But can someone please tell me how to pronounce magit? If I try to make it sound like magic, I pronounce it the same way as maggot, which seems wrong. If I put the emphasis on the second syllable so that it’s emphasizing git, that also feels weird.

I started out saying "Majit" because it sounds less gross, but I think it's probably "Maggot" because it has Git in the name.

Re: Magit, the magical Git interface (2017)

#152

Earlier quoted context omitted.

> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…

What I dislike with git terminal UI is that commands reflect the innards of git, not what the user wants to do. It also forces a deeper understanding of the innards for basic commands than ought to be necessary. Examples where undoing an operation looks totally different to doing it: - To stage a change you `add` it, to unstage you `reset HEAD` - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The l…

“ - To commit you `commit`, to undo a commit you `reset --hard HEAD^`

The last example is also where you get pointed to an unsafe command”

Who pointed you there? If I want to undo my last commit, meaning the commit itself, not the changes to my file tree, shouldn’t I say `reset --soft`?

Re: Magit, the magical Git interface (2017)

#154
I've never seen the upside. I use Emacs as my primary editor, and I regret it every time I say "today is the day I start using Magit". It is exceedingly invasive, triggering itself even when you don't ask for it (like running "git rebase -i" on the command line). The invasive stuff changes how the text editing itself works, but doesn't add deep features. In the interactive rebase case, I lose the ability to treat the interactive rebase text as text, but I also don't gain anything. I can't just navigate around, kill a line, and put it somewhere else. Well, I can do that, but the usual keybindings don't work, they just made their own for no reason. And, for example, if I do use their UI and pick "reword" as the operation for a certain commit, I should be prompted for the desired rewording then and there, right? But that's not what happens, I press C-c C-c to commit my changes (why isn't it C-x # which is how I'd normally close an emacsclient session?), then Emacs goes away, then it comes back up, then I can type my rewording. If you pick it more than a few times, you just get a seizure from all the flashing lights. This isn't a good user interface. It's a bad user interface.

Obviously, my experience must be unique, because everyone loves Magit. It might be the most-loved piece of software ever. Every other week, there is an article on Hacker News about how it's the best piece of software ever to exist, and I've never seen anyone say anything bad about it. So I wonder what marketing techniques they use to make people feel this way; the emotions are strong, and widely shared.

Maybe there is some fundamental insecurity about Git, and Magit makes people comfortable? I've never felt that way, but I did start using Git the weekend it came out, and my Github user ID is in the low 2000s, so I might have had time to get Stockholm Syndrome with the Git UI. I suppose it's possible that the people writing these articles may not have even been born when Git came out, which is interesting to think about actually!

Re: Magit, the magical Git interface (2017)

#155
post #78
post #65

Earlier quoted context omitted.

> Commands are invoked, not by typing them out, but by pressing short mnemonic key sequences. It also sounds magical in the worst kind of way.

It's not magical. I forget commands all the time, then all I need to do is type `M-x` (to enter a command, like `Ctrl+P` in VSCode I think) and enter `magit ...` where I get auto-complete (if I do it often, I try to remember the keyboard shortcut, but that's optional). Also, while in magit, you can type `?` to see the list of available commands from the location where you're pointing at... the commands are single-let…

This is one of the things that makes Emacs one of the coolest pieces of software to me. 98% of the operations it can do, are defined in functions, which you can search for easily in the M-x pane with something like Helm, and boom. Even navigation. It's a near fully self-documenting editor that I rarely need to look up help on. Never forget how to activate an action again. Remember what the action is, type it, find the matching command that is aptly-named, push enter to run it. And, with Helm for example, it even shows the keybind next to it.

Re: Magit, the magical Git interface (2017)

#156

Earlier quoted context omitted.

> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…

What I dislike with git terminal UI is that commands reflect the innards of git, not what the user wants to do. It also forces a deeper understanding of the innards for basic commands than ought to be necessary. Examples where undoing an operation looks totally different to doing it: - To stage a change you `add` it, to unstage you `reset HEAD` - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The l…

"It also forces a deeper understanding of the innards for basic commands than ought to be necessary."

Glad you found something that works for you but this is definitely not true for all of us.

Re: Magit, the magical Git interface (2017)

#157
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,…

> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…

There is nothing wrong with using git commands in the terminal.

There is also nothing wrong with copying your entire tree to a different directory, diffing, applying patches by hand, and keeping track of what goes where.

Those are different levels of automation for the same fundamental task, but they are all legitimate solutions to the same problem, although you might end up spending more or less time to perform the same fundamental task, depending on the level of automation.

Re: Magit, the magical Git interface (2017)

#158
post #112

Earlier quoted context omitted.

I just called the status buffer from magit on a repo. It was 23 calls to git, mostly for rev-parse. The status buffer appeared instantaneously on a decade-old laptop. Whatever is causing the slowness you're seeing, I don't think it's just because of the number of calls. It's probably the slowness of one or two specific commands, perhaps due to repo size.

Are you testing on Windows though? I am specifically talking about Windows being the (biggest) problem with this architecture. It is very expensive to create new processes on Windows versus Unix (threads are cheaper on Windows though).

Another commenter said that they also experienced slowdowns on macOS, so I thought the OS actually didn't matter much on this, but based on disgruntledphd2's comment, I guess it does.

Re: Magit, the magical Git interface (2017)

#159

Earlier quoted context omitted.

What I dislike with git terminal UI is that commands reflect the innards of git, not what the user wants to do. It also forces a deeper understanding of the innards for basic commands than ought to be necessary. Examples where undoing an operation looks totally different to doing it: - To stage a change you `add` it, to unstage you `reset HEAD` - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The l…

“ - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The last example is also where you get pointed to an unsafe command” Who pointed you there? If I want to undo my last commit, meaning the commit itself, not the changes to my file tree, shouldn’t I say `reset --soft`?

My bad, misgoogled.

But this in fact reinforces my overall point. I don't want to be messing with `reset`, hard or soft. What is `reset`? [I now know because I had to learn, but I'd really rather not].

What I want is `uncommit`, or something like that.

Re: Magit, the magical Git interface (2017)

#160

Magit is insanely ergonomic. Like how easy is it to selectively stage portions of files in the git CLI? In magit it is usually just a few keystrokes. I wish magit-forge [0] had more features though - like I cannot create new labels from it. Please consider donating [1] to the developer if it has made your life any easier. [0] https://github.com/magit/forge [1] https://magit.vc/donate/

Does anyone actually do line-by-line staging using the CLI? That sounds masochistic. Most editors/GUIs make it very easy.

I always use `-p`. Its my default so its not 'more work'. Its the best way to get clean, atomic, history. It also lets me do things like mock out services or hardcode connection strings without having them accidentally exposed. I've had way too many accidental commits in the past to go back to full file add.

EDIT: also, it isnt 'line-by-line'. Its logical-chunk-by-logical-chunk. The algorithm will try to group local changes together and you need to explicitly tell it to split the chunk up if it is over eager.

Post reply on HN