# gitk: 'show origin of this line' barfs if gitk run in subdir

3 messages from 2008-12-03 to 2008-12-06. Participants: Mark Burton, Paul Mackerras.
Thread: https://gitlist.dev/t/16586

## Mark Burton, 2008-12-03 20:51

Subject: gitk: 'show origin of this line' barfs if gitk run in subdir
Message-ID: <20081203205158.6b4b62c7@crow>
URL: https://gitlist.dev/e/20081203205158.6b4b62c7%40crow

```

Hi,

I was just trying out the new gitk feature that shows you the origin of a
selected line in the diff pane and found that it doesn't work right if
gitk is not started in the top-level work directory - i.e. if you are
in a subdir it pops up an error message of this form:

Error running git blame: fatal: no such path $path in $sha1

I guess it needs something like subdir-depth number of ../ prepended to
the front of the pathname to make the blame succeed.

I could try and fix this but I am sure that others who understand
the sources of gitk/git-blame/git can do it much quicker than me.

Cheers,

Mark

```

## Mark Burton, 2008-12-03 22:22

Subject: Re: gitk: 'show origin of this line' barfs if gitk run in subdir
Message-ID: <20081203222258.6db9b34e@crow>
URL: https://gitlist.dev/e/20081203222258.6db9b34e%40crow
In-Reply-To: <20081203205158.6b4b62c7@crow>

```

Hi,

I think the same problem exists with the 'run git gui blame on this
line' feature. It doesn't work when gitk is started in a subdir of the
working tree but it does work when gitk is started in the top-level
directory.

Cheers,

Mark

```

## Paul Mackerras, 2008-12-06 10:56

Subject: Re: gitk: 'show origin of this line' barfs if gitk run in subdir
Message-ID: <18746.23149.709046.770559@cargo.ozlabs.ibm.com>
URL: https://gitlist.dev/e/18746.23149.709046.770559%40cargo.ozlabs.ibm.com
In-Reply-To: <20081203222258.6db9b34e@crow>

```
Mark Burton writes:

> I think the same problem exists with the 'run git gui blame on this
> line' feature. It doesn't work when gitk is started in a subdir of the
> working tree but it does work when gitk is started in the top-level
> directory.

I have checked in a fix into my gitk.git repository at
git://git.kernel.org/pub/scm/gitk/gitk.git.  However, there seems to
be a bug in git gui blame; it gives a "list index out of range" error
sometimes.

Shawn, to see an example of the error, get a current kernel tree and
do:

$ cd arch/powerpc
$ git gui blame --line=1183 2c5e76158fcea6e3b9536a74efa7b5e2e846d374 \
  ../../net/sunrpc/svcsock.c

Paul.

```
