git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allan Caffee <allan.caffee@gmail.com>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Jeff King <peff@peff.net>, Nanako Shiraishi <nanako3@lavabit.com>
Subject: Re: [PATCH] graph API: Added logic for colored edges
Date: Thu, 9 Apr 2009 18:08:16 -0400	[thread overview]
Message-ID: <20090409220816.GA8234@linux.vnet> (raw)
In-Reply-To: <87hc0x7lpg.fsf@iki.fi>

On Thu, 09 Apr 2009, Teemu Likonen wrote:
> On 2009-04-07 14:57 (-0400), Allan Caffee wrote:
> 
> > Modified the graph drawing logic to colorize edges based on
> > parent-child relationships similiarly to gitk.
> 
> I like the colored graph very much, thanks. Unfortunately there are some
> problems with aligning of log messages and headers. For example, try
> this in git.git repository:
> 
> 
> $ git log -1 --graph 796b137
> 
> *   commit 796b13781aecce551b8f92049a66646e60f31dce
> |\ Merge: 6da14ee db12d97
> | | Author: Junio C Hamano <gitster@pobox.com>
> | | Date:   2009-04-08 23:41:27 -0700
> 
> 
> Without colors or without your patch the alignment is correct:
> 
> $ git log -1 --graph --no-color 796b137
> 
> *   commit 796b13781aecce551b8f92049a66646e60f31dce
> |\  Merge: 6da14ee db12d97
> | | Author: Junio C Hamano <gitster@pobox.com>
> | | Date:   2009-04-08 23:41:27 -0700
> 
> 
> (Perhaps the "Merge:" header could have two spaces befor the data, but
> this is  unrelated to --graph.)

Thanks for the feedback!  The problem here is that
graph_horizontal_padding was counting the number of characters in the
strbuf in order to decide how much whitespace to pad the row with.  The
ANSI escape sequences for colors and attributes are not printable
characters but do contribute to the length of the strbuf.  This can be
fixed by adding a new function that counts only printing
characters/spaces.  I'll include this in my next round.  

      reply	other threads:[~2009-04-09 22:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090331235922.GA7411@linux.vnet>
2009-04-07 18:57 ` [PATCH] graph API: Added logic for colored edges Allan Caffee
2009-04-08  7:59   ` Junio C Hamano
2009-04-08 21:41     ` Allan Caffee
2009-04-09  0:29       ` Junio C Hamano
2009-04-09 22:22         ` [PATCH v3] " Allan Caffee
2009-04-12  8:44           ` Junio C Hamano
2009-04-12 17:43             ` Allan Caffee
2009-04-12 18:45               ` Junio C Hamano
2009-04-12 20:27                 ` [PATCH v4] " Allan Caffee
2009-04-12 21:59                   ` Junio C Hamano
2009-04-13 19:53                     ` [PATCH v5] " Allan Caffee
2009-04-09 17:58   ` [PATCH] " Teemu Likonen
2009-04-09 22:08     ` Allan Caffee [this message]

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

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

  git send-email \
    --in-reply-to=20090409220816.GA8234@linux.vnet \
    --to=allan.caffee@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=nanako3@lavabit.com \
    --cc=peff@peff.net \
    --cc=tlikonen@iki.fi \
    /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.
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 NNTP newsgroup(s).