unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ship Mints <shipmints@gmail.com>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 72300@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	Federico Tedin <federicotedin@gmx.de>
Subject: bug#72300: project.el: detect newly created project contained within another
Date: Mon, 30 Sep 2024 10:31:35 -0400	[thread overview]
Message-ID: <CAN+1HboyaPRbetLT7EMVg3G8M0cjn7kkskxQ41ojcH9C5GZZdg@mail.gmail.com> (raw)
In-Reply-To: <4ecab405-a03f-4dd7-af4b-f2d29b0420a4@gutov.dev>

[-- Attachment #1: Type: text/plain, Size: 2571 bytes --]

On Sun, Sep 29, 2024 at 9:50 PM Dmitry Gutov <dmitry@gutov.dev> wrote:

> On 13/08/2024 17:50, Ship Mints wrote:
> > As some food for thought, we've used git attributes via "git check-attr"
> > to record custom metadata at the repository level to provide hints to
> > tooling. As project.el and other tools evolve, perhaps we can consider
> > the cases where users can supply functions that influence behavior where
> > one use case is based on things like git attributes. The case in hand is
> > whether a submodule should be considered external to a project.el
> > project such as the vendor/third-party submodule I'd mentioned. We use
> > the default project-vc-merge-submodules t and our exceptions could be
> > encoded via a custom git attribute and indicated via a predicate
> > function, perhaps. In the absence of formal guidelines, and git does not
> > seem to define "reserved words" for naming, we prefix custom attributes
> > with an underscore.
>
> Git attributes is a possible approach, with a downside of extra process
> calls, which over Tramp (for example) would mean additional latency.
>

(defun project--value-in-dir (var dir) already incurs latency over tramp,
right?


> How about we just support filtering out submodules using the
> project-vc-ignores var? Which can be assigned in .dir-locals.el or
> through other means.
>

Seems simple. Perhaps an abnormal hook so people can customize buffer local
hook via dir locals? If they want to use git attributes, they could
integrate that approach as an added/replacement function. The function list
could default to a function that implements current behavior.


> I kind of hoped this would work automatically, it does not, but adding
> the extra comparisons against the list of ignores seems natural enough.
>
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index 599a350e5ce..79fcfb65f87 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -720,7 +731,9 @@ project--vc-list-files
>            (let ((sub-files
>                   (mapcar
>                    (lambda (module)
> -                   (when (file-directory-p module)
> +                   (when (and (file-directory-p module)
> +                              ;; TODO: Support real globs.
> +                              (not (member module extra-ignores)))
>                        (let ((sub-files
>                               (project--vc-list-files
>                                (concat default-directory module)
>
>

[-- Attachment #2: Type: text/html, Size: 3676 bytes --]

  reply	other threads:[~2024-09-30 14:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25 19:54 bug#72300: project.el: detect newly created project contained within another Federico Tedin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-04  8:15 ` Eli Zaretskii
2024-08-05 17:18   ` Ship Mints
2024-08-05 19:56     ` Federico Tedin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-13  1:43     ` Dmitry Gutov
2024-08-13 13:31       ` Ship Mints
2024-08-13 14:50         ` Ship Mints
2024-09-30  1:50           ` Dmitry Gutov
2024-09-30 14:31             ` Ship Mints [this message]
2024-09-30  1:35         ` Dmitry Gutov

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=CAN+1HboyaPRbetLT7EMVg3G8M0cjn7kkskxQ41ojcH9C5GZZdg@mail.gmail.com \
    --to=shipmints@gmail.com \
    --cc=72300@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    --cc=federicotedin@gmx.de \
    /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).