Re: [PATCH] gitweb: Different colours for tags and heads

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

 



Jakub Narebski <jnareb@xxxxxxxxx> writes:

> By the way, please do not put "Hello," in the commit message
> part of patch. You can put your comments (like which branch
> and/or commit is the batch based on) either after "---" and
> before the patch itself, or at the beginning and separate them
> from the commit message by "+++" (this separator is supported
> by git tools,...

???

> I've planned on patch which does something similar to
> yours, but in slightly different way: instead of two calls 
> to git_get_referencing (format_mark_referencing[*1*] after rename)
> and two calls to read_info_ref (git_get_references after rename)
> in your patch, read_info_ref would always add full name, of
> which first component is the type of the tag.

get_referencing to get, and format_ref to format perhaps?

> I am wondering if to do this like in my abovementioned patch,
> putting references in single string, separated by ':' (':' cannot
> be part of valid ref name), or use array (anonymous array reference
> to be more exact). 

Two things and half come to mind.

get_referencing could get and return the full refname without
abbreviation ('heads/jn/web' or 'tags/v1.0'), and the caller can
do whatever with them (e.g. see what the name begins with to
tell heads and tags apart).  This is probably the most flexible
if we do not want to cast the categorization of refs in stone.

Otherwise, return an arrayref, like ['tag', 'v1.0', 'v1.0'] or
['head', 'web', 'jn/web'], to say what kind, short name and full
name.

I've always wondered if the span that shows the short refname
could have an on-hover pop-up (title attribute is often shown
that way) to show the full name.  Then you could do something
like:

    $long_name = 'heads/jn/web'; # or 'tags/v1.0'
    $kind = ($long_name =~ /^heads/) ? 'head' : 'tag';
    $long_name = s|^[^/]*/||;
    ($short_name = $long_name) =~ s|.*/||;
    $long_name = esc_html($long_name);
    $short_name = esc_html($short_name);
    return " <span class='$kind' title='$long_name'>$short_name</span>";

-
: 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]