Gathering timespan statistics from Git



  • I would like to easily query git to answer a question like the following:

    How much time passed from when a developer made a git commit to when that commit was merged to a default branch from a feature branch (if that pattern is being used) or was tagged with a particular tag (for trunk-based development)?

    At a higher level, my goal is to see how much time it takes for code to leave a developer's fingers to actually reach production.

    Thanks!



  • https://github.com/git-time-metric/gtm is a set of tools that allow to track time on Git.

    The latest release can be installed automatically using brew or manually by installing the executables listed https://github.com/git-time-metric/gtm/releases/tag/v1.3.5 .

    gtm must first be initialized (gtm init) from with the git project directory to allow time tracking. When you commit your work, gtm then saves the time associated with your commit.

    The time can be displayed using the gtm report command; format argument timeline-hours allows to create a Gantt chart.

    On a side note, I am not sure whether gtm can help with existing projects. I tried running it onto one of my repos and it logged 0s for all my previous commits.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2