GNU bug report logs - #57400
29.0.50; Support sending patches from VC directly

Previous Next

Package: emacs;

Reported by: Antoine Kalmbach <ane <at> iki.fi>

Date: Thu, 25 Aug 2022 08:49:01 UTC

Severity: normal

Found in version 29.0.50

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Antoine Kalmbach <ane <at> iki.fi>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 57400 <at> debbugs.gnu.org
Subject: bug#57400: 29.0.50; Support sending patches from VC directly
Date: Fri, 26 Aug 2022 13:45:51 +0300
Philip Kaludercic <philipk <at> posteo.net> 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 <sha> <date> 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




This bug report was last modified 2 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.