Don't treat head as special in changelog
The changelog is no longer comitted, so we no longer need to avoid including the commit hash. type: documentation
This commit is contained in:
parent
2d226cf016
commit
39dcb5e183
|
@ -13,8 +13,6 @@ impl Changelog {
|
||||||
|
|
||||||
let mut entries = Vec::new();
|
let mut entries = Vec::new();
|
||||||
|
|
||||||
let mut head = true;
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let summary_bytes = current
|
let summary_bytes = current
|
||||||
.summary_bytes()
|
.summary_bytes()
|
||||||
|
@ -37,15 +35,12 @@ impl Changelog {
|
||||||
let entry = Entry::new(
|
let entry = Entry::new(
|
||||||
¤t,
|
¤t,
|
||||||
manifest.package.unwrap().version.as_ref(),
|
manifest.package.unwrap().version.as_ref(),
|
||||||
head,
|
|
||||||
&project.config,
|
&project.config,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
entries.push(entry);
|
entries.push(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
head = false;
|
|
||||||
|
|
||||||
match current.parent_count() {
|
match current.parent_count() {
|
||||||
0 => break,
|
0 => break,
|
||||||
1 => current = current.parent(0)?,
|
1 => current = current.parent(0)?,
|
||||||
|
|
|
@ -7,12 +7,11 @@ pub(crate) struct Entry {
|
||||||
hash: String,
|
hash: String,
|
||||||
author: String,
|
author: String,
|
||||||
summary: String,
|
summary: String,
|
||||||
head: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Entry {
|
impl Entry {
|
||||||
#[throws]
|
#[throws]
|
||||||
pub(crate) fn new(commit: &Commit, version: &str, head: bool, config: &Config) -> Self {
|
pub(crate) fn new(commit: &Commit, version: &str, config: &Config) -> Self {
|
||||||
let time = DateTime::<Utc>::from_utc(
|
let time = DateTime::<Utc>::from_utc(
|
||||||
NaiveDateTime::from_timestamp(commit.time().seconds(), 0),
|
NaiveDateTime::from_timestamp(commit.time().seconds(), 0),
|
||||||
Utc,
|
Utc,
|
||||||
|
@ -48,18 +47,13 @@ impl Entry {
|
||||||
summary: commit.summary().unwrap().into(),
|
summary: commit.summary().unwrap().into(),
|
||||||
version: version.into(),
|
version: version.into(),
|
||||||
author,
|
author,
|
||||||
head,
|
|
||||||
metadata,
|
metadata,
|
||||||
time,
|
time,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn url(&self) -> String {
|
fn url(&self) -> String {
|
||||||
if self.head {
|
format!("https://github.com/casey/intermodal/commit/{}", self.hash)
|
||||||
"https://github.com/casey/intermodal/commits/master".into()
|
|
||||||
} else {
|
|
||||||
format!("https://github.com/casey/intermodal/commit/{}", self.hash)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn shorthash(&self) -> String {
|
fn shorthash(&self) -> String {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user