Adding a custom command to gitk's commit right-click menu

172 views Asked by At

How do I add a custom command to gitk's menu shown when right-clicking a commit? The command I want to add specifically is git revert, but I'm hoping for a generic solution.

2

There are 2 answers

0
Slaven Rezic On BEST ANSWER

A menu item for git-revert was added recently to gitk:

commit f74455ab216bdc4f21a733f75ddd6974634c5df1
Merge: 8d97506 76bf6ff
Author: Junio C Hamano <[email protected]>
Date:   Mon May 13 07:51:41 2013 -0700

[...]
      gitk: Add menu item for reverting commits

Just clone the git sources from git://git.kernel.org/pub/scm/git/git.git

2
cforbish On

gitk is a tcl script. You could simply add commands to it (assuming you know a little about tcl).