summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2017-01-16 13:53:39 +0100
committerAurelien Aptel <aaptel@suse.com>2017-01-16 14:29:54 +0100
commit2da7433195a99d4254caec4674fbc6dd9b78b6ff (patch)
treedc04a0713d649e355608e9918eae4e346fff8f3c /README.md
downloadmailscripts-2da7433195a99d4254caec4674fbc6dd9b78b6ff.tar.gz
initial commit
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ecd1ba7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,30 @@
+# Usage
+
+Let's say you use notmuch as your email client and you want to try out
+one of those git patchset sent on a mailing list with all diffs
+grouped in a thread, one patch per email. ("[PATCH 1/15] do blah...").
+
+Simply exporting the thread is not enough, you need to skip any
+feedbacks or cover letters that have been posted on the thread.
+
+This is what this script does.
+
+Example usage:
+
+ $ notmuch-extract-patchset thread:000000000000265f > feature.patchset
+ $ git checkout -b test-feature
+ $ git am feature.patchet
+
+
+You can use the following to use it directly from emacs:
+
+ (defun apply-thread-patchset (repo branch)
+ (interactive "Dgit repo: \nsnew branch name: ")
+ (let ((tid notmuch-show-thread-id)
+ (tmp "/tmp/notmuch-patchset"))
+ (shell-command (format "notmuch-extract-patch %s > %s && ( cd %s && git checkout -b %s && git am %s )"
+ (shell-quote-argument tid)
+ (shell-quote-argument tmp)
+ (shell-quote-argument (expand-file-name repo))
+ (shell-quote-argument branch)
+ (shell-quote-argument tmp)))))