All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: gitweb chokes on recursive symlink
Date: Sat, 28 Jul 2007 00:57:21 +0200	[thread overview]
Message-ID: <200707280057.22311.jnareb@gmail.com> (raw)
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
[...]
> 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

      reply	other threads:[~2007-07-27 22:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-27  8:23 gitweb chokes on recursive symlink Junio C Hamano
2007-07-27 22:57 ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200707280057.22311.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.