src-d / hercules

Gaining advanced insights from Git repository history.
Other
2.06k stars 146 forks source link

Not including specific branches? Only run on specified branch? #353

Closed unixb0y closed 4 years ago

unixb0y commented 4 years ago

Hello everybody. We have a project that we ported to Python 3 so there's a py3k branch and I'd like to get people-related stats (how many commits per person etc) regarding exactly that specific branch (from when it was started).
It looks like it's not being considered at all, since my coworker isn't listed at all in the graphic that is created when executing:

./hercules.darwin_amd64 --burndown --burndown-people repo-cache | labours -m ownership

He only started working on the project since the new branch was created and only worked on that branch which hasn't been merged with master yet.

Is this not possible with hercules? If not, are there any plans on supporting other branches than the master branch?

vmarkovtsev commented 4 years ago

This is an interesting use-case @unixb0y, thank you for trying Hercules! Indeed, the HEAD is taken by default and there is no option to specify the branch by default :(

There is a workaround for this, however. It is not super handy but it will work. First, list all the commits that you wish to analyze:

git rev-list py3k | tac > py3k_commits.txt

Second, invoke Hercules with --commits py3k_commits.txt.

This workaround is mentioned in the README below "Now something fun" :smile:

I hope this helps! I guess my answer can be too late, hehe, but if you find time to check the results and provide the feedback here then I will be very grateful :heart:

unixb0y commented 4 years ago

@vmarkovtsev Thanks for replying, I actually forked the repo I wanted to analyse, set the branch I needed as the master branch and ran the tool on that repo's URL :D Yeah your answer was quite late, I needed to submit my stuff on that day tbh, but I really appreciate you still replying with what seems like a good workaround, too!