From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp
Newsgroups: gmane.emacs.bugs
Subject: bug#48471: 28.0.50;
Incorrect handling of `project-ignores' on macOS (BSD find?) if
project root is a directory name
Date: Mon, 17 May 2021 21:37:42 +0200
Message-ID: <53E1AC7F-1D49-4845-8DF6-4CB24BC15E6A@gmail.com>
References:
<7f9e984c-bea9-f55f-526a-680a9bb3f66b@yandex.ru>
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\))
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="33261"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 48471@debbugs.gnu.org
To: Dmitry Gutov
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 17 21:41:37 2021
Return-path:
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.92)
(envelope-from )
id 1lij7Q-0008V1-SM
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 May 2021 21:41:36 +0200
Original-Received: from localhost ([::1]:49862 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1lij7P-00086x-Ut
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 May 2021 15:41:35 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56894)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1lij3y-0001NB-Ms
for bug-gnu-emacs@gnu.org; Mon, 17 May 2021 15:38:04 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:42292)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1lij3x-0003Fw-Ol
for bug-gnu-emacs@gnu.org; Mon, 17 May 2021 15:38:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1lij3x-0001Cp-KO
for bug-gnu-emacs@gnu.org; Mon, 17 May 2021 15:38:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 17 May 2021 19:38:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 48471
X-GNU-PR-Package: emacs
Original-Received: via spool by 48471-submit@debbugs.gnu.org id=B48471.16212802724618
(code B ref 48471); Mon, 17 May 2021 19:38:01 +0000
Original-Received: (at 48471) by debbugs.gnu.org; 17 May 2021 19:37:52 +0000
Original-Received: from localhost ([127.0.0.1]:53838 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1lij3n-0001CQ-VQ
for submit@debbugs.gnu.org; Mon, 17 May 2021 15:37:52 -0400
Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:40856)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1lij3l-0001CC-Kk
for 48471@debbugs.gnu.org; Mon, 17 May 2021 15:37:50 -0400
Original-Received: by mail-wr1-f41.google.com with SMTP id z17so7624221wrq.7
for <48471@debbugs.gnu.org>; Mon, 17 May 2021 12:37:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:subject:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to;
bh=hs8PLeVQ6ynkRkreGbnXA1VIRQtK8BofjHerVn7B+Eo=;
b=rSQGClEp6Rb4HY7zzi83XoKFFeM2wt+oGC/Nxhm5AfVefDL6YNifqTKYG3DVMC+orW
3/HoKw2Z/iuSHd4wYWko1Yt+wYLcUL3mc7p+wzxpKa4UzIs8AQmhUx1e9A4MZNgkYiuQ
TOO6Upmg1fMElUU3Evct/1wyXLZXLl0ciFGXE4Wpwm9He3DaDXLlaovcayfEB1shP/5h
xcW13VPse53SpTsmnqNQABRyFvu3ayB7ZdKLfSfd7od2G4mWH00+VbDrSEdNm4wO3FAW
GJxLNaliSSjAZEawTHD7MkXhFRG8W3bOprPSa2wSlKWZMXJqBjPeV23hOnfujZ/1skjC
z9zg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to;
bh=hs8PLeVQ6ynkRkreGbnXA1VIRQtK8BofjHerVn7B+Eo=;
b=ijuvKrBU1LrYjP8bBGatTbQhf1zvHrW526dj/RBEa/qPz/ZO7QMXXYjg7jWC+mELkw
95DAAt07O3iPMY0SxbgH75zlfi7Pjo1VxbBn2ANrAEuAF14BRB0h6lVfnVUFjxnb3VtK
ZiXwxLZsLZm3TW8nbjbQZlbk3CNP5Ht0Pp/vJPX1iraXRYO/4hXAaaIJ2OW8F7WQoCzV
xa/2xVGbGxOkFuVU50IhoIc4DopwsrNaibVMn19OyGR8tGxTZULNTmBJSV9aHmQxH/UF
R4l80Ltvvu2n5fazsa9VdpBPYFT58mPHQp3F61XvivQ/HYa/Py5+iENj4UIPe+tOip4P
6aeg==
X-Gm-Message-State: AOAM532fGpQE3lCQQVFMaHK1hwAFu4gkK3HwnIu1sM3NzRnE6HGVfjI0
H+CEJasCtRppOD3h3uMKic0=
X-Google-Smtp-Source: ABdhPJy4NfHvNdDhvl0OLgTdLezxPxGyl1l4Bh9BUl9r2MB9pW5UrArBoRzSLcGatspOhJnIqFy5GA==
X-Received: by 2002:a5d:4574:: with SMTP id a20mr1546035wrc.188.1621280263765;
Mon, 17 May 2021 12:37:43 -0700 (PDT)
Original-Received: from smtpclient.apple ([46.128.198.100])
by smtp.gmail.com with ESMTPSA id v10sm21221105wrq.0.2021.05.17.12.37.43
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Mon, 17 May 2021 12:37:43 -0700 (PDT)
In-Reply-To: <7f9e984c-bea9-f55f-526a-680a9bb3f66b@yandex.ru>
X-Mailer: Apple Mail (2.3654.80.0.2.43)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.io gmane.emacs.bugs:206744
Archived-At:
> Am 17.05.2021 um 02:23 schrieb Dmitry Gutov :
>=20
> Hi!
>=20
> On 16.05.2021 23:05, Philipp wrote:
>> To work around this, XRef should probably only pass directory file =
names
>> to find, not directory names, at least on macOS.
>=20
> Could you track down the piece of code that's misbehaving? Maybe with =
a little edebug-ing.
>=20
> I don't have any BSD find at hand, but
>=20
> (xref--find-ignores-arguments '("./bar") "/tmp/foo/")
>=20
> returns
>=20
> "\\( -path /tmp/foo/bar \\) -prune -o "
>=20
> here.
Yes, and that's the problem. macOS find compares the "-path" value =
against /tmp/foo//bar (note the double slash), and that doesn't match. =
The exact shell command generated by project--files-in-directory is:
find /tmp/foo/ \( -path /tmp/foo/bar \) -prune -o -type f -print0
And that doesn't work on macOS:
$ find /tmp/foo/ \( -path /tmp/foo/bar \) -prune -o -type f -print
/tmp/foo//baz
/tmp/foo//bar
This needs to be either "find /tmp/foo ..." (no trailing slash) or =
"-path /tmp/foo//bar" (double slash). However, the latter than fails =
with GNU find:
$ gfind /tmp/foo/ \( -path /tmp/foo//bar \) -prune -o -type f -print
/tmp/foo/baz
/tmp/foo/bar
So probably it's better to use the former option. That works with both =
both macOS find and GNU find:
$ find /tmp/foo \( -path /tmp/foo/bar \) -prune -o -type f -print
/tmp/foo/baz
$ gfind /tmp/foo \( -path /tmp/foo/bar \) -prune -o -type f -print
/tmp/foo/baz
There's a comment in project--files-in-directory ";; In case DIR is a =
symlink." Probably the command should use the -H option instead.
>=20
> Also, your return value of (project-files 'foo) seems to indicate that =
you're using the version of project.el that doesn't include the commit =
665b4e7c4e093391a353506e7b2385f0902db70b. Please see if it fixed this =
problem as well.
This was a build from yesterday, it should definitely include that =
commit.=