--- /dev/null
+from subprocess import Popen, check_output
+
+
+class Commit:
+ _hash = None
+ _children = None
+ _parents = None
+ _message = None
+ _node_pos = None
+ _node_color = None
+
+ def __init__(self):
+ self._children = hash.__new__()
+ self._parents = hash.__new__()
+ self._message = ""
+ self._node_pos = 0
+
+
+class Branch:
+ _name = ""
+ _hash = ""
+ _commit = ""
+
+ def __init__(self, line):
+ words = line.split(" ")
+ self._name = words.pop(0)
+ self._hash = words.pop(0)
+ self._commit = " ".join(words)
+
+ def to_s_long(self):
+ print("Name : " + self._name)
+ print("Hash : " + self._hash)
+ print("Commit: " + self._commit)
+
+ def to_s(self):
+ print(" ".join({self._name, self._hash, self._commit}))
+
+
+cmd = "git log --graph --oneline --parents"
+
+return_output = check_output(cmd, shell=True)
+
+print(return_output.split("\n"))