bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eli Zaretskii
Subject: bug#37215: [PATCH] vc-cvs-ignore writes absolute filenames and duplicate strings
Date: Thu, 13 Feb 2020 21:36:29 +0200

> From: Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
> Date: Thu, 30 Jan 2020 20:44:00 +0100
> Cc: 37215@debbugs.gnu.org
> 
> >> -(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?
> It is for `file` equal to "foo" (a simple basename).
> >   In what circumstances does that evaluate to something other
> > than "foo"?
> If "foo" is something other than a simple basename (see below).
> >   That is, what DIRECTORY is doesn't seem to matter, if I'm
> > reading this right?
> 
> Your assumption, that `file` is always a simple basename is wrong.

Yes, but when does it make sense to have FILE not absolute and not
just a basename (i.e. with leading directories)?  Do we have such use
cases?  Because if that happens, the file's name will be added to
.cvsignore not in DIRECTORY but in one of its subdirectories.  Would
that be surprising?  And if so, perhaps we should warn about that or
even error out?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]