unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21535: 25.0.50; vc-follow-symlinks=ask is ineffective for directory links
@ 2015-09-22 20:00 Johan Bockgård
  2020-12-03 11:01 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Bockgård @ 2015-09-22 20:00 UTC (permalink / raw)
  To: 21535


When `vc-follow-symlinks' is `ask' (the default) Emacs follows links for
files under version control, but fails to ask before doing so when any
parent directory is a symlink.

E.g.
/x/y/link  (asks)
/x/link/z  (doesn't ask)

The following commit changed two occurrences of `file-chase-links' to
`buffer-file-truename' in vc-hooks.el. A third occurrence of
file-chase-links was left alone however, which fools the querying logic
for files where the directory part of the name contains symlinks.


commit 33f95a82e97cac000a98dc5b1100ad7a095e12d3
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Sat Nov 22 05:23:42 2008 +0000

    (vc-follow-link, vc-find-file-hook):
    Use buffer-file-truename to handle symlinks in any part of the filename.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#21535: 25.0.50; vc-follow-symlinks=ask is ineffective for directory links
  2015-09-22 20:00 bug#21535: 25.0.50; vc-follow-symlinks=ask is ineffective for directory links Johan Bockgård
@ 2020-12-03 11:01 ` Lars Ingebrigtsen
  2020-12-06 22:55   ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-03 11:01 UTC (permalink / raw)
  To: Johan Bockgård; +Cc: 21535

Johan Bockgård <bojohan@gnu.org> writes:

> When `vc-follow-symlinks' is `ask' (the default) Emacs follows links for
> files under version control, but fails to ask before doing so when any
> parent directory is a symlink.
>
> E.g.
> /x/y/link  (asks)
> /x/link/z  (doesn't ask)
>
> The following commit changed two occurrences of `file-chase-links' to
> `buffer-file-truename' in vc-hooks.el. A third occurrence of
> file-chase-links was left alone however, which fools the querying logic
> for files where the directory part of the name contains symlinks.

(This bug report unfortunately got no response at the time.)

Some work has been done on vc/symlinks since this bug was reported, so
this may or may not have been fixed in the development version of
Emacs.  Are you still seeing this there?

If so, could you provide a script that sets up a directory structure
that demonstrates the bug?

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#21535: 25.0.50; vc-follow-symlinks=ask is ineffective for directory links
  2020-12-03 11:01 ` Lars Ingebrigtsen
@ 2020-12-06 22:55   ` Glenn Morris
  2020-12-07 14:57     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2020-12-06 22:55 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 21535, Johan Bockgård


Maybe:

cd /tmp
mkdir git
cd git
touch 1
git init
git add .
git commit -m "c1"
cd /tmp
ln -s git/1
ln -s git git2

emacs -Q /tmp/1
 -> "Symbolic link to Git-controlled source file; follow link?"

emacs -Q /tmp/git2/1
 -> no prompt

I don't think I see why that matters though, so maybe not the right example.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#21535: 25.0.50; vc-follow-symlinks=ask is ineffective for directory links
  2020-12-06 22:55   ` Glenn Morris
@ 2020-12-07 14:57     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-07 14:57 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 21535, Johan Bockgård

Glenn Morris <rgm@gnu.org> writes:

> Maybe:
>
> cd /tmp
> mkdir git
> cd git
> touch 1
> git init
> git add .
> git commit -m "c1"
> cd /tmp
> ln -s git/1
> ln -s git git2

Thanks!

> emacs -Q /tmp/1
>  -> "Symbolic link to Git-controlled source file; follow link?"
>
> emacs -Q /tmp/git2/1
>  -> no prompt
>
> I don't think I see why that matters though, so maybe not the right example.

I think that's the correct recipe for the issue described.

And it does seem rather odd, doesn't it?  In both cases, we're following
a symlink, but we only get the warning in the first case?

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-22 20:00 bug#21535: 25.0.50; vc-follow-symlinks=ask is ineffective for directory links Johan Bockgård
2020-12-03 11:01 ` Lars Ingebrigtsen
2020-12-06 22:55   ` Glenn Morris
2020-12-07 14:57     ` Lars Ingebrigtsen

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).