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

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

 



Thomas Kolejka wrote:

> Hello,
> 
> with the following patch there are different colours for tags
> and heads in gitweb. So you can easily differentiate between 
> them.
> 
> Commit ca9e3b124f6313187da641b5cd55100c4ade6a9a

Based on which branch? Master, next? Which commit?

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, but some people use "-- >8 --" 'scissors' separator).
git-format-patch helps in correct formatting, and adds diffstat.

You would also be most probably asked to sign your patches, i.e.
add
  Signed-off-by: Thomas Kolejka <Thomas.Kolejka@xxxxxx>
line at the end of commit message.


I have send patch of similar nature:
  "[PATCH 5/5] gitweb: Change appereance of marker of refs pointing to given object"
  http://permalink.gmane.org/gmane.comp.version-control.git/24860
in which I split marker for refs poining to given object into
separate span elements. The patch was dropped because it followed
first version of "Great subroutine renames" patch.

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.

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). 


[*1*] Do you have better proposal for this name? Perhaps
format_referencing_marker, or just format_marker?

---
>  # format marker of refs pointing to given object
>  sub git_get_referencing {
> -     my ($refs, $id) = @_;
> +     my ($refs, $id, $class) = @_;
>  
>       if (defined $refs->{$id}) {
> -             return ' <span class="tag">' . esc_html($refs->{$id}) . '</span>';
> +             return " <span class=\"$class\">" . esc_html($refs->{$id}) . "</span>";
>       } else {
>               return "";
>       }
[...]
> -     my ($revlist, $from, $to, $refs, $extra) = @_;
> +     my ($revlist, $from, $to, $refs, $heads, $extra) = @_;
[...]
> -             #my $ref = defined $refs ? git_get_referencing($refs, $commit) : '';
> -             my $ref = git_get_referencing($refs, $commit);
> +             #my $ref = defined $refs ? git_get_referencing($refs, $commit, "tag") : '';
> +             my $ref = git_get_referencing($refs, $commit, "tag");
> +             my $head = git_get_referencing($heads, $commit, "head");

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


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