Change walk order from ByCommitTime to topological order - #2991
Conversation
This is preparation for a log graph implementation. In case of a diamond graph where the common ancestor has a newer date than some of its children, the walk order of the current code will violate topology order. If commits are not in topology order, a graph may have to draw a parent before its child. This is confusing to the user and require extra memory for the graph render algorithm.
LogWalker uses git2, due to SharedCommitFilterFn
LogWalkerWithoutFilter is based on gix, so it touches a different part of the code.
|
@cruessler do you recall why we changed this in the first place? |
|
I don鈥檛 remember why this change was made in the first place, but some digging through history revealed these commits that are related to the introduction of
I presume there were cases where you preferred date-based ordering in the past and it has stayed that way ever since. 馃榾 |
|
I鈥檝e created two benchmarks for this change in #3013, and it seems that The filtered log walker that still relies on |
This is preparation for a graph implementation.
Currently, commits are sorted by commit time without regard to parent-child relations. This means a parent with a date more recent than its child will appear before its child.
git loghas options--date-orderand--author-date-orderboth of which show no parents before all its children, before ordering commits by date.If sorted by commit time, a graph may have to draw a parent before its child. This is confusing to the user and require extra memory for the graph render algorithm. Topology order makes graph visualisation much simpler as all children are now visited before their parents.
This Pull Request prepares a PR for issue #81. It is relevant to both PR #2628 and PR #2890.
It changes the following:
I followed the checklist:
make checkwithout errors