# Gitk: shortcut to jump to the current HEAD (yellow spot)?

7 messages from 2011-12-22 to 2011-12-25. Participants: Dirk Süsserott, Martin von Zweigbergk, Pat Thoyts.
Thread: https://gitlist.dev/t/29237

## Dirk Süsserott, 2011-12-22 15:49

Subject: Gitk: shortcut to jump to the current HEAD (yellow spot)?
Message-ID: <4EF3517A.8030108@dirk.my1.cc>
URL: https://gitlist.dev/e/4EF3517A.8030108%40dirk.my1.cc

```
Hi!

Does anybody know about a shortcut in gitk to "jump to the yellow spot"?

I often use cmdline and gitk at the same time, switch branches, stash,
rebase and so on from bash. When hitting [Ctrl-]F5 in gitk, the last
highlighted commit is focused again and my HEAD is far off the screen.

Is there a way to jump to the HEAD (the yellow bubble in gitk) with a
fingertip?

TIA
    Dirk

```

## Martin von Zweigbergk, 2011-12-22 17:09

Subject: Re: Gitk: shortcut to jump to the current HEAD (yellow spot)?
Message-ID: <CAOeW2eGFw0RfU0FHL4CEMVPwSNvrRLv9_iG7Gy_qCheY3GxWxw@mail.gmail.com>
URL: https://gitlist.dev/e/CAOeW2eGFw0RfU0FHL4CEMVPwSNvrRLv9_iG7Gy_qCheY3GxWxw%40mail.gmail.com
In-Reply-To: <4EF3517A.8030108@dirk.my1.cc>

```
2011/12/22 Dirk Süsserott <newsletter@dirk.my1.cc>:
> Does anybody know about a shortcut in gitk to "jump to the yellow spot"?

Not sure it's fast enough for you, but you can always enter "HEAD" in
the "SHA1 ID" box (and press Enter).

```

## Dirk Süsserott, 2011-12-22 17:23

Subject: Re: Gitk: shortcut to jump to the current HEAD (yellow spot)?
Message-ID: <4EF3678A.4010900@dirk.my1.cc>
URL: https://gitlist.dev/e/4EF3678A.4010900%40dirk.my1.cc
In-Reply-To: <CAOeW2eGFw0RfU0FHL4CEMVPwSNvrRLv9_iG7Gy_qCheY3GxWxw@mail.gmail.com>

```
Am 22.12.2011 18:09 schrieb Martin von Zweigbergk:
> 2011/12/22 Dirk Süsserott <newsletter@dirk.my1.cc>:
>> Does anybody know about a shortcut in gitk to "jump to the yellow spot"?
> 
> Not sure it's fast enough for you, but you can always enter "HEAD" in
> the "SHA1 ID" box (and press Enter).

Martin, that's fast enough for me. Works great! Thank you.

```

## Pat Thoyts, 2011-12-22 18:26

Subject: Re: Gitk: shortcut to jump to the current HEAD (yellow spot)?
Message-ID: <874nwslayi.fsf@fox.patthoyts.tk>
URL: https://gitlist.dev/e/874nwslayi.fsf%40fox.patthoyts.tk
In-Reply-To: <4EF3517A.8030108@dirk.my1.cc>

```
Dirk Süsserott <newsletter@dirk.my1.cc> writes:

>Hi!
>
>Does anybody know about a shortcut in gitk to "jump to the yellow spot"?
>
>I often use cmdline and gitk at the same time, switch branches, stash,
>rebase and so on from bash. When hitting [Ctrl-]F5 in gitk, the last
>highlighted commit is focused again and my HEAD is far off the screen.
>
>Is there a way to jump to the HEAD (the yellow bubble in gitk) with a
>fingertip?
>
>TIA
>    Dirk

Hit the Home key. The binding for that takes you to the first commit.
End to the last (oldest) commit.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

```

## Dirk Süsserott, 2011-12-23 18:54

Subject: Re: Gitk: shortcut to jump to the current HEAD (yellow spot)?
Message-ID: <4EF4CE80.8090502@dirk.my1.cc>
URL: https://gitlist.dev/e/4EF4CE80.8090502%40dirk.my1.cc
In-Reply-To: <874nwslayi.fsf@fox.patthoyts.tk>

```
Am 22.12.2011 19:26 schrieb Pat Thoyts:
> Dirk Süsserott <newsletter@dirk.my1.cc> writes:
> 
>> Hi!
>>
>> Does anybody know about a shortcut in gitk to "jump to the yellow spot"?
>>
>> I often use cmdline and gitk at the same time, switch branches, stash,
>> rebase and so on from bash. When hitting [Ctrl-]F5 in gitk, the last
>> highlighted commit is focused again and my HEAD is far off the screen.
>>
>> Is there a way to jump to the HEAD (the yellow bubble in gitk) with a
>> fingertip?
>>
>> TIA
>>    Dirk
> 
> Hit the Home key. The binding for that takes you to the first commit.
> End to the last (oldest) commit.

Hi Pat,

thank you, but I almost always run gitk with the '--all' parameter.
Actually, I have a function in my .bashrc for this:

  # calls gitk from the top-level directory:
  function gkup()
  {
      (cd "./$(git rev-parse --show-cdup)"; gitk --all "$@" &)
  }

That's because gitk behaves odd (at least to me) when not run from the
top-level directory. E.g. the "touching paths" box won't find files in
the top dir if you don't prefix them with a slash. It's all relative to
the directory gitk was started in. To get predictable behavior, I wrote
this function and garnished it with '--all'.

Thus, my current HEAD is not always on the top of the history but
somewhere in between. However, typing "HEAD" (or "head" in the SHA1
field works for me.

Cheers
    Dirk

```

## Martin von Zweigbergk, 2011-12-24 04:22

Subject: Re: Gitk: shortcut to jump to the current HEAD (yellow spot)?
Message-ID: <CAOeW2eGCKxYW1TT-HPoSCO0_PsQPX5C-bcHLUy73MTd7=CsqRA@mail.gmail.com>
URL: https://gitlist.dev/e/CAOeW2eGCKxYW1TT-HPoSCO0_PsQPX5C-bcHLUy73MTd7%3DCsqRA%40mail.gmail.com
In-Reply-To: <4EF4CE80.8090502@dirk.my1.cc>

```
2011/12/23 Dirk Süsserott <newsletter@dirk.my1.cc>:
>
> That's because gitk behaves odd (at least to me) when not run from the
> top-level directory. E.g. the "touching paths" box won't find files in
> the top dir if you don't prefix them with a slash.

This should be fixed in c332f44 (gitk: Fix file highlight when run in
subdirectory, 2011-04-04), which is in the current master and thus, I
believe, to be released in Git 1.7.9.

Martin

```

## Dirk Süsserott, 2011-12-25 19:33

Subject: Re: Gitk: shortcut to jump to the current HEAD (yellow spot)?
Message-ID: <4EF77A8D.7020907@dirk.my1.cc>
URL: https://gitlist.dev/e/4EF77A8D.7020907%40dirk.my1.cc
In-Reply-To: <CAOeW2eGCKxYW1TT-HPoSCO0_PsQPX5C-bcHLUy73MTd7=CsqRA@mail.gmail.com>

```
Am 24.12.2011 05:22 schrieb Martin von Zweigbergk:
> 2011/12/23 Dirk Süsserott <newsletter@dirk.my1.cc>:
>>
>> That's because gitk behaves odd (at least to me) when not run from the
>> top-level directory. E.g. the "touching paths" box won't find files in
>> the top dir if you don't prefix them with a slash.
> 
> This should be fixed in c332f44 (gitk: Fix file highlight when run in
> subdirectory, 2011-04-04), which is in the current master and thus, I
> believe, to be released in Git 1.7.9.
> 
> Martin

Ahh, cool. I wouldn't have noticed because I'm so used to my "cd $TOP &&
gitk". I thought it was by intention because it just behaves like "git
log": When run from subdirs it doesn't know about topdir files: Assume
README.txt is in the topdir and current dir is some subdir:

$ git log -- README.txt    # fails
$ git log -- ../README.txt # works

My alias (or function) was just a helper to avoid remembering where I
started gitk from.

Cheers,
    Dirk

BTW, Merry X-Mas to you and all others on the list :-)

```
