git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC] Syntax highlighting for combined diff
Date: Sat, 21 Oct 2006 10:49:56 +0200	[thread overview]
Message-ID: <200610211049.56477.jnareb@gmail.com> (raw)
In-Reply-To: <7vslhigld7.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> So the question is how to color combined diff format (what should be syntax
>> highlighting for combined diff format). If branches columns have only
>> pluses we use the same color as for adding line in ordinary diff; if
>> branches column consist only of minuses we use the same color as for
>> removing line in ordinary diff. Can there be mixture of plusses and
>> minuses? How git-diff --color solves this?
> 
> UTSL ;-).
> 
> Otherwise (iow, if you refuse to use the source), you could
> cheat and let "git diff" do the coloring for you, and then
> regexp replace the output.  You could even use the same coloring
> logic for normal diff if you did so.

Do I understand code correctly, and the last '+' or '-'
in the parents column means?

        for (i = 0; i < ecbdata->nparents && len; i++) {
                if (line[i] == '-')
                        color = DIFF_FILE_OLD;
                else if (line[i] == '+')
                        color = DIFF_FILE_NEW;
        }

Anyone who wrote this code, could you answer me, please?
-- 
Jakub Narebski
Poland

  reply	other threads:[~2006-10-21  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-21  0:35 [RFC] Syntax highlighting for combined diff Jakub Narebski
2006-10-21  7:48 ` Junio C Hamano
2006-10-21  8:49   ` Jakub Narebski [this message]
2006-10-21  9:41     ` Junio C Hamano
2006-10-21 10:02       ` Jakub Narebski
2006-10-21 10:40         ` Junio C Hamano

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=200610211049.56477.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).