From 39dcb5e183489da514c219a18bd15f9fec86f8fb Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sun, 6 Sep 2020 23:21:01 -0700 Subject: [PATCH] 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 --- bin/gen/src/changelog.rs | 5 ----- bin/gen/src/entry.rs | 10 ++-------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/bin/gen/src/changelog.rs b/bin/gen/src/changelog.rs index fbd2cdc..a82c4b4 100644 --- a/bin/gen/src/changelog.rs +++ b/bin/gen/src/changelog.rs @@ -13,8 +13,6 @@ impl Changelog { let mut entries = Vec::new(); - let mut head = true; - loop { let summary_bytes = current .summary_bytes() @@ -37,15 +35,12 @@ impl Changelog { let entry = Entry::new( ¤t, manifest.package.unwrap().version.as_ref(), - head, &project.config, )?; entries.push(entry); } - head = false; - match current.parent_count() { 0 => break, 1 => current = current.parent(0)?, diff --git a/bin/gen/src/entry.rs b/bin/gen/src/entry.rs index 36535fb..a16ef73 100644 --- a/bin/gen/src/entry.rs +++ b/bin/gen/src/entry.rs @@ -7,12 +7,11 @@ pub(crate) struct Entry { hash: String, author: String, summary: String, - head: bool, } impl Entry { #[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::::from_utc( NaiveDateTime::from_timestamp(commit.time().seconds(), 0), Utc, @@ -48,18 +47,13 @@ impl Entry { summary: commit.summary().unwrap().into(), version: version.into(), author, - head, metadata, time, } } 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 {