diff options
-rw-r--r-- | README.md | 34 | ||||
-rw-r--r-- | README.org | 14 | ||||
-rw-r--r-- | git-email-notmuch.el | 15 | ||||
-rw-r--r-- | git-email.el | 41 |
4 files changed, 25 insertions, 79 deletions
@@ -1,20 +1,20 @@ # Table of Contents -1. [Introduction](#org1c3770f) -2. [Demo](#org22efe78) -3. [Installation](#org2f11d3b) -4. [Related packages](#org518440b) -5. [Contributing](#org16a78b5) +1. [Introduction](#org96a3616) +2. [Demo](#org65da1cb) +3. [Installation](#orgc576a29) +4. [Related packages](#orgc795f7e) +5. [Contributing](#orgacd2afe) -<a id="org1c3770f"></a> +<a id="org96a3616"></a> # Introduction -`git-email` integrates git and email with Emacs, it offers three main -functions for sending and receiving email with git. +`git-email` integrates git and email with Emacs, it offers two main +functions for sending email with git. - `git-email-send-email` will send the marked files as patches using your mail client of choice. This means that you have to first run @@ -25,41 +25,39 @@ functions for sending and receiving email with git. current HEAD. It will then prepare the patches as email messages in the same way as `git-email-send-email`. -- `git-email-apply-patch` will ask you for a project to cd into and then - apply the patch in the current buffer using `git am`. You can also - specify your own function to extract the patch from the buffer by - changing the `git-email-apply-patch-function` variable. - You can see all the customizable variables running M-x `customize-group` RET `git-email` RET. +If you want to easily apply patches you have recieved, you should +checkout [piem](https://git.kyleam.com/piem). + -<a id="org22efe78"></a> +<a id="org65da1cb"></a> # Demo  -<a id="org2f11d3b"></a> +<a id="orgc576a29"></a> # Installation You can install it by cloning this repo and adding `git-email.el` to your `load-path`. -<a id="org518440b"></a> +<a id="orgc795f7e"></a> # Related packages - [piem](https://git.kyleam.com/piem/) - gluing together public-inbox archives and git -<a id="org16a78b5"></a> +<a id="orgacd2afe"></a> # Contributing -You can send patches to the [git-email-devel](https://lists.sr.ht/~yoctocell/git-email-devel) mailing list. +You can send patches and bug reports to the [git-email-devel](https://lists.sr.ht/~yoctocell/git-email-devel) mailing list. **Note:** The README.md is generated from README.org @@ -3,8 +3,8 @@ #+EMAIL: public@yoctocell.xyz * Introduction -=git-email= integrates git and email with Emacs, it offers three main -functions for sending and receiving email with git. +=git-email= integrates git and email with Emacs, it offers two main +functions for sending email with git. - =git-email-send-email= will send the marked files as patches using your mail client of choice. This means that you have to first run @@ -15,14 +15,12 @@ functions for sending and receiving email with git. current HEAD. It will then prepare the patches as email messages in the same way as =git-email-send-email=. -- =git-email-apply-patch= will ask you for a project to cd into and then - apply the patch in the current buffer using =git am=. You can also - specify your own function to extract the patch from the buffer by - changing the =git-email-apply-patch-function= variable. - You can see all the customizable variables running M-x =customize-group= RET =git-email= RET. +If you want to easily apply patches you have recieved, you should +checkout [[https://git.kyleam.com/piem][piem]]. + * Demo [[file:demo.gif]] @@ -33,6 +31,6 @@ You can install it by cloning this repo and adding =git-email.el= to your =load- - [[https://git.kyleam.com/piem/][piem]] - gluing together public-inbox archives and git * Contributing -You can send patches to the [[https://lists.sr.ht/~yoctocell/git-email-devel][git-email-devel]] mailing list. +You can send patches and bug reports to the [[https://lists.sr.ht/~yoctocell/git-email-devel][git-email-devel]] mailing list. *Note:* The README.md is generated from README.org diff --git a/git-email-notmuch.el b/git-email-notmuch.el index 0dccc17..a10789e 100644 --- a/git-email-notmuch.el +++ b/git-email-notmuch.el @@ -24,23 +24,12 @@ ;;; Commentary: -;; This library offers some extra functions to make git-email work -;; better with notmuch. +;; This library offers sets some variables for git-email to make it +;; work better with notmuch. ;;; Code: (require 'git-email) -(require 'notmuch-show) - -;;;###autoload -(defun git-email-notmuch-apply-patch (project &optional thread) - "Apply the patch in the notmuch-show buffer using 'git am' in PROJECT. - -If THREAD is non-nil or if invoked with a prefix argument, apply the patches -in the whole thread instead of the current message." - (interactive (list (git-email--get-project)) "p") - (let ((default-directory project)) - (notmuch-show-pipe-message thread git-email-apply-patch-command))) (provide 'git-email-notmuch) ;;; git-email-notmuch.el ends here diff --git a/git-email.el b/git-email.el index e0fd6ac..5b72b33 100644 --- a/git-email.el +++ b/git-email.el @@ -24,7 +24,7 @@ ;;; Commentary: -;; This package integrates with git and email and offers three main functions +;; This package integrates with git and email and offers two main functions ;; ;; * `git-email-send-email' sends an email based on a patch file generated by ;; 'git format-patch'. It inserts the relevant headers and the diff into the @@ -33,11 +33,6 @@ ;; * `git-email-format-patch' is a wrapper for 'git format-patch' and it ;; automatically composes an email for each generated patch, in the same way ;; as `git-email-send-email'. -;; -;; * `git-email-apply-patch' will apply the patch that you are currently viewing -;; and it will ask to for the project that the patch belongs to. - -;;; TODO: ;;; Code: @@ -96,20 +91,6 @@ in you git config. If the variable is not set, the 'to' address will be empty." :type '(string) :group 'git-email) -(defcustom git-email-apply-patch-function - #'git-email--shell-command-on-body - "Function that executes a shell command on the body of the message. -This function should take one argument, it should be the shell command to -execute. By default it is determined by the `git-email-apply-patch-command' -variable." - :type 'symbol - :group 'git-email) - -(defcustom git-email-apply-patch-command "git am" - "Command to run to apply the patch." - :type 'string - :group 'git-email) - (defcustom git-email-revision-limit 100 "How many revisions to show when in `git-email-format-patch'." :type 'int @@ -367,25 +348,5 @@ behavior is to delete them after sending email." (git-email--compose-email file) (run-hooks 'git-email-post-compose-email-hook)))) -;;;; Apply patches -(defun git-email--shell-command-on-body (command) - "Get the body of the message in the current buffer and run COMMAND on it." - (shell-command-on-region (point-min) (point-max) command)) - -(defun git-email--get-project () - "Get the path to a project using `project-prompt-project-dir'." - (let ((project (project-prompt-project-dir))) - (add-to-list 'project--list (list project)) - project)) - -;;;###autoload -(defun git-email-apply-patch (project) - "Apply the patch in the current buffer using 'git am' in PROJECT." - (interactive (list (git-email--get-project))) - (let ((default-directory project)) - (funcall git-email-apply-patch-function - git-email-apply-patch-command))) - - (provide 'git-email) ;;; git-email.el ends here |