* git am/send-email support?
@ 2015-01-28 3:55 Daiki Ueno
2015-01-29 2:23 ` Lars Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Daiki Ueno @ 2015-01-28 3:55 UTC (permalink / raw)
To: ding
Hello,
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'm pretty sure it was already written by someone, but I couldn't find
anything except magit-apply-mailbox, which seems to apply patches from
mbox or Maildir.
Thanks,
--
Daiki Ueno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git am/send-email support?
2015-01-28 3:55 git am/send-email support? Daiki Ueno
@ 2015-01-29 2:23 ` Lars Ingebrigtsen
2015-01-29 9:05 ` Daiki Ueno
0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2015-01-29 2:23 UTC (permalink / raw)
To: Daiki Ueno; +Cc: ding
Daiki Ueno <ueno@gnu.org> 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"...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git am/send-email support?
2015-01-29 2:23 ` Lars Ingebrigtsen
@ 2015-01-29 9:05 ` Daiki Ueno
2015-01-29 19:53 ` David Engster
2015-01-29 23:37 ` Lars Ingebrigtsen
0 siblings, 2 replies; 6+ messages in thread
From: Daiki Ueno @ 2015-01-29 9:05 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: ding
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Daiki Ueno <ueno@gnu.org> 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 :-)
Regards,
--
Daiki Ueno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git am/send-email support?
2015-01-29 9:05 ` Daiki Ueno
@ 2015-01-29 19:53 ` David Engster
2015-02-02 8:11 ` Daiki Ueno
2015-01-29 23:37 ` Lars Ingebrigtsen
1 sibling, 1 reply; 6+ messages in thread
From: David Engster @ 2015-01-29 19:53 UTC (permalink / raw)
To: Daiki Ueno; +Cc: Lars Ingebrigtsen, ding
Daiki Ueno writes:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Daiki Ueno <ueno@gnu.org> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git am/send-email support?
2015-01-29 9:05 ` Daiki Ueno
2015-01-29 19:53 ` David Engster
@ 2015-01-29 23:37 ` Lars Ingebrigtsen
1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2015-01-29 23:37 UTC (permalink / raw)
To: Daiki Ueno; +Cc: ding
Daiki Ueno <ueno@gnu.org> writes:
> 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 have the following in my .gnus.el:
(setq gnus-summary-pipe-output-default-command "patch --no-backup-if-mismatch -l -f -d ~/pgnus/lisp")
And I just edit the path to point at the right thing I want to patch,
which varies from time to time.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git am/send-email support?
2015-01-29 19:53 ` David Engster
@ 2015-02-02 8:11 ` Daiki Ueno
0 siblings, 0 replies; 6+ messages in thread
From: Daiki Ueno @ 2015-02-02 8:11 UTC (permalink / raw)
To: David Engster; +Cc: Lars Ingebrigtsen, ding
David Engster <deng@randomsample.de> writes:
> 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."
Thank you, working nicely!
Lars Ingebrigtsen <larsi@gnus.org> writes:
> I have the following in my .gnus.el:
>
> (setq gnus-summary-pipe-output-default-command "patch
> --no-backup-if-mismatch -l -f -d ~/pgnus/lisp")
>
> And I just edit the path to point at the right thing I want to patch,
> which varies from time to time.
This looks also useful, thanks. Maybe I could set the directory path
through a group parameter to fully automate it.
Regards,
--
Daiki Ueno
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-02-02 8:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 3:55 git am/send-email support? Daiki Ueno
2015-01-29 2:23 ` Lars Ingebrigtsen
2015-01-29 9:05 ` Daiki Ueno
2015-01-29 19:53 ` David Engster
2015-02-02 8:11 ` Daiki Ueno
2015-01-29 23:37 ` Lars Ingebrigtsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).