libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.13k stars 879 forks source link

Default commit order produces incorrectly arranged commits if commit date/time is the same #1975

Open tapika opened 2 years ago

tapika commented 2 years ago

By default when you pick up commits using function like this:

repo.Commits.ToArray()

Commits are organized by date time - and if it happens to be the same for two commits, they get randomly re-ordered.

Better query is like this:

repo.Commits.QueryBy(new CommitFilter() { SortBy = CommitSortStrategies.Topological }).ToArray()

Why this cannot be default just to avoid re-arrange problems ?