Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize gitk for each repository

Tags:

git

gitk

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)

like image 223
Mario F Avatar asked Aug 11 '26 17:08

Mario F


1 Answers

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"
> }
like image 110
jarodeells Avatar answered Aug 14 '26 10:08

jarodeells



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!