1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #!/bin/env python
- import datetime
- # List changed in the last commit
- # git diff-tree --no-commit-id --name-only -r $(git rev-list HEAD^..HEAD)
- # Python version
- # [patch.new_file_path for patch in repo.diff('HEAD', 'HEAD~1'))]
- committer
- emaillolwut@noway.biz
- nameGaren Torikian
- author
- emaillolwut@noway.biz
- nameGaren Torikian
- urlhost.domain.full_path
- SUBMIT_HOST = '192.168.1.100'
- SUBMIT_PORT = 5000
- GITURL =
- from pygit2 import Repository
- repo = Repository('..')
- head = repo.head
- commit = head.get_object()
- json_to_submit = {}
- json_to_submit['commit'] = commit.id
- json_to_submit['branch'] = repo.head.shorthand
- json_to_submit['committer'] = {'email': commit.committer.email,
- 'name': commit.committer.name}
- json_to_submit['author'] = {'email': commit.author.email,
- 'name': commit.author.name}
- json_to_submit['url'] = GITURL
- json_to_submit['time'] = datetime.datetime.now()
- print json_to_submit
|