# [PATCH] gitk: use --textconv to generate diff text

6 messages from 2009-05-11 to 2009-05-11. Participants: Johannes Sixt, Jeff King, Junio C Hamano, Paul Mackerras.
Thread: https://gitlist.dev/t/19280

## Johannes Sixt, 2009-05-11 07:18

Subject: [PATCH] gitk: use --textconv to generate diff text
Message-ID: <4A07D160.9020709@viscovery.net>
URL: https://gitlist.dev/e/4A07D160.9020709%40viscovery.net

```
From: Johannes Sixt <j6t@kdbg.org>
Date: Tue, 28 Apr 2009 14:03:54 +0200

For the most part gitk's focus is on showing history and changes in
a human readable form. For this reason, it makes sense to generate
the patch text in the diff view using --textconv so that textconv drivers
are used if they are defined.

gitk can also generate patches, but we do not use --textconv because
such patches could not be applied.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 gitk-git/gitk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 09eac46..a8a6022 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -7194,7 +7194,7 @@ proc getblobdiffs {ids} {
     global limitdiffs vfilelimit curview
     global diffencoding targetline diffnparents

-    set cmd [diffcmd $ids "-p -C --cc --no-commit-id -U$diffcontext"]
+    set cmd [diffcmd $ids "-p --textconv -C --cc --no-commit-id -U$diffcontext"]
     if {$ignorespace} {
 	append cmd " -w"
     }
-- 
1.6.3.1007.g03ec

```

## Johannes Sixt, 2009-05-11 07:34

Subject: Re: [PATCH] gitk: use --textconv to generate diff text
Message-ID: <4A07D51A.4090409@viscovery.net>
URL: https://gitlist.dev/e/4A07D51A.4090409%40viscovery.net
In-Reply-To: <4A07D160.9020709@viscovery.net>

```
Johannes Sixt schrieb:
> From: Johannes Sixt <j6t@kdbg.org>
> Date: Tue, 28 Apr 2009 14:03:54 +0200
> 
> For the most part gitk's focus is on showing history and changes in
> a human readable form. For this reason, it makes sense to generate
> the patch text in the diff view using --textconv so that textconv drivers
> are used if they are defined.

FWIW, I keep a few Word documents in git and use catdoc as textconv
driver. This works pretty well. Git-gui doesn't show any textual changes
(it treats the Word files as binary, and it has to), with this patch I can
use gitk to preview the changes in the worktree and the index.

-- Hannes

```

## Jeff King, 2009-05-11 09:13

Subject: Re: [PATCH] gitk: use --textconv to generate diff text
Message-ID: <20090511091346.GA5685@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090511091346.GA5685%40coredump.intra.peff.net
In-Reply-To: <4A07D160.9020709@viscovery.net>

```
On Mon, May 11, 2009 at 09:18:56AM +0200, Johannes Sixt wrote:

> For the most part gitk's focus is on showing history and changes in
> a human readable form. For this reason, it makes sense to generate
> the patch text in the diff view using --textconv so that textconv drivers
> are used if they are defined.
> 
> gitk can also generate patches, but we do not use --textconv because
> such patches could not be applied.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

As the original author of the textconv code, I am in favor of this. So
much so that I even posted basically the same patch before:

  http://article.gmane.org/gmane.comp.version-control.git/102523

I had trouble finding much discussion in the archive, but I think it may
not have been taken because we were in release freeze (and textconv was
a brand new feature in the release at the time).

-Peff

```

## Junio C Hamano, 2009-05-11 21:20

Subject: Re: [PATCH] gitk: use --textconv to generate diff text
Message-ID: <7vk54n9w1a.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vk54n9w1a.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20090511091346.GA5685@coredump.intra.peff.net>

```
Jeff King <peff@peff.net> writes:

> On Mon, May 11, 2009 at 09:18:56AM +0200, Johannes Sixt wrote:
>
>> For the most part gitk's focus is on showing history and changes in
>> a human readable form. For this reason, it makes sense to generate
>> the patch text in the diff view using --textconv so that textconv drivers
>> are used if they are defined.
>> 
>> gitk can also generate patches, but we do not use --textconv because
>> such patches could not be applied.
>> 
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>
> As the original author of the textconv code, I am in favor of this.

I agree; I think textconv is meant for this kind of usage.

```

## Paul Mackerras, 2009-05-11 21:59

Subject: Re: [PATCH] gitk: use --textconv to generate diff text
Message-ID: <18952.40905.302916.243355@cargo.ozlabs.ibm.com>
URL: https://gitlist.dev/e/18952.40905.302916.243355%40cargo.ozlabs.ibm.com
In-Reply-To: <20090511091346.GA5685@coredump.intra.peff.net>

```
Jeff King writes:

> As the original author of the textconv code, I am in favor of this. So
> much so that I even posted basically the same patch before:
> 
>   http://article.gmane.org/gmane.comp.version-control.git/102523
> 
> I had trouble finding much discussion in the archive, but I think it may
> not have been taken because we were in release freeze (and textconv was
> a brand new feature in the release at the time).

Which release did --textconv first appear in?

Paul.

```

## Jeff King, 2009-05-11 22:38

Subject: Re: [PATCH] gitk: use --textconv to generate diff text
Message-ID: <20090511223847.GA22424@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090511223847.GA22424%40coredump.intra.peff.net
In-Reply-To: <18952.40905.302916.243355@cargo.ozlabs.ibm.com>

```
On Tue, May 12, 2009 at 07:59:37AM +1000, Paul Mackerras wrote:

> > I had trouble finding much discussion in the archive, but I think it may
> > not have been taken because we were in release freeze (and textconv was
> > a brand new feature in the release at the time).
> 
> Which release did --textconv first appear in?

v1.6.1

-Peff

```
