# [PATCH] gitk: fix typo when diffing committed -> staged

2 messages from 2009-10-27 to 2009-11-03. Participants: Jens Lehmann, Paul Mackerras.
Thread: https://gitlist.dev/t/21382

## Jens Lehmann, 2009-10-27 17:13

Subject: [PATCH] gitk: fix typo when diffing committed -> staged
Message-ID: <4AE72A46.5040201@web.de>
URL: https://gitlist.dev/e/4AE72A46.5040201%40web.de

```
When highlighting a commit, using the context menu over the staged changes
and then selecting "Diff this -> selected" the diff was empty. The same
happened when highlighting the staged changes and using "Diff selected ->
this" over a commit.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---

I became aware of this issue while testing the submodule patch sent
earlier. Looks just like a copy & paste typo.

 gitk-git/gitk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index a0214b7..8e892b3 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -7224,7 +7224,7 @@ proc diffcmd {ids flags} {
 	set cmd [concat | git diff-index --cached $flags]
 	if {[llength $ids] > 1} {
 	    # comparing index with specific revision
-	    if {$i == 0} {
+	    if {$j == 0} {
 		lappend cmd -R [lindex $ids 1]
 	    } else {
 		lappend cmd [lindex $ids 0]
-- 
1.6.5.2.181.gd6f41.dirty

```

## Paul Mackerras, 2009-11-03 11:32

Subject: Re: [PATCH] gitk: fix typo when diffing committed -> staged
Message-ID: <19184.5338.488429.366571@cargo.ozlabs.ibm.com>
URL: https://gitlist.dev/e/19184.5338.488429.366571%40cargo.ozlabs.ibm.com
In-Reply-To: <4AE72A46.5040201@web.de>

```
Jens Lehmann writes:

> When highlighting a commit, using the context menu over the staged changes
> and then selecting "Diff this -> selected" the diff was empty. The same
> happened when highlighting the staged changes and using "Diff selected ->
> this" over a commit.
> 
> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>

Thanks, applied.

Paul.

```
