Toolbox - git without leaving the editor
Anyone in favor of emacs. If not you might be missing some of the best tools out there. Things which I havent found anywhere else available or even close to the awesomeness that emacs’ community offers and as a matter of fact ehy make it really hard to stop using emacs as a whole.
Maybe the first item in the list today should be emacs then )), neverthless here two tools that fall in love at the first sight.
magit
Using transient - another independent module by magit - it might give you an amazing client to handle git repos. There is a weird sense when you open it for first time. Coming from the regular git commands in the terminal, it feels a bit unconfrable. Brace the power my friend.
Stick around and try things. Keep notes and then compare with the corresponding cli git commands. I think it is amazing how powerful and easy makes it look like.
Review, commit, patch commits, history and more.
The cursor is the argument. You never type a path. Put the point on a file and
s stages it, on a hunk and s stages just that hunk. Select a few lines with
the region and s stages only those lines. That last one is git add -p without
the endless y/n/s/e questions. I am not sure I can give you enough examples which magit shines.
magit-forge
I found forge recently, looking for a specific flow to review my prs.
Once you got a better feeling with magit, you will have no problem with forge.
It works as an extension of magit anyway.
Press ' in any magit buffer and the forge menu is there. f f pulls the issues
and the pull requests down into a local sqlite file. Everything you read after
that comes from your disk, not from the network. That is the whole trick and it
is why it feels so much faster than the web ui.
The reason I stayed though is not the speed. Reviewing a pr in forge is reviewing
a diff in magit, with the same keys I use to write the code in the first place.
Checkout the pr with /c and you are on a normal branch, so you can run the
tests, jump to a definition, grep around. The browser can only show you the diff.
Here you get the repo. And when you type the review, it is an emacs buffer with
your snippets and your spellchecker, not a textarea that loses your text when the
tab reloads. /A approves, /R requests changes. I was expecting to be thrown
back to the browser for those two and I was not.
Things that will bite you:
- Nothing refreshes on its own. There is no timer, no background sync. If you
did not run
f fyou are looking at yesterday’s pull requests and forge will not tell you. It took me a while to stop wondering why a comment was missing. - The refspec fetches every single pull request. On the first pull forge adds
a refspec that brings down all of them. On a repo with thousands of prs this is
not what you want. Set
forge-add-pullreq-refspectoaskbefore you touch a big repo, orniland add it per repo with'R. - You need a token before anything works. It goes in your
~/.authinfo.gpgand it is the one part that is pure setup with no payoff until it is done. 'andNdo the same thing. Not a gotcha exactly, but every tutorial picks a different one and I spent some time thinking they were two menus.
TL;DR
Really i can;t find anything alike to compare. Working daily on repos and tracking everthing is overwhelm. the tooling must fun and must enjoy working with them.