3

Gitk is a neat tool, but it doesn't show any visual clue as for which repository you are actually in. When I open multiple gitk windows, I always have to stop and think which one goes with each repo.

As fas as I know, there is no way to provide different .gitk config files for each repo. Has anybody some kind of trick for this?

EDIT: Actually the name of the repo is shown in the title bar, XMonad was hiding it for me. The question of multiple config files still stands, though. (What I'd ideally like is a way to set Preferences > Interface color, so that each window has a different color)

Mario F
  • 45,569
  • 6
  • 37
  • 38

1 Answers1

2

Here's a trick in the form of a patch to gitk (I'm using git version 1.7.4.1):

11486c11486,11490
< catch {source ~/.gitk}
---
> if { [file exists ".gitk" ] } {
>     catch {source .gitk}
> } else {
>     catch {source ~/.gitk}
> }

EDIT: To also save to the local gitk file:

around 2716
< file rename -force "~/.gitk-new" "~/.gitk"
---
> if { [file exists ".gitk" ] } {
>     file rename -force "~/.gitk-new" ".gitk"
> } else {
>     file rename -force "~/.gitk-new" "~/.gitk"
> }
Mario F
  • 45,569
  • 6
  • 37
  • 38
jarodeells
  • 356
  • 1
  • 5
  • 14
  • It mostly works. The only problem is that when you change some preferences, it is always saved to ~/.gitk. The place where the .gitk is saved should be patched too. I'll edit the answer when I find it. – Mario F Jan 13 '12 at 08:57
  • Correct, I noted that in my post but I didn't have enough time to find the code that handles the save. However, it should be another similar patch to make that part look for an existing .gitk in the local directory and use that instead of ~/.gitk. – jarodeells Jan 13 '12 at 09:09