From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Supporting git-send-email/hg email in VC Date: Wed, 24 Aug 2022 15:11:49 +0000 Message-ID: <87k06xoeve.fsf@posteo.net> References: <848rndq2i7.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27457"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Antoine Kalmbach Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 24 17:21:58 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQsCc-0006vi-IP for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Aug 2022 17:21:58 +0200 Original-Received: from localhost ([::1]:53488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQsCb-00030b-FD for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Aug 2022 11:21:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQs2w-0000oq-78 for emacs-devel@gnu.org; Wed, 24 Aug 2022 11:11:58 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:58391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQs2s-0003vF-9H for emacs-devel@gnu.org; Wed, 24 Aug 2022 11:11:57 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CE787240103 for ; Wed, 24 Aug 2022 17:11:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1661353910; bh=KJbuweA4V7asi5GW61u5S94H55ZQO3sP95YsDYrJb6w=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=rOADDLnWilPXW/WPzKGWx41RdU5WIJeuqWVzKYkU8oZIyIDLSY3YtbexrCSIUDPif w+N+5qyViijXk1MXKmUYtijoqfUW2c0n106h4yYkc3mvytBUrzQuxR3aJz9FtajDv4 Qf9xxpnGJ+FBAaQ2/d/4WEozE52QW4owlK6ogxFzMzT31PGHW8WJLIWetJ52USoF5g YdYuM/jDJOw8uA4nqeqzkcIRdMN8ge5v+Iqy7Hn7yRC7iqT2fw0mHL80f1lRSDyTyh XKjNVxsWuggemdqLj8Kzp/6K+9ctHNT6ZQinREM0+uA+zHj4mmOIbGZQzxi+uiEaTf 0L5f5FD+op1Cg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MCV1f21L4z9rxN; Wed, 24 Aug 2022 17:11:50 +0200 (CEST) In-Reply-To: <848rndq2i7.fsf@iki.fi> (Antoine Kalmbach's message of "Wed, 24 Aug 2022 14:56:00 +0300") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294033 Archived-At: Antoine Kalmbach 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