Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56ba481

Browse files
committed
Merge branch 'main' into filter-refs-by-spec
2 parents 55eb965 + ce01093 commit 56ba481

24 files changed

Lines changed: 396 additions & 257 deletions

Cargo.lock

Lines changed: 186 additions & 199 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Please see _'Development Status'_ for a listing of all crates and their capabili
4242
* **mailmap**
4343
* [x] **entries** - display all entries of the aggregated mailmap git would use for substitution
4444
* **revision**
45+
* [x] **list** - list plain revision hashes from a starting point, similar to a very simple version of `git rev-list`.
4546
* [x] **explain** - show what would be done while parsing a revision specification like `HEAD~1`
4647
* [x] **resolve** - show which objects a revspec resolves to, similar to `git rev-parse` but faster and with much better error handling
4748
* [x] **previous-branches** - list all previously checked out branches, powered by the ref-log.

cargo-smart-release/CHANGELOG.md

Lines changed: 82 additions & 25 deletions
Large diffs are not rendered by default.

cargo-smart-release/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo-smart-release"
3-
version = "0.12.0"
3+
version = "0.12.1"
44
authors = ["Sebastian Thiel <[email protected]>"]
55
repository = "https://github.com/Byron/gitoxide"
66
description = "Cargo subcommand for fearlessly releasing crates in workspaces."
@@ -32,7 +32,7 @@ cargo_metadata = "0.14.0"
3232
log = "0.4.14"
3333
toml_edit = "0.14.0"
3434
semver = "1.0.4"
35-
crates-index = "0.18.1"
35+
crates-index = "0.18.9"
3636
cargo_toml = "0.11.4"
3737
nom = { version = "7", default-features = false, features = ["std"]}
3838
git-conventional = "0.11.1"

cargo-smart-release/src/changelog/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ pub mod init;
66
mod merge;
77
mod parse;
88
pub mod section;
9+
#[cfg(test)]
10+
mod tests;
911
pub mod write;
1012

1113
pub const DEFAULT_HEADING_LEVEL: usize = 2;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
mod repository_url {
2+
use crate::changelog::write::RepositoryUrl;
3+
use git_repository as git;
4+
5+
#[test]
6+
fn github_https_url() {
7+
for input in [
8+
"https://github.com/byron/gitoxide",
9+
"https://github.com/byron/gitoxide.git",
10+
"git://github.com/byron/gitoxide",
11+
"git://github.com/byron/gitoxide.git",
12+
"[email protected]:byron/gitoxide.git",
13+
"[email protected]:byron/gitoxide",
14+
] {
15+
let url = RepositoryUrl::from(git::url::parse(input.into()).unwrap());
16+
assert_eq!(
17+
url.github_https().expect("possible"),
18+
"https://github.com/byron/gitoxide"
19+
)
20+
}
21+
}
22+
}

cargo-smart-release/src/changelog/write.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ impl RepositoryUrl {
6767
Scheme::Ssh => self
6868
.inner
6969
.user()
70-
.map(|user| format!("https://github.com{}/{}", user, self.cleaned_path())),
71-
Scheme::Ext(_) | Scheme::File => None,
70+
.filter(|user| *user == "git")
71+
.map(|_git| format!("https://github.com{}", self.cleaned_path())),
72+
_ => None,
7273
},
7374
None | Some(_) => None,
7475
}
@@ -320,9 +321,10 @@ impl section::Segment {
320321
}
321322
writeln!(
322323
out,
323-
" - {} {} where understood as [conventional](https://www.conventionalcommits.org).",
324+
" - {} {} {} understood as [conventional](https://www.conventionalcommits.org).",
324325
conventional_count,
325-
if *conventional_count == 1 { "commit" } else { "commits" }
326+
if *conventional_count == 1 { "commit" } else { "commits" },
327+
if *conventional_count == 1 { "was" } else { "were" }
326328
)?;
327329
if unique_issues.is_empty() {
328330
writeln!(out, " - 0 issues like '(#ID)' where seen in commit messages")?;

cargo-smart-release/src/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub(crate) fn bump_package_with_spec(
132132
let desired_release = v;
133133
let (latest_release, next_release) = match ctx.crates_index.crate_(&package.name) {
134134
Some(published_crate) => {
135-
let latest_release = semver::Version::parse(published_crate.latest_version().version())
135+
let latest_release = semver::Version::parse(published_crate.most_recent_version().version())
136136
.expect("valid version in crate index");
137137
let next_release = if latest_release >= desired_release {
138138
desired_release.clone()

cargo-smart-release/tests/changelog/write_and_parse/snapshots/integration__changelog__write_and_parse__all_section_types_round_trips_lossy-11.snap

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
source: cargo-smart-release/tests/changelog/write_and_parse/mod.rs
3-
assertion_line: 183
43
expression: buf
5-
64
---
75
* hello world
86
this
@@ -15,7 +13,7 @@ expression: buf
1513

1614
- 100 commits contributed to the release over the course of 32 calendar days.
1715
- 60 days passed between releases.
18-
- 20 commits where understood as [conventional](https://www.conventionalcommits.org).
16+
- 20 commits were understood as [conventional](https://www.conventionalcommits.org).
1917
- 3 unique issues were worked on: #1, Uncategorized, #42
2018

2119
##### Commit Details

cargo-smart-release/tests/changelog/write_and_parse/snapshots/integration__changelog__write_and_parse__all_section_types_round_trips_lossy-2.snap

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
source: cargo-smart-release/tests/changelog/write_and_parse/mod.rs
3-
assertion_line: 169
43
expression: md
5-
64
---
75
# Changelog
86

@@ -32,7 +30,7 @@ world
3230

3331
- 100 commits contributed to the release over the course of 32 calendar days.
3432
- 60 days passed between releases.
35-
- 20 commits where understood as [conventional](https://www.conventionalcommits.org).
33+
- 20 commits were understood as [conventional](https://www.conventionalcommits.org).
3634
- 3 unique issues were worked on: [#1](https://github.com/user/repo/issues/1), Uncategorized, [#42](https://github.com/user/repo/issues/42)
3735

3836
##### Commit Details

0 commit comments

Comments
 (0)