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

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

 



On 9/13/07, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> 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.

The ref_item class was originally intended to be used to differentiate
between local and remote heads by using CSS classes (which do not have
the 's'), instead of collecting them in separate lists.

My second thought was to use them to group refs, but I found it more
logical to do it by using the refname only (git_split_heads_body).

I guess I can remove it, unless I can think of some other use for it.

Oh, and the @class in git_get_heads_list is just the name of the
directory under refs/, so I should probably just rename the variable
to something else.

-- 
Giuseppe "Oblomov" Bilotta
-
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