Live data from Hacker News

Magit, the magical Git interface (2017)

emacsair.me

121–130 of 357 posts

Re: Magit, the magical Git interface (2017)

#121
post #95

Earlier quoted context omitted.

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.

I'm somewhat convinced you can replicate that last feature (staging arbitrary / sub-line pieces of your changes) through ediff-staging (E s), but ediff is a complex tool in itself, and I don't know how to use it properly yet.

(Ediff is a 2-way / 3-way interactive diffing interface, built into Emacs, with plenty of features for surgical diffing of files, buffers, directories and whatnot.)

Re: Magit, the magical Git interface (2017)

#122
post #81

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…

I get the same impression using org mode vs hearing people talk about it. It's great! but the way it's talked about makes you think it will change your life and finally stop you being a lazy procrastinating fool. It's very cool and flexible and doesn't tie you in to any big tech provider (yay!), but it's just an outliner at the end of the day.

I like org mode, I use it every single day, and I'd agree most of the time. 9/10 I'm using it as a glorified markdown editor, but on that 1/10 occasion where I get to do something really cool is where it feels magical.

Re: Magit, the magical Git interface (2017)

#123

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.

Re: Magit, the magical Git interface (2017)

#125
post #74
post #9

Magit is an exceptionally well made interface to Git. Yes, it’s built on top of Emacs, and that might stop many from even looking into it. - I am glad I made a deep dive into Emacs last year, and although I stopped using it as an IDE (VS Code is just too good), I still come back to it because of Magit (and macros, general text editing and org-mode). Yes, I have an interface for Git in VS Code as well, but it‘s very r…

VSCode with Gitlens is the best git GUI experience I've had. I prefer most operations via git cli, but for commiting partial changes and merge conflicts, it's everything I could ask for.

I disagree. It's ok. But it doesn't even have a DAG viewer. What kind of GUI doesn't even have `git log --tree`?

Hopefully that's just because VSCode didn't allow arbitrary widgets until recently. Presumably they're working on it.

Re: Magit, the magical Git interface (2017)

#126

Earlier quoted context omitted.

I think 'git reset -p' lets you unstage a selection, and I'd use '/' in both searching for the chunk to unstage and to continue where I left off.

> I think 'git reset -p' lets you unstage a selection That requires finishing the current staging, moving to unstaging, processing the unstaging (also a linear hunk-wise process), restarting the ataging, and remembering to skip the stuff you’d mistakenly staged. The workflow of magit is much easier here, and the staging / unstaging integrates very well with reviewing the local or staged diff. Crafting good commits ha…

Importantly, and this is why Emacs users tend to love Magit, the workflow integrates well with rest of Emacs. Your staging and diff buffers are just that - Emacs buffers. Meaning all your quality-of-life configurations and extensions are available as well.

For example, the fact that you can just jump around the buffer and stage/unstage things as you go, means you're free to use whatever you most like for that "jumping around" part. Incremental search? Sure. Ace-jump? Yes. M-x occur? If you must.

Magit on a bare-bones Emacs is extremely ergonomic on its own, but if you use and adapt Emacs for yourself, all the improvements compound on each other.

Re: Magit, the magical Git interface (2017)

#127
post #118

Earlier quoted context omitted.

> I'd rather learn that, as it's a more portable skill, than learn another UI, that relies on emacs and a package installed FWIW, most Magit commands have 1:1 correspondence with git commands; when I'm worried I'm doing something with Magit that I wouldn't be able to replicate with CLI, I just press '$' to pop up the "process buffer", i.e. the buffer containing actual git commands being executed, along with their out…

> Switching cost is low, but typing cost is much greater. That typing cost is why I use a GUI. While many times I can just enter `git add -u` into the terminal, there's still plenty of times where I want to be selective about what goes into the commit. If a simple glob pattern can't do it, then I'm going to reach for the GUI where I can just click on all the things I want to add to the commit in far less time than it…

Yup. But then, clicking time (or rather, navigating your mouse) is also slow. Where Magit shines is in being a GUI (a TUI), so you're always informed on the state of the repo, but it's also fully keyboard operated, so you don't have to click on things.

The popup-based paradigm for keyboard operation helps with discoverability - first few times around, you'll be going slow to learn what key does what, but after that, you'll be issuing most commands from memory.

Re: Magit, the magical Git interface (2017)

#128
post #95

Earlier quoted context omitted.

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.

[deleted]

Re: Magit, the magical Git interface (2017)

#129
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 visualizing branches, commits and diffs. I just don't understand why the git commands seem to cause so much trouble.

Re: Magit, the magical Git interface (2017)

#130
post #106

Earlier quoted context omitted.

IntelliJ GIT ui/ux is so completely frictionless it's magical at times. The only downside is that it makes incredibly complex operations trivial that I never learned git from the cli beyond the very basics.

Really? I tried it yesterday from within Rider and I gave up on it because I couldn't even figure out how to push or pull. Best I could find was fetch. Not the biggest deal since neither of those commands require interacting with the output which makes them equally easy to run from the terminal, but it's strange that they're not available in an immediately obvious place.

Ctrl-T for pull, Ctrl-Shift-K for push.
Post reply on HN