Skip to content

Commit

Permalink
refactor(changelog): sort commits by newest in CHANGELOG
Browse files Browse the repository at this point in the history
Previously, cliff was sorting the commits by oldest first.
Like:

```
 - Support parsing the missing scopes with `default_scope` (orhun#8)
 - Support generating a changelog scoped to a directory (orhun#11)
```

As the PR numbers indicate, the first bullet point is definitely
older than the latter.

With this update, it will look like this:
```
 - Support generating a changelog scoped to a directory (orhun#11)
 - Support parsing the missing scopes with `default_scope` (orhun#8)
```

Signed-off-by: Taylan Dogan <[email protected]>
  • Loading branch information
kondanta committed Sep 19, 2021
1 parent ba3f1ca commit 095525c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub fn run(mut args: Opt) -> Result<()> {
for git_commit in commits.into_iter().rev() {
let commit = Commit::from(&git_commit);
let commit_id = commit.id.to_string();
releases[release_index].commits.push(commit);
releases[release_index].commits.insert(0, commit);
if let Some(tag) = tags.get(&commit_id) {
releases[release_index].version = Some(tag.to_string());
releases[release_index].commit_id = Some(commit_id);
Expand Down

0 comments on commit 095525c

Please sign in to comment.