Something seems to exist . Unverified, but it seems that you want.
Redmine also keeps track of time, and captures, but does not seem to provide a connection between. However, this can be a good project and not too complicated, as it has a good plugin architecture.
The same for Trac, this page contains interesting things, but they are all related to tickets, not fixation. So you need to associate each commit with a ticket, which is a good idea, but can be painful in the long run ...
CharlesB
source share