From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_feed
Date: Sat, 19 May 2007 04:08:40 +0200 [thread overview]
Message-ID: <200705190408.40702.jnareb@gmail.com> (raw)
In-Reply-To: <7vtzu937t6.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> Initial (root) commit has no parents, and $co{'parent'} is
>> undefined. Use '--root' for initial commit.
>>
>> This fixes "Use of uninitialized value in open at gitweb/gitweb.perl
>> line 4925." warning.
[...]
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -4923,7 +4923,8 @@ XML
>>
>> # get list of changed files
>> open my $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
>> - $co{'parent'}, $co{'id'}, "--", (defined $file_name ? $file_name : ())
>> + $co{'parent'} || "--root",
>> + $co{'id'}, "--", (defined $file_name ? $file_name : ())
>> or next;
>> my @difftree = map { chomp; $_ } <$fd>;
>> close $fd
>
> I do not think you would need to make --root conditional...
I need at last make $co{'parent'} conditional, i.e. at least
"$co{'parent'} || ()" or equivalent (e.g. like for $file_name).
I cannot omit $co{'parent'} because parents might be rewritten;
feeds accept now path limiting. So why not this way?
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2007-05-19 2:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-19 0:47 [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_feed Jakub Narebski
2007-05-19 1:45 ` Junio C Hamano
2007-05-19 2:08 ` Jakub Narebski [this message]
2007-05-19 2:49 ` Junio C Hamano
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=200705190408.40702.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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.