git diff --color-words

153 views
Skip to first unread message

Samuel Wales

unread,
Sep 4, 2010, 12:22:58 PM9/4/10
to Magit
Hi all,

I really like magit. Thanks!

Has anybody considered git diff --color-words for the default magit
output? Would that be a difficult thing to add? I cannot do it
myself, but would like to know if it has been considered, or if it is
likely to be added.

The use case is natural language paragraphs with just a few words' difference.

Also possibly technical lines with just a few characters' difference.

It is too awkward to invoke ediff.

Thanks.

Samuel

--
Q: How many CDC "scientists" does it take to change a lightbulb?
A: "You only think it's dark." [CDC has denied a deadly serious
disease for 25 years]
==========
Retrovirus: http://www.wpinstitute.org/xmrv/index.html -- PLEASE DONATE
===
I would like to see the original Lo et al. 2010 NIH/FDA XMRV paper.

Samuel Wales

unread,
Sep 4, 2010, 12:28:59 PM9/4/10
to Magit
On 2010-09-04, Samuel Wales <samol...@gmail.com> wrote:
> Also possibly technical lines with just a few characters' difference.

This, of course, is a little different. My main concern is English paragraphs.

Samuel Wales

unread,
Oct 20, 2010, 4:37:18 PM10/20/10
to Magit
Nobody has replied, so I thought I'd propose a different method.

Is there a command in Magit that could do diff --color-words instead
of regular diff for whichever diff is being run (e.g. in the status
buffer)?

Then, in principle, we could see the ordinary diff normally, but when
we want to see color-words, we run that command.

This could even be in a different buffer, if necessary, so that the
diff remains usable in the original buffer for selecting text to
stage, etc.

Thanks.

Samuel

On 2010-09-04, Samuel Wales <samol...@gmail.com> wrote:

I would like to see the original Lo et al. 2010 NIH/FDA/Harvard XMRV paper.

Philip Jackson

unread,
Oct 20, 2010, 5:57:27 PM10/20/10
to Samuel Wales, Magit
Samuel,

At Wed, 20 Oct 2010 13:37:18 -0700,
Samuel Wales wrote:

I think your original suggestion might not be too hard to do (famous
last words, I know). We could, when the diff washing happens, use
`ansi-color-apply-to-region' to convert the codes to text props.

Are you an elisper? Perhaps you could kick this off?

> Nobody has replied, so I thought I'd propose a different method.
>
> Is there a command in Magit that could do diff --color-words instead
> of regular diff for whichever diff is being run (e.g. in the status
> buffer)?

Cheers,
Phil

Reply all
Reply to author
Forward
0 new messages