summaryrefslogtreecommitdiff
path: root/notmuch-extract-patch/README.md
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-07-26 15:44:20 +0800
committerSean Whitton <spwhitton@spwhitton.name>2018-07-26 15:44:20 +0800
commit27cd090f22f502c927ba2ae0734e71c258ee0a78 (patch)
tree029d1e65585f48b86f4819082e55317b91035359 /notmuch-extract-patch/README.md
parenta66cd40929440a86670f2bff97700fe07052d661 (diff)
parentf6b282d91af581178150e36369e7fe03a9c813d4 (diff)
downloadmailscripts-27cd090f22f502c927ba2ae0734e71c258ee0a78.tar.gz
Add 'notmuch-extract-patch/' from commit 'f6b282d91af581178150e36369e7fe03a9c813d4'
git-subtree-dir: notmuch-extract-patch git-subtree-mainline: a66cd40929440a86670f2bff97700fe07052d661 git-subtree-split: f6b282d91af581178150e36369e7fe03a9c813d4
Diffstat (limited to 'notmuch-extract-patch/README.md')
-rw-r--r--notmuch-extract-patch/README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/notmuch-extract-patch/README.md b/notmuch-extract-patch/README.md
new file mode 100644
index 0000000..ecd1ba7
--- /dev/null
+++ b/notmuch-extract-patch/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)))))