Linter incorrectly claims "one or fewer commits on each branch"
brainwane opened this issue · 3 comments
brainwane commented
I had a local clone of https://github.com/OpenTechStrategies/streetcrm on my machine and ran open-project-linter on it, and the output included:
! one or fewer commits on each branch
But when I run git log
I see multiple commits on the master branch.
Related to #14.
fhocutt commented
Reproduced! Looking at it.
fhocutt commented
Okay. The problem seems to be that it's not seeing the full git log from the cloned directory.
$ git clone https://github.com/OpenTechStrategies/streetcrm
$ cd streetcrm/
$ git log
<multiple commits on the master branch>
but when I use gitpython:
repo = git.Repo(repository_path)
branches = repo.branches()
for branch in branches:
print branch.log()
yields only one entry, the clone
:
[0000000000000000000000000000000000000000 39cedad4a4aecce86e7dd290733ae2ceeca80920 Frances Hocutt <frances.hocutt+gh@gmail.com> 1488580242 -0800 clone: from https://github.com/OpenTechStrategies/streetcrm]
Looking at how to use gitpython to yield the same thing as git log
here.
fhocutt commented
Fixed. The issue was that Head.log() yields the reflog not the commit history, so it worked for local repositories but not for cloned ones.