Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(git): sort commits in topological order (#415)
Commit a1b4b5b ("fix(git): sort the commits in topological order"), changed the order from `TIME` to `TIME | TOPOLOGICAL`. According to the docs, this is equivalent to `git log --date-sort`: * https://github.com/libgit2/libgit2/blob/v1.7.1/include/git2/revwalk.h#L33-L38 This breaks down in the following scenario: 1. A PR is open. 2. A release v1 is made. 3. A PR is merged. 4. A relase v2 is made. The git history for this would be: ``` - v2 release - pr merge commit - v1 release - actual pr commit ``` This directly spills into the changelog produced by `git-cliff`, misattributing commits that were merged in v2 to v1 retroactively when v2 is made. You can see this with `git log`. If you pass `--topo-order` there: ``` - v2 relase - pr merge commit - actual pr commit - v1 relase ``` With this change we only pass `Sort::TOPOLOGICAL` in `git-cliff`, which produces the very same results as `git log --topo-order`.
- Loading branch information