[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Supporting git-send-email/hg email in VC

From: Philip Kaludercic
Subject: Re: Supporting git-send-email/hg email in VC
Date: Wed, 24 Aug 2022 15:11:49 +0000

Antoine Kalmbach <ane@iki.fi> writes:

> Would it make sense for Emacs' VC to support emailing patches from
> within Emacs? It kind of doesn't make sense that I can do mostly
> everything in VC... but I have to jump to the command line (shell) to
> use git-send-email.
> I was thinking there could be a command called 'vc-mail-commit' which
> would in vc-dir-mode or vc-log-mode do the right thing and call git
> format-patch and then compose a mail with the contents of the patch (or
> the patch attached, depending on customization).

If we are only composing a message, should we perhaps then use a name
like `vc-prepare-patch'?

Also, what do we do when someone wants to send multiple patches at once?
Will n message buffers pop up, or should they all be sent out
automatically after an introductory message (that would be displayed in
a separate buffer) has been sent?

> The right thing would be in vc-dir-mode to prompt for a ref (branch, -1,
> HEAD^, etc), in vc-log-mode it would be to compose a set of patches from
> the marked commit(s), or prompt like in vc-dir-mode for a ref to send a
> patch from a user-specified ref.

This sounds like a good plan.  I had also been considering something
like this, but instead of using 'format-patch', I attempted to
generalise git send-email directly.  It appears to me that your approach
is preferable, insofar the result is actually "git am"-able.

> Does such a feature make sense? I know sites like git-send-email.io[1]
> say things like:
>> Warning! Some people think that they can get away with sending patches
>> through some means other than git send-email, but you can't. Your
>> patches will be broken and a nuisance to the maintainers whose inbox
>> they land in. Follow the golden rule: just use git send-email.
> But I find that if and only if you use git-format-patch, the end result
> is pretty much the same. To that end, I think if Emacs managed to
> integrate with the different DVCS' email-based workflows, it would be
> a great usability improvement.

I assume you are talking about an inline attachment, right?  Have you
tried sending yourself a message like that, and then filtering the
message body through git am?

> If people think this would be a useful feature, I can open a bug report
> to track this and start working on it. The proposed reference
> implementation for Git would be to (1) ask the user for a ref (2) call
> git format-patch with that (3) compose a new message in Emacs, and set
> the body of the message to be the output of git-format-patch (OR attach
> the file) and (4) let the MUA take it from there.

I certainly agree that this would be interesting, and I think it would
find explicit use in the feature/package+vc branch, by making it easier
to contribute changes upstream.

> Alternatively, it would be possible to use a combination of with-editor
> + git-send-email, but only if we should need ot abide by the "rule",
> because to me there aren't many nuances beyond using the format
> specified by git-format-patch with your own MUA vs. using
> git-send-email. Or do I not know enough about the latter to not see the
> missing pieces?

Unless with-editor would be added to the core, I think that we should
prefer the first approach to this one.

> [1] https://git-send-email.io/#step-3

reply via email to

[Prev in Thread] Current Thread [Next in Thread]