8

Configuring aerc for git via email

 3 years ago
source link: https://drewdevault.com/2020/04/20/Configuring-aerc-for-git.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Configuring aerc for git via email

Configuring aerc for git via email April 20, 2020 on Drew DeVault's blog

I use aerc as my email client (naturally — I wrote it, after all), and I use git send-email to receive patches to many of my projects. I designed aerc specifically to be productive for this workflow, but there are a few extra things that I use in my personal aerc configuration that I thought were worth sharing briefly. This blog post will be boring and clerical, feel free to skip it unless it’s something you’re interested in.

When I want to review a patch, I first tell aerc to :cd sources/<that project>, then I open up the patch and give it a read. If it needs work, I’ll use “rq” (“reply quoted”), a keybinding which is available by default, to open my editor with the patch pre-quoted to trim down and reply with feedback inline. If it looks good, I use the first of my custom keybindings: “ga”, short for git am. The entry in ~/.config/aerc/binds.conf is:

ga = :pipe -mb git am -3<Enter>

This pipes the entire message (-m, in case I’m viewing a message part) into git am -3 (-3 uses a three-way merge, in case of conflicts), in the background (-b). Then I’ll use C-t (ctrl-T), another keybinding which is included by default, to open a terminal tab in that directory, where I can compile the code, run the tests, and so on. When I’m done, I use the “gp” keybinding to push the changes:

gp = :term git push<Enter>

This runs the command in a new terminal, so I can monitor the progress. Finally, I like to reply to the patch, letting the contributor know their work was merged and thanking them for the contribution. I have a keybinding for this, too:

rt = :reply -Tthanks<Enter>

My “thanks” template is at ~/.config/aerc/templates/thanks and looks like this:

Thanks!

{% raw %}
{{exec "{ git remote get-url --push origin;
    git reflog -2 origin/master --pretty=format:%h; }
  | xargs printf 'To %s\n   %s..%s  master -> master\n'" ""}}
{% endraw %}

That git command prints a summary of the most recent push to master. The result is that my editor is pre-filled with something like this:

Thanks!

To [email protected]:~sircmpwn/builds.sr.ht
   7aabe74..191f4a0  master -> master

I occasionally append a few lines asking questions about follow-up work or clarifying the deployment schedule for the change.

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~sircmpwn/[email protected] [mailing list etiquette]

Articles from blogs I read Generated by openring

Go on ARM and Beyond

The industry is abuzz about non-x86 processors recently, so we thought it would be worth a brief post about Go’s support for them. It has always been important to us for Go to be portable, not overfitting to any particular operating sys…

via The Go Programming Language Blog December 17, 2020

Status update, December 2020

Hi all! This status update is the 24th one, so it’s been 2 years I’ve started writing those now (ignoring a little hiatus). Time flies! This month I’ve invested a lot of time into wlroots. My main focus has been renderer v6, which has now been internally rol…

via emersion December 16, 2020

What's cooking on Sourcehut? December 2020

A brisk wind of winter chill sets a stir down my spine, as I sit down with a fresh cup of coffee to yarn a story of careful engineering and passionate spirit that took place over the course of 30 days. The last 30 days. Cause this is the monthly “what’s cook…

via Blogs on Sourcehut December 15, 2020
The content for this site is CC-BY-SA. The code for this site is MIT.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK