git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitweb chokes on recursive symlink

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 27, 2007, 22:57 UTC
Message-ID
<200707280057.22311.jnareb@gmail.com>
In-Reply-To
<7v8x922r2w.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
[cut explanation about why one would want something like below]
 
> 	ln -s /pub /pub/pub
[...]
Show 24 quoted lines
> However, gitweb chokes if there is such a symlink (File::Find
> barfs with "/pub/pub is a recursive symbolic link" --- I think
> this is because you use "follow_fast => 1").
> 
> As I happen to think using a symlink that goes up for backward
> compatible URL support is a rather common practice, I think we
> should do something about it.  My gut feeling is that we could
> simply ignore such symlinks.
> 
> What do you think about this issue?
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index b381692..c8ad84e 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -1492,6 +1492,7 @@ sub git_get_projects_list {
>  
>  		File::Find::find({
>  			follow_fast => 1, # follow symbolic links
> +			follow_skip => 2, # ignore duplicates
>  			dangling_symlinks => 0, # ignore dangling symlinks, silently
>  			wanted => sub {
>  				# skip project-list toplevel, if we get it.
> 
I guess that is a good solution, but I'm not Perl expert...
-- 
Jakub Narebski
Poland
Previous: Junio C Hamano
Message 2 of 2 in “gitweb chokes on recursive symlink”
  1. Junio C HamanoJul 27, 2007
  2. Jakub NarebskiJul 27, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.