I just wanted to know if Magit has this functionality. The reference manual does not have this explicitly so that's why I am asking.
-
@itsjeyd yes, sorry, I was trying out sx.el (the stackexchange client for emacs) and it didn't show any answers. Once I opened the link in a browser I saw it, sorry :( Edit: deleted comment– Lee HJan 16, 2015 at 15:30
-
@LeeH No problem, thanks for following up! :)– itsjeydJan 16, 2015 at 15:37
-
@LeeH That's very odd. If you run into that problem again please file a bug report.– MalabarbaJan 20, 2015 at 20:45
-
@Malabarba I did! Then it was fixed in sx.el and everything works now :)– Lee HJan 21, 2015 at 11:29
2 Answers
You're right, it doesn't seem to be built in. But note that you can run any git
subcommand you like from a Magit buffer by pressing :, which is bound to magit-git-command
by default:
magit-git-command
is an interactive autoloaded compiled Lisp function inmagit.el
.
(magit-git-command ARGS DIRECTORY)
Execute a Git subcommand asynchronously, displaying the output. With a prefix argument run Git in the root of the current repository. Non-interactively run Git in
DIRECTORY
withARGS
.
So in order to get a patch for, e.g., the latest commit using git format-patch
you can do the following:
: format-patch -1
RET
The output (displayed in the *magit-process*
buffer) will look something like this:
0 git --no-pager -c core.preloadindex=true format-patch -1
0001-Commit-message-associated-with-latest-commit.patch
Starting with v2.1.0
Magit provides basic support for git format-patch
as well as git request-pull
. They share a popup, magit-patch-popup
, which W is bound to.