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:
Casey Rodarmor 2020-09-06 23:21:01 -07:00
parent 2d226cf016
commit 39dcb5e183
No known key found for this signature in database
GPG Key ID: 556186B153EC6FE0
2 changed files with 2 additions and 13 deletions

View File

@ -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(
&current, &current,
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)?,

View File

@ -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,19 +47,14 @@ 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 {
"https://github.com/casey/intermodal/commits/master".into()
} else {
format!("https://github.com/casey/intermodal/commit/{}", self.hash) format!("https://github.com/casey/intermodal/commit/{}", self.hash)
} }
}
fn shorthash(&self) -> String { fn shorthash(&self) -> String {
self.hash[..12].into() self.hash[..12].into()