unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Request for Feedback: Adding VC support to package.el
@ 2022-02-14 14:32 Philip Kaludercic
  0 siblings, 0 replies; only message in thread
From: Philip Kaludercic @ 2022-02-14 14:32 UTC (permalink / raw)
  To: emacs-devel


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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-14 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 14:32 Request for Feedback: Adding VC support to package.el Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).