git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Baumann <waste.manager@gmx.de>
To: Tom Tobin <korpios@korpios.com>
Cc: Dan Zwell <dzwell@gmail.com>,
	Jonathan del Strother <maillist@steelskies.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Add color to git-add--interactive diffs (Total different idea to solve the problem)
Date: Mon, 22 Oct 2007 22:47:19 +0200	[thread overview]
Message-ID: <20071022204719.GA23348@xp.machine.xx> (raw)
In-Reply-To: <1192351494.7226.18.camel@athena>

On Sun, Oct 14, 2007 at 03:44:54AM -0500, Tom Tobin wrote:
> (This is repost; my damned mail client wrapped a line in the patch last
> time, and now I've got that under control.  My apologies!)  :(
> 
> Seeing the recent discussion and code regarding adding color to
> git-add--interactive, I thought I'd throw in my recent attempt at
> colorizing the diffs.  (This doesn't handle anything else, such as the
> prompts.)
> 
> After banging my head against parsing colorized output of git-add-files,
> I gave up and implemented internal colorization keying off of the
> color.diff configuration.
> 
> Hopefully this can be of some use towards fully colorizing
> git-add--interactive; I'll admit up front that Perl isn't my primary
> language, so I apologize in advance for whatever stupidities I've
> introduced.  ;) 
> 
> Signed-off-by: Tom Tobin <korpios@korpios.com>

[...skiping patch ...]

Tossing around ideas, so feel free to ignore me.

Wouldn't it make more sense to implement the diff coloring inside git apply
so that you could use something like

        diff file1 file2|git apply --color

to make the generated diff with colors [1]? It already implements the
same semantic for generating a diffstat, using

        diff file1 file2|git apply --stat

so we would get a generic diff colorizing tool and you could use inside
git add -i the diff without color and just print it out with the
git apply --color filter. So if someone implements another tool which
needs color handling he could use this output filter.

-Peter

[1]: there is a programm colordiff which does exactly this, but AFAIK git
     colorization has more features.

  parent reply	other threads:[~2007-10-22 20:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-14  8:44 [PATCH] Add color to git-add--interactive diffs (Take 2: now without spurious line break!) Tom Tobin
2007-10-14 11:36 ` Wincent Colaiuta
2007-10-14 17:15   ` Johannes Schindelin
2007-10-14 17:55     ` Andreas Ericsson
2007-10-14 21:01     ` Wincent Colaiuta
2007-10-22 20:47 ` Peter Baumann [this message]
2007-10-22 23:55   ` [PATCH] Add color to git-add--interactive diffs (Total different idea to solve the problem) Johannes Schindelin
2007-10-23  5:34     ` Peter Baumann
2007-10-23 11:13       ` Johannes Schindelin

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=20071022204719.GA23348@xp.machine.xx \
    --to=waste.manager@gmx.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dzwell@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=korpios@korpios.com \
    --cc=maillist@steelskies.com \
    --cc=spearce@spearce.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.
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).