@@ -70,11 +70,11 @@ def get_commits(self, start="HEAD"):
7070 self .numCommits -= 1
7171 self .get_commits (start = start )
7272
73- def parse_commits (self , commit , prevCircle = None , shift = numpy .array ([0. , 0. , 0. ])):
73+ def parse_commits (self , commit , prevCircle = None , shift = numpy .array ([0. , 0. , 0. ]), dots = False ):
7474 if self .stop :
7575 return
7676 if ( self .i < self .numCommits and commit in self .commits ):
77- commitId , circle , arrow , hide_refs = self .draw_commit (commit , prevCircle , shift )
77+ commitId , circle , arrow , hide_refs = self .draw_commit (commit , prevCircle , shift , dots )
7878
7979 if commit != "dark" :
8080 if not hide_refs and not self .stop :
@@ -89,7 +89,7 @@ def parse_commits(self, commit, prevCircle=None, shift=numpy.array([0., 0., 0.])
8989
9090 if self .i < len (self .commits )- 1 :
9191 self .i += 1
92- self .parse_commits (self .commits [self .i ], circle )
92+ self .parse_commits (self .commits [self .i ], circle , dots = True )
9393 else :
9494 self .i = 0
9595
@@ -138,7 +138,7 @@ def get_centers(self):
138138 centers .append (commit .get_center ())
139139 return centers
140140
141- def draw_commit (self , commit , prevCircle , shift = numpy .array ([0. , 0. , 0. ])):
141+ def draw_commit (self , commit , prevCircle , shift = numpy .array ([0. , 0. , 0. ]), dots = False ):
142142 if commit == "dark" :
143143 commitFill = m .WHITE if self .scene .args .light_mode else m .BLACK
144144 elif ( len (commit .parents ) <= 1 ):
@@ -170,7 +170,7 @@ def draw_commit(self, commit, prevCircle, shift=numpy.array([0., 0., 0.])):
170170 length = numpy .linalg .norm (start - end ) - ( 1.5 if start [1 ] == end [1 ] else 3 )
171171 arrow .set_length (length )
172172
173- commitId , commitMessage , commit , hide_refs = self .build_commit_id_and_message (commit )
173+ commitId , commitMessage , commit , hide_refs = self .build_commit_id_and_message (commit , dots )
174174 commitId .next_to (circle , m .UP )
175175
176176 message = m .Text ('\n ' .join (commitMessage [j :j + 20 ] for j in range (0 , len (commitMessage ), 20 ))[:100 ], font = "Monospace" , font_size = 14 , color = self .scene .fontColor ).next_to (circle , m .DOWN )
@@ -190,11 +190,14 @@ def draw_commit(self, commit, prevCircle, shift=numpy.array([0., 0., 0.])):
190190
191191 return commitId , circle , arrow , hide_refs
192192
193- def build_commit_id_and_message (self , commit ):
193+ def build_commit_id_and_message (self , commit , dots = False ):
194194 hide_refs = False
195195 if commit == "dark" :
196196 commitId = m .Text ("" , font = "Monospace" , font_size = 20 , color = self .scene .fontColor )
197197 commitMessage = ""
198+ elif dots and commit .hexsha == self .commits [- 1 ].hexsha :
199+ commitId = m .Text ("..." , font = "Monospace" , font_size = 20 , color = self .scene .fontColor )
200+ commitMessage = "..."
198201 else :
199202 commitId = m .Text (commit .hexsha [0 :6 ], font = "Monospace" , font_size = 20 , color = self .scene .fontColor )
200203 commitMessage = commit .message .split ("\n " )[0 ][:40 ].replace ("\n " , " " )
0 commit comments