Subject: bug#37215: [PATCH] vc-cvs-ignore writes absolute filenames and duplicate strings

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 22 Jan 2020 13:43:15 +0100

Wolfgang Scherer <[email-masked]> writes:

> Am 15.09.19 um 15:12 schrieb Lars Ingebrigtsen:
>> Wolfgang Scherer <[email-masked]> writes:
>>
>>> +        ;; FIXME this is a pcvs variable.
>>> +        (if (bound-and-true-p cvs-sort-ignore-file)
>>> +            (sort-lines nil (point-min) (point-max)))
>> Does it make sense to heed a pcvs variable here?  I think it would be
>> surprising that vc-cvs behaves differently depending on whether you've
>> loaded pcvs or not.
>
> Just to clarifiy: my patch does not introduce this FIXME. Only the
> indentation is changed. This question should be handled in a separate
> bug report.

Right; sorry.  Looking at the patch again, I don't quite get the logic here:

> -(defun vc-cvs-ignore (file &optional _directory _remove)
> -  "Ignore FILE under CVS."
> -  (vc-cvs-append-to-ignore (file-name-directory file) file))
> +(defun vc-cvs-ignore (file &optional directory _remove)
> +  "Ignore FILE under CVS.
> +FILE is either absolute or relative to DIRECTORY."
> +  (setq file (directory-file-name (expand-file-name file directory)))
> +  (vc-cvs-append-to-ignore (file-name-directory file) (file-name-nondirectory file)))

This is basically

(file-name-nondirectory (directory-file-name (expand-file-name "foo" directory)))

isn't it?  In what circumstances does that evaluate to something other
than "foo"?  That is, what DIRECTORY is doesn't seem to matter, if I'm
reading this right?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no