emacs-devel
[Top][All Lists]
Advanced

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

Request for Feedback: Adding VC support to package.el


From: Philip Kaludercic
Subject: Request for Feedback: Adding VC support to package.el
Date: Mon, 14 Feb 2022 14:32:14 +0000

Hi,

I have just pushed a new branch (feature/package+vc) to emacs.git.  It
implements a `package-fetch' commands, that was proposed and discussed
on the mailing list last December and last August[1].  The main
difference when compared to `package-install' is that it doesn't
download and extract a tar archive/single .el file, but clones a remote
repository directly into ~/.emacs.d/elpa/devel.

To avoid depending on a specific VC, I have added a vc-clone function to
vc.el, and implemented a Git back-end.  There is certainly much that can
be discussed here, so I didn't want to waste too much time adding
implementations for other systems right now, but if this branch is to be
merged at some point, adding support for other applicable back-ends
should be done too.

Currently, you can pass `package-fetch' a URL, in which case it will try
to clone it directly, or you can pass it a package name, in which case
it will check if the package has a "VC" header, indicating the upstream
repository to clone.  My suggestion would be to extend elpa-admin to
insert this metadata into the archive-contents, so that each package on
the ELPAs can be `package-fetch'ed.

In case there are missing dependencies, they will be installed using
`package-install'.  The "source" package is then processed and activated
just as a regular package would be, with the minor difference that there
is no additional signature processing.  Packages are deleted by
`package-delete', just like any other package.

The current state is still primitive and probably unstable.  Missing
features might include:

- Checking if the user already has a regular install, that might be
  modified, and attempting to apply these changes to the VCS checkout.

- The ability to send local changes as patches to the maintainer of a
  package (I implemented a rough draft of how this could be use with the
  command `package-contact-maintainer', but I didn't figure out if VC
  allows for a generic way to prepare patches that could be attached to
  a message).

- Managing upgrades of potentially diverging source packages, preferably
  via the list-packages interface.

- Overloading `package-install to also allow installing source packages.
  My idea was that if `package-install' gets an s-expression as a
  package-name of the form (NAME :repo URL :rev REVISION), then it would
  defer the request to `package-fetch'.  The advantage here is that
  it would make it easier for macros like use-package or setup.el to
  handle both kinds of packages.

Either way, I would appreciate it if anyone who has the time could test
the code and see what works as expected and (more importantly) what
breaks it.  Adding this kind of a functionality would be a significant
step towards improving the practical, shared software freedom of Emacs
users, by reducing the barrier towards contributing their improvements
and extensions upstream. 

[0] https://mail.gnu.org/archive/html/emacs-devel/2021-12/msg02770.html
[1] https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00295.html

-- 
        Philip Kaludercic



reply via email to

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