Skip to content

Commit 35e32b6

Browse files
committed
fix to get elided boring commit ids in proper chronological order (issue 2)
1 parent 072808c commit 35e32b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git-graph.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ def make_elision(boring_commits, interesting_commit)
235235
if boring_commits.length == 1
236236
make_node(boring_commits[0], {}, "elide.")
237237
else
238-
rangeids = smaller fixed "#{id_for(boring_commits.first)}..#{id_for(boring_commits.last)}"
238+
# since we're traversing backwards in time by following parent links,
239+
# the boring_commits list is in reverse chronological order
240+
# (see issue 2)
241+
rangeids = smaller fixed "#{id_for(boring_commits.last)}..#{id_for(boring_commits.first)}"
239242
rangedesc = small "#{boring_commits.size} commits"
240243
fill = "style=filled fillcolor=gray75"
241244
puts "\"elide.#{boring_commits.first.id}\" [label=<<font>#{rangedesc}<br/>#{rangeids}</font>> #{fill}];"

0 commit comments

Comments
 (0)