[Teammetrics-discuss] Gitstat problems.

Andreas Tille andreas at an3as.eu
Wed Aug 17 20:33:02 UTC 2011


On Thu, Aug 18, 2011 at 12:28:45AM +0530, Sukhbir Singh wrote:
> 
> However, for repositories with lots of activity and with the problem
> of upstream contributors, there are some problems:
> 
>     - I am not sure whether 'git log' is enough for such repositories
> OR whether more needs to be taken care of.
>     - David's script seems to (I am not sure but it should) separate
> the upstream contributors but I have not been able to integrate it.

As far as I can see the script is parsing the output of

   git log -z --format=\"%n00%H\" --name-only

The loop starts in

    LINE: while(<GIT>){

which is extracting the output line by line.  If a line starts with a
hex number it is stored in the variable $sha otherwise the line is
split into words at the word boundary (this control character - just
start the git log command above in ball.git).

If the word contains the string 'debian/' the counter $debian for this
line is increased, otherwise it is $upstream which will be increased.

Finally there is the output in
    print "$sha\t";
and following lines.  Just not that Perl allowes to specify the
condition *after* the command - so only *one* of the print commands is
actually executed depending from the $debian and $upstream variables.
This looks quite easy to me.  Just tell me if this explanation is
sufficient or if I should translate a real Python prototype.
 
> The stats in this case are the main thing and we should be _sure_ that
> we are calling `git log` with the right parameters. This is absolutely
> important. I suggest that we get in touch with someone who is familiar
> with Git development in Debian and then integrate David's script,
> which I am sure there will be an easier way of integrating from the
> command line itself.

So simply set a flag according to the algorithm above which is
exclusively using git log and simply ignore the commit if it is
just upstream.
 
> The problem right now is, I am not sure that what we are doing is
> enough. For simple repositories, it works wonderfully. But for
> repositories with lots of activity (and which will be the case 90%),
> is what we are doing enough? I have my doubts.

I do not see any reason for doubts here.
 
Kind regards

       Andreas.

-- 
http://fam-tille.de



More information about the Teammetrics-discuss mailing list