Skip to content

Commit

Permalink
fix: needs to set git_count for travis builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrederiksen committed Mar 11, 2018
1 parent 4f19628 commit 81934f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def _minimal_ext_cmd(cmd):
GIT_LABEL = label
# Get number of commits since tag
count = _minimal_ext_cmd(['git', 'rev-list', tag + '..', '--count'])
if len(count) == 0:
count = '1'

except Exception as e:
print(e)
Expand Down

3 comments on commit 81934f3

@tfrederiksen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not understand why sometimes Travis finds count='' here.

@zerothi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is most likely because travis does a git clone --depth 50 which cannot account for the full history. Hence a rev-list will not necessarily return a given count number.
So once you have 50+ commits, count will return ''.

@tfrederiksen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see. Thanks for the comment!

Please sign in to comment.