GNU bug report logs - #65704
29.1; Most code of `project-ignores' seems to be dead code

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Sat, 2 Sep 2023 16:04:01 UTC

Severity: wishlist

Found in version 29.1

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 65704 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Damien Cassou <damien <at> cassou.me>, 65704 <at> debbugs.gnu.org
Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead
 code
Date: Sun, 3 Sep 2023 03:26:48 +0300
Hi Damien,

Thanks for the patch, pushed to master (with a few amendments in summary).

I'd like to backport it to emacs-29 as well, if Eli/Stefan don't mind.

On 02/09/2023 19:03, Damien Cassou wrote:
> Hi,
> 
> The function `project-ignores' starts like this:
> 
>    (cl-defmethod project-ignores ((project (head vc)) dir)
>      (let* ((root (nth 2 project))
>             backend)
>        (append
>         (when (and backend
>                    (file-equal-p dir root))
> 
> It seems to me that `backend' is always going to be nil at this point
> and thus the 25-line long `when' block will always return nil without
> doing anything.
> 
> Am I missing something?

Not much. Maybe just that that code path isn't exercised by any in-tree 
function if the backend is Git (with recent enough git installed) or Hg 
(the project-files method uses faster, specialized shell invocations), 
so that might be the reason why this was missed in testing.

Any chance you could tell us what made you notice the bug?




This bug report was last modified 1 year and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.