git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to generate feature branch statistics?

From
Jakub Narębski <jnareb@gmail.com>
Date
Jul 20, 2016, 18:10 UTC
Message-ID
<578FBEAE.9080307@gmail.com>
In-Reply-To
<578F8306.3070306@gmail.com>
W dniu 2016-07-20 o 15:56, Jakub Narębski pisze:
Show 29 quoted lines
> W dniu 2016-07-20 o 10:05, Ernesto Maserati pisze:
> 
>> I assume that feature branches are not frequently enough merged into
>> master. Because of that we discover bugs later than we could with a more
>> continuous code integration. I don't want to discuss here whether feature
>> branches are good or bad.
>>
>> I want just to ask is there a way how to generate a statistic for the
>> average duration of feature branches until they are merged to the master? I
>> would like to know if it is 1 day, 2 days or lets say 8 or 17 days. Also it
>> would be interesting to see the statistical outliers.
>>
>> I hope my motivation became clear and what kind of git repository data I
>> would like to produce.
>>
>> Any ideas?
> 
> There are at least two tools to generate statistics about git repository,
> namely Gitstat (https://sourceforge.net/projects/gitstat) and GitStats
> (https://github.com/hoxu/gitstats), both generating repo statistics as
> a web page. You can probably find more... but I don't know if any includes
> the statistics you need.
> 
> I assume that you have some way of determining if the merge in 'master'
> branch is a merge of a topic branch, or of long-lived graduation branch
> (e.g. 'maint' or equivalent). To simplify the situation, I assume that
> the only merges in master are merges of topic branches:
> 
>   git rev-list --min-parents=2 master | 

Self correction: Here you need to use --first-parent, as in Peff answer (which also uses less git invocations, and less of git porcelain).

I wonder if it is something that libgit2 would be helpful...
-- 
Jakub Narębski
Previous: Jakub Narębski
Message 7 of 7 in “How to generate feature branch statistics?”
  1. Ernesto MaseratiJul 20, 2016
  2. Jeff KingJul 20, 2016
  3. Junio C HamanoJul 20, 2016
  4. Jakub NarębskiJul 20, 2016
  5. Junio C HamanoJul 20, 2016
  6. Jakub NarębskiJul 20, 2016
  7. Jakub NarębskiJul 20, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.