Skip to content

Commit 8e5f3a8

Browse files
committedMar 17, 2025
fix first/last commit
1 parent 8e9c89f commit 8e5f3a8

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed
 

‎.github/fixtures/test-submodules/expected.md

+14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ All notable changes to this project will be documented in this file.
1717

1818
### Ratatui
1919

20+
#### Bug Fixes
21+
22+
- Run the correct example for chart (#1679)
23+
- `Rect::positions()` should be empty when width is 0 and height is nonzero (#1669)
24+
- Ensure that example projects are not published (#1672)
25+
2026
#### Continuous Integration
2127

2228
- Add workflow_dispatch trigger for release-plz (#1693)
@@ -27,11 +33,19 @@ All notable changes to this project will be documented in this file.
2733
- Bump serde from 1.0.217 to 1.0.218 (#1688)
2834
- Bump clap from 4.5.29 to 4.5.31 (#1686)
2935
- Bump serde_json from 1.0.138 to 1.0.139 (#1687)
36+
- Bump document-features from 0.2.10 to 0.2.11 (#1677)
37+
- Bump clap from 4.5.28 to 4.5.29 (#1676)
3038

3139
#### Chore
3240

3341
- Release (#1671)
3442
- Bump termion to 4.0.4 (#1691)
43+
- Bump termwiz from 0.22.0 to 0.23.0 (#1682)
44+
45+
#### Docs
46+
47+
- Remove link to Paragraph widget (#1683)
48+
- Update app examples with tapes (#1673)
3549

3650

3751
## [0.1.0] - 2022-04-06

‎.github/workflows/test-fixtures.yml

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
command: v1.4.0..v1.4.1
107107
- fixtures-name: test-monorepo-include-path
108108
command: v2.6.1..v2.7.0 --include-path .github/fixtures/
109+
- fixtures-name: test-submodules
109110

110111
steps:
111112
- name: Checkout

‎git-cliff/src/lib.rs

+10-12
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,14 @@ fn process_submodules(
8888
) -> Result<()> {
8989
// Retrieve first and last commit of a release to create a commit range.
9090
let first_commit = release
91-
.commits
92-
.first()
93-
.map(|commit| &commit.id)
94-
.and_then(|commit_id| repository.find_commit(commit_id));
91+
.previous
92+
.as_ref()
93+
.and_then(|previous_release| previous_release.commit_id.clone())
94+
.and_then(|commit_id| repository.find_commit(&commit_id));
9595
let last_commit = release
96-
.commits
97-
.last()
98-
.map(|commit| &commit.id)
99-
.and_then(|commit_id| repository.find_commit(commit_id));
96+
.commit_id
97+
.clone()
98+
.and_then(|commit_id| repository.find_commit(&commit_id));
10099
let commit_range = first_commit.zip(last_commit);
101100

102101
let mut submodule_map: HashMap<String, Vec<Commit>> = HashMap::new();
@@ -336,10 +335,6 @@ fn process_repository<'a>(
336335
release.commits.push(commit);
337336
release.repository = Some(repository_path.clone());
338337
if let Some(tag) = tags.get(&commit_id) {
339-
if recurse_submodules {
340-
process_submodules(repository, release)?;
341-
}
342-
343338
release.version = Some(tag.name.to_string());
344339
release.message.clone_from(&tag.message);
345340
release.commit_id = Some(commit_id);
@@ -360,6 +355,9 @@ fn process_repository<'a>(
360355
previous_release.previous = None;
361356
release.previous = Some(Box::new(previous_release));
362357
previous_release = release.clone();
358+
if recurse_submodules {
359+
process_submodules(repository, release)?;
360+
}
363361
releases.push(Release::default());
364362
}
365363
}

0 commit comments

Comments
 (0)
Please sign in to comment.