Re: [PATCH 01/14] gitweb: get remotes too when getting heads list

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

 



Giuseppe Bilotta <giuseppe.bilotta@xxxxxxxxx> writes:

> @@ -2073,8 +2073,9 @@ sub git_get_heads_list {
>  		my ($hash, $name, $title) = split(' ', $refinfo, 3);
>  		my ($committer, $epoch, $tz) =
>  			($committerinfo =~ /^(.*) ([0-9]+) (.*)$/);
> -		$name =~ s!^refs/heads/!!;
> +		$name =~ s!^refs/(head|remote)s/!!;
>  
> +		$ref_item{'class'} = $1;
>  		$ref_item{'name'}  = $name;
>  		$ref_item{'id'}    = $hash;
>  		$ref_item{'title'} = $title || '(no commit message)';

This is mostly theoretical, but you may want to include the
final 's' in the 'class', so that you would not have to make the
code too complicated when we later add refs/floobl/ namespace
that acts like heads and remotes but does not end with an 's'.

Even your 3/14 uses @class that includes 's'.  It is better to
be consistent.

The true reason this is mostly theoretical is that I do not see
where $ref_item{'class'} is used (although I only spent a few
minutes looking at the entire series).  You seem to have some
more assignments in later patches but is there any place this
value is used?  If not, perhaps you do not need to keep this
hash item around in the first place.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux