-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.py
More file actions
executable file
·40 lines (35 loc) · 1.27 KB
/
update.py
File metadata and controls
executable file
·40 lines (35 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import git
import os
def print_repository(repo):
print('Repo description: {}'.format(repo.description))
print('Repo active branch is {}'.format(repo.active_branch))
for remote in repo.remotes:
print('Remote named "{}" with URL "{}"'.format(remote, remote.url))
print('Last commit for repo is {}.'.format(str(repo.head.commit.hexsha)))
def print_commit(commit):
print('----')
print(str(commit.hexsha))
print("\"{}\" by {} ({})".format(commit.summary,
commit.author.name,
commit.author.email))
print(str(commit.authored_datetime))
print(str("count: {} and size: {}".format(commit.count(),
commit.size)))
repo = git.Repo.clone_from('https://github.com/KaiXtr/mutation-purge','./repository')
tree = repo.tree()
o = repo.remotes.origin
o.pull()
for i in tree:
commit = repo.iter_commits(paths=i.path,max_count=1).next()
print(commit.message)
print(commit.comitter)
print(i.path)
print(commit.comitted_date)
'''if not repo.bare:
print_repository(repo)
commits = list(repo.iter_commits('master'))[:3]
for commit in commits:
print_commit(commit)
pass
else:
print('Could not load repository :(')'''