Live data from Hacker News

Magit, the magical Git interface (2017)

emacsair.me

291–300 of 357 posts

Re: Magit, the magical Git interface (2017)

#291

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^`"

You're not meant to delete commits like that. Git encourages you to stop "lying about the past", and you will run into a fair amount of trouble if you try to do so with shared history. You don't remove a commit "backwards" and change history; you add a new commit that undoes the previous one (git revert)

Re: Magit, the magical Git interface (2017)

#292

I feel like I'm missing out on a lot by not knowing emacs. I tried to learn emacs once, and the tutorial started with "I've been using emacs for about 25+ years and I'd say I'm about a middle of the road user"... that was when I was like, "No, I'll just keep using IntelliJ or vscode or whatever". It's not that I love or even care about any IDE, I just literally haven't the first clue as to even get started with emacs…

You could keep using your current IDE and use Emacs for the simpler tasks while you are learning it at whatever pace is convenient for you.

I am a new Emacs user. I decided to give it a try about ten days ago, so I followed the built-in tutorial, read a bit about minor and major modes, buffers, global and buffer-local variables and it started making sense. The online documentation is extensive and the built-in documentation system is very easy to use.

Re: Magit, the magical Git interface (2017)

#293

Earlier quoted context omitted.

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.

What is "uncommit" though? Do you want your changes gone, staged or unstaged?

I’d like something like:

- git revert {rev} to nuke changes and go back to how the world was

- git uncommit to return to the state literally before git commit

- git unstage to unstage a file

The latter arguably should go with git stage but it’s a bit late for that. NB git add and git rm are totally not inverse operations...

So then I can uncommit, and unstage if need be. Reverting is for discarding changes, and should come with an interactive confirmation prompt and other safety and hygiene messages.

Re: Magit, the magical Git interface (2017)

#294
Give me magit+org on top of a more modern foundation than GNU Emacs and I'll be set for life. I wish Emacs would let go of its "It's Free GNU, baby!"-past and instead focus more on user adoption and innovation. Emacs has such a brilliant community, but the project itself feels as stagnant as Vim did right before the community gave Bram the finger and made Neovim..

Re: Magit, the magical Git interface (2017)

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

> I would say that Magit and structural editing using Paredit are the two most important technologies that make programming great.

That's interesting because those are two tools I've tried to adopt multiple times, but never have managed to do.

Paredit is at least partly due to my long use of vi (and almost as long use of vim) keybindings; I use evil-mode, and bind > to the appropriate adjust-parens functions for strucutural editing.

Magit is due to me having used git for so long that it takes me at least 5-10x as long to do something with magit as with the git terminal, and I'm just not at a point in my life where I desire to fight with my VCS when there is another option.

I suppose I'm just stuck in local maxima with regards to those two things, but I'd say I'm fast enough.

Re: Magit, the magical Git interface (2017)

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

"I just don't understand why the git commands seem to cause so much trouble."

To me the git command line is one of the tools that are great if you use them often. But if you use it less often it's really hard to remember the correct syntax especially since it's really easy to mess things up. (If know WPF, the binding syntax is in the same category. Really powerful but if you take two months break you struggle with the syntax). It really bugs me in git when normal things need 3 or more parameters and if you forget one of them you mess things up.

Years ago I worked with mercurial for a while and I thought the commands were much cleaner and easier to remember.

Re: Magit, the magical Git interface (2017)

#298

Earlier quoted context omitted.

Yeah, git is certainly a low level tool. That's actually what I like most about it. There's a few fundamental concepts I get to manipulate directly with git commands. I like dealing with innards like this because I can form a mental model of the tool. High level tools are a lot harder to understand. I think the problem with add, commit and reset is they aren't low level enough . The reset command in particular is jug…

I probably pushed and pulled O(100) remote branches over the past decade (jeepers I'm getting old), so roughly once a month. It's not that rare, yet I still haven't memorised them, because I find them so unintuitive.

Once a month is close to my usage and it's often enough to remember things in principle but not often enough to remember the d#$%#$%^#$n syntax with all its obscure details.

Re: Magit, the magical Git interface (2017)

#299
post #17
post #6

If it's so great why are people not building it out of emacs :P

Next to other posters, there's also LazyGit ( https://github.com/jesseduffield/lazygit ), and vimagit ( https://github.com/jreybert/vimagit ). So yea, people are building it out of emacs!

I have both but I found myself struggling to use vimagit over lazygit as it feel faster to work with.

Do you have any specific workflows that you prefer one over the other?

Re: Magit, the magical Git interface (2017)

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

If you know git cli very well, most of the stuff are straight forward. Most people struggle with git if they have not spent the time to understand how it works.

But there is one thing I believe is still not-very-smooth in the git cli: splitting hunks.

if I do interactive add in git, and I get small hunk that adds a line, deletes a line, adds another line, and deletes a line, then if I want to include only the addition of the second line, it is pretty annoying in git cli. In magit, it is basically selecting the line and pressing "s".

Post reply on HN