unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: Philip Kaludercic <philipk@posteo.net>, Okamsn <okamsn@protonmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Adding the `prescient` packages to NonGNU ELPA?
Date: Tue, 22 Nov 2022 16:41:30 +0100	[thread overview]
Message-ID: <878rk3c7yt.fsf@bernoul.li> (raw)
In-Reply-To: <871qpydllo.fsf@posteo.net>

Philip Kaludercic <philipk@posteo.net> writes:

>> All of these packages live in the same repository in the link below.
>
> Would it be possible to change this?  E.g. by making each project live
> on it's own branch.  That would make the :ignored-files rules below a
> lot simpler.

When making such requests, we should think about the needs of all
involved parties.  We all have our own ideas of "best practices"
and sometimes these ideas are in conflict with each other and/or
convenience.

For the maintainers of a "main package" with "extension packages", it is
most convenient to keep these packages in a single repository; making
changes across more than one of the packages is easier that way.  Since
they work on these packages the most, their needs should come first, and
as far as I can tell, nobody tries to *force* them to do something else.

For most users it doesn't matter much.  [Non]GNU Elpa and Melpa take
care of distributing the extension packages separately, making sure that
users do not have to install any additional packages, which are only
needed by one of the extensions, unless they actually want to use those.

For Melpa it is trivial to split a repository into multiple packages.

[Non]GNU Elpa take a different approach when it comes to deciding which
files to include in package tarballs.  Where Melpa excludes everything
except certain files, [Non]GNU Elpa include everything except certain
files.  (I might be wrong about this, but I believe) [Non]GNU Elpa do
not have a default exclude list used for all packages.  As a
consequence, and even though they include more files, I believe their
file specifications tend to be more verbose.  [I don't intend to argue
here for one approach or the other, that isn't the question here.]

People involved in [Non]GNU Elpa pushing back harder against putting
extensions in the same repository as the main package than the Melpa
folks, is probably an indicator that dealing with such bundling is more
work for them.

But AFAIK it cannot be *that* much more work, that it would justify by
itself, to ask package maintainers to take on even more additional work
by splitting up their repositories, and to implying in those requests
that doing so is a best practice that will benefit everyone.

If package maintainers are willing to split up their repositories, even
though it means more work for them, that is fine by me.  (Here too, it
isn't *that* much additional work, and I agree that if we all had
infinite time, this clearly would be the best way of doing it.)  But I
don't think splitting things up to the extreme should be described as an
unquestionable best practice; after all emacs.git itself bundles a lot
of unrelated packages in the same repository.  [Off topic and maybe a
bit surprising: I would be in favor of splitting up emacs.git more, but
let's not get into that here.]

I should note that I am aware that the work is not done by once writing
the file include/exclude rules when the multiple packages that are
maintained in a single repository are first added.  The later addition
of yet another library/package can make it necessary to adjust those
existing rules.  But I don't think this is a huge burden and that it is
small compared to the additional work that you are asking package
maintainers to take on by splitting up their repositories.

Another drawback of main+extension repositories from the perspective of
[Non]GNU Elpa is that it makes it necessary for elpa-admin.el to
checkout the same repository multiple times.  I think this is a small
drawback and I would recommend that just ignore it.  Otherwise it is an
internal tooling issue that shouldn't concern package maintainers;
elpa-admin.el could, for example, be taught to clone the repository just
once and to use a separate worktree for each package.

Moving to another interested party, the Emacsmirror, which I maintain.
The Emacsmirror provides a superset of the packages in any one of the
elpas, or all elpas taken together for that matter.  A consequence of
that is that it has to deal with a lot more diverging practices, and
that the various elpas promote in some cases competing best practices.

Also, because the benefits of the Emacsmirror are less obvious I am in
a weaker position when requesting changes from packages maintainers,
compared to people maintaining an elpa.  But since we are nevertheless
in a similar boat, I appreciate it, when the maintainers of the elpas
take the needs of the Emacsmirror into account.

The Emacsmirror itself does not even attempt splitting up repositories
that contain multiple packages.  It mirrors repositories.  Ideally one
repository contains one package, but that isn't always the case and
trying to change it would be an uphill battle, which could never be won.
I have been fighting some other uphill battles for years, but ultimately
I often have no choice but to accept that package maintainers do things
that I think are not ideal or even wrong.

Nowadays, for the most part, the Emacsmirror learns about new packages
to mirror, by importing the lists of package recipes/specifications of
the various elpas.  Because the elpas do sometimes build multiple
packages from a single repository, duplicates appear in those lists
(from the mirror's perspective) and I have to make sure to not add the
same repository twice.

This is where this recommendation becomes problematic:

> E.g. by making each project live on it's own branch.

The current Emacsmirror code cannot deal with this special case.  It
wouldn't be hard to support it, but so far I had no reason to implement
that.  There is *a single* package that currently does this (as a result
of Stefan Monnier asking its maintainer to do so).

The Straight package manager apparently cannot deal with this either.  I
would assume that it wouldn't be hard to implement support, but here too
it does not make much sense to do so for the benefit of a single package
that wants to do things differently.

My own package manager, Borg, follows the lead of the Emacsmirror.  It
clones the main-package+extensions repository as-is.  Users have to
explicitly exclude the extensions that they are not interested in, or
they get compilation errors.  This might sound not very user-friendly to
those who don't use Borg, but in practice it works well; Borg is just
more picky about who its friends are (but that isn't the topic here).

As I have said before, I agree that ideally extensions to a main package
would be maintained in separate repositories, but also that this means
more work for the maintainers, and if they don't want to do it because
of that, then that should be accepted.

I have one additional request: When you encourage package maintainers to
split up their repositories, then do NOT recommend that they put the
separate packages into separate branches of the SAME repository.

Instead ask them to use separate repositories altogether.  Except for
the small additional initial need to create the separate repositories,
this should not be any more work than using merely separate branches.

Merely using separate branches is a half measure, that doesn't really
benefit anyone.  Various tools that deal with emacs packages currently
don't support it.  Setting up the branches requires knowing or learning
about orphan branches.  Checking out multiple packages requires either
cloning the same repository multiple times, or knowing or learning how
to use multiple worktrees.

     Jonas



  parent reply	other threads:[~2022-11-22 15:41 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20  3:27 Adding the `prescient` packages to NonGNU ELPA? Okamsn
2022-11-20  9:24 ` Philip Kaludercic
2022-11-20 11:23   ` Stefan Kangas
2022-11-20 15:19     ` Stefan Monnier
2022-11-20 15:41       ` Philip Kaludercic
2022-11-21 21:17         ` Richard Stallman
2022-11-22 13:53           ` Akib Azmain Turja
2022-11-23 23:12             ` okamsn
2022-11-26  0:50               ` Richard Stallman
2022-11-20 17:10   ` Visuwesh
2022-11-20 18:39     ` Stefan Monnier
2022-12-16  9:41     ` North Year
2022-12-16 19:25       ` Philip Kaludercic
2022-12-17  3:28         ` Stefan Monnier
2022-12-17  9:17           ` Philip Kaludercic
2022-12-17 15:52             ` Stefan Monnier
2022-12-17 16:07               ` Philip Kaludercic
2022-12-17 16:24                 ` Philip Kaludercic
2022-12-17 18:01                   ` Okamsn
2022-12-17 18:08                     ` Philip Kaludercic
2022-12-17 18:39                     ` Stefan Monnier
2022-12-20  1:32                       ` Okamsn
2022-12-20  3:10                         ` Stefan Monnier
2022-11-20 17:42   ` Okamsn
2022-12-05  0:27     ` Okamsn
2022-12-05 15:21       ` Stefan Monnier
2022-12-09  3:58         ` Okamsn
2022-12-09 15:08           ` Stefan Monnier
2022-12-09 15:27             ` Philip Kaludercic
2022-12-10  4:10             ` Richard Kim
2022-12-10 15:12               ` Stefan Monnier
2022-12-10 16:38                 ` Richard Kim
2022-12-10 17:44                   ` Stefan Monnier
2022-12-05 17:21       ` Philip Kaludercic
2022-12-16  2:04         ` Okamsn
2022-12-16 19:26           ` Philip Kaludercic
2022-11-22 15:41   ` Jonas Bernoulli [this message]
2022-11-22 21:09     ` Stefan Monnier
2022-11-23  9:56       ` Jonas Bernoulli
2022-11-23 12:33         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rk3c7yt.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=emacs-devel@gnu.org \
    --cc=okamsn@protonmail.com \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).