3

My current development environment uses git for VCS, and we use a feature branching workflow. I would like to get to a point where statistics can be generated about each feature. Mainly, I would like to be able to determine how long a feature took to complete, but other statistics would be nice to see as well, such as number of commits, lines of code, etc.

The main consideration is to avoid any superfluous work/process steps for the developers, but I wouldn't be against implementing something simple such as, "Feature branch must be created prior to work on a feature begins" in order to capture that timestamp.

I'm not sure the best way to go about gathering the required information. If a feature is merged into a mainline branch and deleted, I lose the history of when it was created.

The next solution I can see would involve a post-checkout hook. Something like the following: https://gist.github.com/4557894 but there are a few flaws I can think of using this method.

Edit: As pointed out by @mr_ndrsn https://github.com/rietta/git_time_extractor. Ideas on how to make such a tool associate beyond commits/commit messages to branches?

zgohr
  • 668
  • 7
  • 8

1 Answers1

0

The only way to add information without:

  • altering the history by modifying existing commit (and their associated SHA1)
  • depending on the branches (which can be renamed or deleted at any time, as simple pointers)

is to use git notes.

You can add the information you want in a specific note namespace.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Thanks for the response. How do you suggest using notes in this context? What would the note denote and how would it get added? – zgohr Jan 18 '13 at 14:51
  • @zgohr it would be used for storing the data you want to store, but it would be up to you to maintain its coherency. Adding a note in a note namespace is illustrated in http://stackoverflow.com/questions/9839862/adding-git-notes-to-a-blob/9856913#9856913, and mostly in http://git-scm.com/2010/08/25/notes.html – VonC Jan 18 '13 at 15:22
  • One of the main goals is to avoid (as much as possible) extraneous steps in order to maximize automation. – zgohr Jan 18 '13 at 16:39
  • @zgohr understandable. `git notes` can easily be scripted, so once you know the exact content of data you need to memorize, you can associate a note to any commit you want (without changing the history). – VonC Jan 18 '13 at 18:13