git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
DSDirk Süsserott <newsletter@dirk.my1.cc>
Date
Dec 23, 2011, 18:54 UTC
Message-ID
<4EF4CE80.8090502@dirk.my1.cc>
In-Reply-To
<874nwslayi.fsf@fox.patthoyts.tk>
Am 22.12.2011 19:26 schrieb Pat Thoyts:
Show 18 quoted lines
> 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
Previous: Pat ThoytsNext: Martin von Zweigbergk
Message 5 of 7 in “Gitk: shortcut to jump to the current HEAD (yellow spot)?”
  1. Dirk SüsserottDec 22, 2011
  2. Martin von ZweigbergkDec 22, 2011
  3. Dirk SüsserottDec 22, 2011
  4. Pat ThoytsDec 22, 2011
  5. Dirk SüsserottDec 23, 2011
  6. Martin von ZweigbergkDec 24, 2011
  7. Dirk SüsserottDec 25, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.