From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/85666 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.gnus.general Subject: Re: git am/send-email support? Date: Thu, 29 Jan 2015 20:53:51 +0100 Message-ID: <87386t9xdc.fsf@randomsample.de> References: <87vbjqmiiw.fsf@building.gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422561286 4921 80.91.229.3 (29 Jan 2015 19:54:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Jan 2015 19:54:46 +0000 (UTC) Cc: Lars Ingebrigtsen , ding@gnus.org To: Daiki Ueno Original-X-From: ding-owner+M33907@lists.math.uh.edu Thu Jan 29 20:54:45 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YGvAq-0002DN-Ap for ding-account@gmane.org; Thu, 29 Jan 2015 20:54:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1YGvAN-00031G-IR; Thu, 29 Jan 2015 13:54:15 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YGvAK-00030v-F7 for ding@lists.math.uh.edu; Thu, 29 Jan 2015 13:54:12 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.84) (envelope-from ) id 1YGvAF-0003Sj-Rv for ding@lists.math.uh.edu; Thu, 29 Jan 2015 13:54:12 -0600 Original-Received: from randomsample.de ([5.45.97.173]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1YGvAD-0002mk-CF; Thu, 29 Jan 2015 20:54:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=u48hKIaYO7xFTJxkkjwu8c5bADstfZ27SVdKMUeJJXw=; b=QtkY/udNEbJf4A05iq0rj6v7Zd6A3xwZiUydChUTuD4sRutjozzSyCFyMdklsS4m4k11S85TMB3BoQ1AKSJWmdkFlnOU5yUne6r0HN3Eo8FVZRS/W6ilb9T/hJ7HvHIM; Original-Received: from ip4d149227.dynamic.kabel-deutschland.de ([77.20.146.39] helo=spaten) by randomsample.de with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YGvAA-0003G5-ST; Thu, 29 Jan 2015 20:54:03 +0100 In-Reply-To: (Daiki Ueno's message of "Thu, 29 Jan 2015 18:05:57 +0900") User-Agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.91 (gnu/linux) X-Spam-Score: -2.0 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85666 Archived-At: Daiki Ueno writes: > Lars Ingebrigtsen writes: > >> Daiki Ueno writes: >> >>> Is there any Gnus command(s) to interact with git, particularly applying >>> a patch from an article buffer and composing/sending a patch by email? >> >> I haven't seen anything in particular. I just use the `|' command to >> pipe stuff into "patch"... > > Thanks, I haven't thought of it. But isn't it a bit cumbersome to > manually specify the path of a git working directory (than being asked > interactively)? > > I'd appreciate if anyone could provide well-tested handy little snippets > for those operations :-) Well, here's mine: (defvar DE-gnus-git-directories '(("cedet" "~/cedet-git") ("emacs" "~/emacs-git")) "Name and directory for git projects.") (defvar DE-gnus-git-last-dir nil) (defun DE-gnus-apply-git-patch () "Run git-am on currently visible mail or posting." (interactive) (when (null gnus-article-buffer) (error "No opened article buffer.")) (with-current-buffer gnus-article-buffer (let* ((project (completing-read "Choose project: " (mapcar 'car DE-gnus-git-directories) nil t DE-gnus-git-last-dir)) (output (get-buffer-create "*git output*")) (default-directory (file-name-as-directory (expand-file-name (cadr (assoc project DE-gnus-git-directories)))))) (setq DE-gnus-git-last-dir project) (if (zerop (shell-command-on-region (point-min) (point-max) (format "git am") output)) (message "Patch(es) applied. See *git output* for details.") (message "There was an error running git.") (switch-to-buffer output))))) -David