├── README ├── checkpatch ├── git-abort ├── git-apply ├── git-apply-incoming ├── git-reset ├── mail-to-mbox ├── muttrc ├── procmail └── procmailrc /README: -------------------------------------------------------------------------------- 1 | These scripts were inspired, and largely copied, from Luis Rodriguez's blog 2 | post: 3 | 4 | http://www.do-not-panic.com/2014/07/applying-patches-from-mutt-onto-git.html 5 | (Be sure to view the source if you read the muttrc or the <> commands will be 6 | hidden as html tags) 7 | 8 | Which was itself inspired from Ben Hutchings earlier blog: 9 | 10 | http://flavioleitner.blogspot.com/2011/03/patch-workflow-with-mutt-and-git.html 11 | 12 | To use: 13 | 14 | Edit the hardcoded project path in the scripts (~/source/linux/linux-pdx86) to 15 | your preferred location. This is where "git am" and "scripts/checkpatch" will be 16 | run from. 17 | 18 | $ cp * ~/bin/mutt/ 19 | $ mkdir ~/incoming 20 | $ cat muttrc >> ~/.muttrc 21 | 22 | Dependencies: 23 | - git 24 | - procmail 25 | - formail 26 | - mutt 27 | (at least) 28 | -------------------------------------------------------------------------------- /checkpatch: -------------------------------------------------------------------------------- 1 | cd ~/source/linux/linux-pdx86/ 2 | scripts/checkpatch.pl ~/incoming/* 3 | -------------------------------------------------------------------------------- /git-abort: -------------------------------------------------------------------------------- 1 | cd ~/source/linux/linux-pdx86 2 | git am --abort 3 | rm -f ~/incoming/* 4 | -------------------------------------------------------------------------------- /git-apply: -------------------------------------------------------------------------------- 1 | rm -f ~/incoming/* 2 | ~/bin/mutt/mail-to-mbox 3 | ~/bin/mutt/git-apply-incoming 4 | -------------------------------------------------------------------------------- /git-apply-incoming: -------------------------------------------------------------------------------- 1 | cd ~/source/linux/linux-pdx86/ 2 | git am -s ~/incoming/*.mbox 3 | -------------------------------------------------------------------------------- /git-reset: -------------------------------------------------------------------------------- 1 | cd ~/source/linux/linux-pdx86/ 2 | git reset --hard origin 3 | rm -f ~/incoming/* 4 | -------------------------------------------------------------------------------- /mail-to-mbox: -------------------------------------------------------------------------------- 1 | formail -cds ~/bin/mutt/procmail - 2 | ls -l ~/incoming/ 3 | -------------------------------------------------------------------------------- /muttrc: -------------------------------------------------------------------------------- 1 | # Macros for managing patches 2 | macro index (t '~/bin/mutt/mail-to-mbox' "Dumps tagged patches into ~/incoming/*.mbox" 3 | macro index (a '~/bin/mutt/git-apply-incoming' "git am ~/incoming/*.mbox" 4 | macro index (g '~/bin/mutt/git-apply' "git am tagged patches" 5 | macro index (c '~/bin/mutt/checkpatch' "Run checkpatch on ~/incoming/*" 6 | macro index (r 'rm -f ~/incoming/*.mbox' "Nukes all ~/incoming/" 7 | macro index (l 'ls -ltr ~/incoming/' "ls -l ~/incoming/" 8 | macro index ,t '~/bin/mutt/mail-to-mbox' "Dumps currently viewed patch into ~/incoming/*.mbox" 9 | macro index ,g '~/bin/mutt/git-apply' "git am currently viewed patch" 10 | macro index ,a '~/bin/mutt/git-abort' "git am --abort" 11 | macro index ,r '~/bin/mutt/git-reset' "git-reset --hard origin" 12 | 13 | -------------------------------------------------------------------------------- /procmail: -------------------------------------------------------------------------------- 1 | /usr/bin/procmail -m ~/bin/mutt/procmailrc - 2 | -------------------------------------------------------------------------------- /procmailrc: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | VERBOSE=off 3 | MAILDIR=$HOME/incoming/ 4 | LOGFILE=$HOME/incoming/.procmaillog 5 | 6 | :0 7 | `formail -xSubject: | sed -e '{ s/Subject: //; s@\[@@g; s@\]@@g; s@[()]@_@g; 8 | s@[/:]@-@g; s@"@_@g; s@^ \+@@; s@\.\.@.@g; s@ \+@_@g; s@-_@_@g; s@__@_@g; 9 | s@\.$@@; }'`.mbox 10 | --------------------------------------------------------------------------------