git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Paul Mackerras <paulus@samba.org>
Cc: git@vger.kernel.org
Subject: Re: gitk changing line color for no reason after merge
Date: Tue, 07 Feb 2006 00:18:37 -0500	[thread overview]
Message-ID: <1139289517.15955.23.camel@dv> (raw)
In-Reply-To: <1138900897.28967.18.camel@dv>

Hello!

Sorry for replying to myself, but there is nobody else to reply to.

> I think it would be much better if line colors only change at
> non-trivial nodes, i.e. those with more than one child or parent.

I didn't realize that the colors correspond to nodes, not branches.
Every node has one color that is used for lines to all of its children.
It would be much better to assign colors to "branches" consisting of
individual lines connecting nodes, but changing that would require many
changes in gitk.

> diff --git a/gitk b/gitk
> index f12b3ce..14ff570 100755
> --- a/gitk
> +++ b/gitk
> @@ -770,7 +770,7 @@ proc assigncolor {id} {
>  
>      if [info exists colormap($id)] return
>      set ncolors [llength $colors]
> -    if {$nparents($id) <= 1 && $nchildren($id) == 1} {
> +    if {$nchildren($id) == 1} {
>  	set child [lindex $children($id) 0]
>  	if {[info exists colormap($child)]
>  	    && $nparents($child) == 1} {
> 
> 

I still stand behind this patch because it eliminates color changes on
the nodes that have exactly one child and parent.  $nparents($id) is
irrelevant here, because it characterizes the current node, but the code
decides whether the line should change color at the child node.

However, further changes to reduce color changes didn't produce nice
results for me.  If I try to keep one color running as long as possible,
I get branches of the same color because, as I said, gitk uses the same
color for connections to all children.  So, every node on the branch
spurs branching lines of the same color, which can intersect or run
side-by-side.

I can submit this patch formally, but I hope to get some comments first.

-- 
Regards,
Pavel Roskin

  reply	other threads:[~2006-02-07  5:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-02 17:21 gitk changing line color for no reason after merge Pavel Roskin
2006-02-07  5:18 ` Pavel Roskin [this message]
2006-02-07  8:56   ` Paul Mackerras
2006-02-08  1:10     ` Pavel Roskin
2006-02-07 10:04   ` Junio C Hamano
2006-02-08  0:54     ` Pavel Roskin
2006-02-08  2:30       ` Paul Mackerras
2006-02-08 21:06         ` Pavel Roskin

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1139289517.15955.23.camel@dv \
    --to=proski@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).