all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Fabián E. Gallina" <fgallina@gnu.org>, emacs-devel@gnu.org
Subject: Re: [elpa] master 872014e: Prevent accidental deletion of .git
Date: Thu, 26 Nov 2015 09:34:23 -0500	[thread overview]
Message-ID: <m3d1uw4yog.fsf@fitzsim.org> (raw)
In-Reply-To: <jwv8u5lv35q.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Wed, 25 Nov 2015 22:55:09 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> We'd also want to try and fix the directory-deletion code accordingly,
>>> so it's less trigger happy.
>> I've been looking at how to do this, but I'm not sure exactly what
>> you're after.  The following is from the perspective of "in place"
>> development.
>
> Yes, that's the important case.

BTW, I found myself being more focused on the "in place archive" use
case.  That's how I ended up invoking the process-archive target
directly which indirectly deleted .git (this is the one my patch now
prevents).

I think the default "make" target should also generate the archive
directory so that one can always test "what will be published" with:

rm -rf test-home && mkdir test-home && HOME=`pwd`/test-home $TARGET -Q \
    --eval \
    "(setq package-archives '((\"local\" . \".../elpa/archive/packages\")))"

Then one can test dependency resolution, byte-compilation and
compatibility on the "target Emacs" -- I test Emacs 24.1 through 24.5
and master.  Testing just against the default emacs on PATH (what "make"
does right now) is OK for development, but GNU ELPA should encourage
backward and forward compatibility.

>> There are lots of points where directory deletion happens in GNUmakefile
>> and archive-contents.el, during both "make externals" and "make
>> archive".
>
> Deletion in "make archive" is not a problem, AFAICT.
>
>> As for "make externals", I don't really like the concept of it, because
>> it mixes the build process with source configuration management.  For
>> example, this directory deletion could remove in-progress work from my
>> source directory, under elpa/packages:
>
> Exactly.
>
>>    ;; Check if `dir' is under version control.
>>    ((not (zerop (call-process "git" nil nil nil
>>                               "ls-files" "--error-unmatch" dir)))
>>     (message "Deleted untracked package %s" dir)
>>     (delete-directory dir 'recursive t))
>>
>> I would never expect that when invoking make.  I would rather "git
>> status" tell me that I have untracked changes.
>
> Yes, this is the problematic case.  This case is the one that intends to
> handle the situation where we removed a :core package from
> externals-list.
>
> Presumably the call-process check should make sure this directory is not
> under Git control at all, so no amount of "git status" will help.
>
> So here, instead of delete-directory we should use a new function which
> is a lot more careful, so it only deletes data which it has earlier
> created for a :core package.  If the :core packages are handled via
> symlinks, then this can be done by checking that the directory only
> contains symlinks (or subdirs with the same property).  Of course there
> are other ways, such as keeping track somewhere of the files we've
> installed as :core, and then check this info before we delete files.

OK, I'll work on this.

>> I didn't closely follow the discussions while this was being designed.
>> Was there some reason to avoid git submodules?
>
> "git submodules" could make sense (and I did consider them) for
> the :external packages, but these aren't affected by this code (since
> the call-process should indicate that they are under Git).
>
>> It seems possible to replace "make externals" with submodules that
>> track "remote" externals/ branches of elpa.git itself, with git >=
>> 1.8.2.
>
> IIRC the issue with git submodules is that they have to refer to
> a particular revision rather than to a branch, so additionally to
> committing new code on the external branch, you'd then have to go and
> commit a change to master that updates the submodule reference to point
> to the new revision at the head of the external branch.

That was true at one point but it looks like git 1.8.2 introduced the
notion of "remote-tracking branch submodules".  Maybe I'll experiment
with how that could work for elpa.git.

Thomas



  reply	other threads:[~2015-11-26 14:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151109013124.17711.29422@vcs.savannah.gnu.org>
     [not found] ` <E1ZvbIq-0004cL-VV@vcs.savannah.gnu.org>
2015-11-09  1:58   ` [elpa] master 872014e: Prevent accidental deletion of .git Stefan Monnier
2015-11-09  4:49     ` Thomas Fitzsimmons
2015-11-09  5:03       ` Stefan Monnier
2015-11-09 16:07         ` Eli Zaretskii
2015-11-09 16:38           ` Artur Malabarba
2015-11-09 16:45             ` Eli Zaretskii
2015-11-09 20:20               ` Stefan Monnier
2015-11-18 14:39         ` Thomas Fitzsimmons
2015-11-18 15:10           ` Stefan Monnier
2015-11-18 16:44             ` Stephen Leake
2015-11-18 17:35             ` Eli Zaretskii
2015-11-26  3:08             ` Thomas Fitzsimmons
2015-11-26  3:55               ` Stefan Monnier
2015-11-26 14:34                 ` Thomas Fitzsimmons [this message]
2015-11-26 15:42                   ` Stefan Monnier
2015-11-27  6:58                     ` Thomas Fitzsimmons
2015-11-27 15:27                       ` 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

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

  git send-email \
    --in-reply-to=m3d1uw4yog.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=emacs-devel@gnu.org \
    --cc=fgallina@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.