From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Antoine Kalmbach Newsgroups: gmane.emacs.bugs Subject: bug#57400: 29.0.50; Support sending patches from VC directly Date: Fri, 26 Aug 2022 13:45:51 +0300 Message-ID: References: <84v8qgn1z9.fsf@iki.fi> <87h71zo3p8.fsf@posteo.net> <87sfljmgwz.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6952"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57400@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 26 12:47:43 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oRWsI-0001aG-UF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 12:47:43 +0200 Original-Received: from localhost ([::1]:51412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRWsH-0002UW-JD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 06:47:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRWqs-0001gx-OA for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 06:46:15 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRWqg-0006r2-1a for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 06:46:14 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oRWqf-0004OS-RW for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 06:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Antoine Kalmbach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Aug 2022 10:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57400 X-GNU-PR-Package: emacs Original-Received: via spool by 57400-submit@debbugs.gnu.org id=B57400.166151075616871 (code B ref 57400); Fri, 26 Aug 2022 10:46:01 +0000 Original-Received: (at 57400) by debbugs.gnu.org; 26 Aug 2022 10:45:56 +0000 Original-Received: from localhost ([127.0.0.1]:52221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRWqa-0004O2-Bx for submit@debbugs.gnu.org; Fri, 26 Aug 2022 06:45:56 -0400 Original-Received: from lahtoruutu.iki.fi ([185.185.170.37]:42282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRWqY-0004Nq-39 for 57400@debbugs.gnu.org; Fri, 26 Aug 2022 06:45:54 -0400 Original-Received: from qfinm256.local (unknown [66.159.213.92]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ane) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 165FD1B0018B; Fri, 26 Aug 2022 13:45:52 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1661510752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0CNUFwa3Vl5LTtcr+Gnsrni6EOXlu2uah3WmjawPdwQ=; b=Vb5l2YfH8J+VVzAAdTIuQ0Hf75OplaEWahwz8LVDB8wb4dTKUcCV3xAG71ei1BbEx0AjAO MlRB8Qu45jzGGLdyY3Lg48PyC++LK/Hdi7cJk26AiPkDYGL6KNZeb+XA2/brHWogJ+RMx/ y7nUxXSPcpnR6pBDxBgMa8nVbtNVTV1EpT9FTdhLxs9XUNfsdlyZxBMfM8vbBds5jRp7nt eWFUuja030f+XpuFgJrbls+DsRi4cH7onzzcDW3tWRyNmJIWpkan0VCSpq2QIvkSrkGMIi h2rRU9PXca4ZSc0NtxKeQSBC7h33gxQdJxuL8u6n1S3RaAg2FfpJDHhwhWV+9A== In-Reply-To: <87sfljmgwz.fsf@posteo.net> ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1661510752; a=rsa-sha256; cv=none; b=HCFdDyy5wD+5gR2COtlbBtmX/uCetq5ieHXPR+Fp+Ol5L1nl0xkuN9ZCeRga4xEa7FiI37 Foorz9kVKJzBWFQXXAVoIz8Bv4yaAtuzDm2zJDhoJduNOaTW+kKAN+nsPJgE/XAh9pi8Ng XPYSVf5E5Sfy7pbEBWMXnB5AZZXT5WEkG0dc8TNRjp70OdmoLY2VXgp+xjzCF0sfBmJzdM It8K/PE4cgTLUJveptNFkRZveIwfjekzZu0iHdDIHv4/6GCbW8RLW6uR87Rh5VhYJOOkYU N5am/cU47nxVs8odcpgL6RFZiiTTSNuT/CQIsoo53g06VRuBcQ21AATjkKJCpQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=ane smtp.mailfrom=ane@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1661510752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0CNUFwa3Vl5LTtcr+Gnsrni6EOXlu2uah3WmjawPdwQ=; b=CXKJkGV7IzzwQ25q6jBybIEvjzkZEpO59MfsPeyMvtgXvLf747DHaf0e61w0LGIo+mpogg AoejgdJqdnCKbW4YatpdsnY7Dh6zeNvwCJbvp0Eim2NSxuZQE56nQqiMENxDl1esnAlmB1 K1J7atEFppudy0ZAGTT74CWWSZOFNvZmp5fmx3gQ57r+aDi4ds1YnFpCHMXmr6N0gfxilm 681jP0FDbb9+5mmw8HmY+QqF9KHFKPjwvj6EInf7WCXZMXmGco6+x4Fj6JAuBsX/HPhxNd 7Oobglv06fr7QmHHII3rrLKoDU5jYPPVDlVzLAQuF2XP+X9pZs9HG5rvMuRqRw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240798 Archived-At: Philip Kaludercic writes: > Yes, and I began implementing a different approach (as mentioned on the > emacs-devel thread), which I have since abandoned. If you haven't > written anything yet, and don't insist on it, I could propose to start > sketching out your suggestions. Sure! I was thinking we could start from a very basic command, call it `vc-prepare-patch` as per your suggestion. Since VC uses generics, we can dispatch to backend-specific implementations, something like this, with Git: 1. `M-x vc-prepare-patch` 2. Dispatch to `vc-git-prepare-patch` 3. Git wants a revision range, so interactively prompt for that (e.g. `HEAD^`, `abcd1234..ghjk5678`, or `-1`) 4. `call-process` to `git format-patch $REV`, and so forth, get the list of files. 5. Loop each file in `message-mode`. `C-c C-c` sends and goes to the next patch, `C-c C-k` cancels the whole thing. Once the file opens in message-mode, most likely we need to strip the magic From header from the beginning of the mail. Then we ensure don't do any nasty whitespace removal or wrapping. Most likely, depending on the backend, we should not require any parameters besides the "set of changes". For instance, in Git you can configure `git-format-patch` in the git configuration for several attributes, like --to=, --annotate, --prefix, etc. I don't remember how Mercurial works with this. Probably similar. It should generate mbox entries as well, I think. -- Antoine Kalmbach