3 ms·
What truly makes Magit powerful (like many things in Emacs) that it is extremely extensible. Example: When I'm ready to commit my changes: I can spin-off a n
by iLemming 7y ago
What truly makes Magit powerful (like many things in Emacs) that it is extremely extensible.
Example:
When I'm ready to commit my changes:
I can spin-off a new branch:
- If I have an Org-mode task that I'm currently clocked-in, it can check if it contains a ticket number, then query the issue-tracking system and generate a branch name based on the description.
All it takes is pressing two buttons: `b s`, and the rest is done automatically
- I commit my changes, it can use a template and fill out the details, I just need to add a description. I can even make it so it compliant with git-commit format enforcer like gommit. I can add fields like reported-by, cc, etc. with a single keystroke;
- If I suddenly find out that I forgot to add something, I don't have to amend, I don't have to modify the commit, I can just stage my change and press `c e` - "extend". It will quietly add it to my previous commit.
- Using Forge I can create a PR. Once I push the PR, I can trigger a request to issue-tracker that marks the ticket as in "code review"
There are bunch of things that other Git clients can't do* and even when they do it, it's not so easy to extend them to work with different projects, issue-tracking systems, etc.
* e.g. you can select a bunch of files in Dired and see git log pertaining changes only to those files https://twitter.com/iLemming/status/1193025618742349824 https://twitter.com/iLemming/status/1193025618742349824
- amluto 7y ago> If I suddenly find out that I forgot to add something, I don't have to amend, I don't have to modify the commit, I can just stage my change and press `c e` - "extend". It will quietly add it to my previous commit. Unless I’ve thoroughly misunderstood you, what you’re saying is that “c e” is equivalent to “git commit --amend”. This sounds suspiciously like “amend[ing]”. Sure, git’s user interface is somewhere between mediocre and abysmal, but it’s not really clear to me that “c e” is a vast improvement. I say this as a former org-mode user and even one-time contributor. Eventually I decided that the sheer number of magic incantations I had to remember to do anything useful wasn’t worth it.
- mgalgs 7y agoIt's actually `git commit --amend --no-edit`, but yes, it's basically "just" a shortcut. Count the keystrokes, though. If you spend much time working with git it's a huge win. Of course you could do something similar with shell aliases or reverse search, but then there are other switches and flags that you need occasionally, etc. And it's sooo much more convenient to have everything in one place right in your editor. It's almost unfair how much faster I can get stuff done than folks who don't use it ;) Magit isn't hype, it's as good as everyone says it is. You just have to try it.
- iLemming 7y ago> Magit isn't hype, it's as good as everyone says it is. You just have to try it. Exactly! People switch to Emacs because someone shows them Magit. Even though they either don't care much about Emacs or it intimidates them. I myself used IntelliJ for a long time. I have to say, IntelliJ has a superb Git integration. For a very long time I didn't want to switch to Emacs, because I didn't want to lose that. I thought Emacs's Magit thing just not good enough - it can't be, IntelliJ's seemed to be just unbeatable. Oh boy, how wrong I was. Wasted years of my life being ignorant.
- williamdclt 7y agoIf you spend much time with Git, you create aliases. Not saying that Magit isn't worth it (never used it), but it's not a fair comparison. I don't `git commit --amend --no-edit`: I `git amend` to edit the last commit, `git amend HASH` to edit any commit, `git amend -i` to pick a commit to edit in a searchable list with preview of their content.
- mgalgs 7y ago> git amend HASH That's 9 characters plus the effort of finding and copy/pasting the hash. With magit it's two characters and you just focus on the hash in question. > `git amend -i` to pick a commit to edit in a searchable list with preview of their content That's cool! Still a lot more typing than with Magit, which also has a searchable list with content previews ;) I'm happy that you've found ways to optimize your workflow, but seriously, Magit is still faster.
- iLemming 7y ago> Eventually I decided that the sheer number of magic incantations I had to remember to do anything useful wasn’t worth it Isn't that the point of Magit? People who never tried Magit often say either of these two things: - "I'm already an expert in Git, I'm fine with the command line", or - "Git is confusing already, I don't want to learn yet another thing" The main point about Magit (unlike many other Git GUIs) - is to help you discover Git features, and allow you to do your work in a very efficient and simple workflow. However, it would do so without hiding Git mechanics from the user. Anytime you can check what the actual Git command gets executed. Magit doesn't liberate you from learning Git internals, but at the same time it doesn't overwhelm you with tons of different command-line switches. You don't have to memorize anything, the reference for all the commands is always available to you. I believe, I have become a Git ninja because of Magit. Without it, who knows, maybe I would never learn many features of Git.
- ashton314 7y agoNew to using Magit… can I see your relevant config to do all that? I just recently discovered clocking in and out of tasks on org-mode and I’m intrigued by your setup.
- iLemming 7y agoWell, I could say "sure, here's my config * ", but all that I described may not be very simple and straightforward (especially for a beginner). For example: we use Jira at work and I can't stand it. I use go-jira command line client and "talk" to Jira from Emacs via that tool. Meaning that I had to configure go-jira and write some emacs-lisp code that executes it and then parses json, etc. Also the workflow I described is not completely automated yet, I'm still experimenting and it's not very clean - things right now are scattered across different config files. If you have any questions I would gladly try to answer them in a private chat: either email, twitter, signal, telegram or keybase. Let me know. * https://github.com/agzam/dot-spacemacs https://github.com/agzam/dot-spacemacs