Skip to content

Commit

Permalink
Don't treat head as special in changelog
Browse files Browse the repository at this point in the history
The changelog is no longer comitted, so we no longer need to avoid
including the commit hash.

type: documentation
  • Loading branch information
casey committed Sep 7, 2020
1 parent 2d226cf commit 39dcb5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 0 additions & 5 deletions bin/gen/src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ impl Changelog {

let mut entries = Vec::new();

let mut head = true;

loop {
let summary_bytes = current
.summary_bytes()
Expand All @@ -37,15 +35,12 @@ impl Changelog {
let entry = Entry::new(
&current,
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)?,
Expand Down
10 changes: 2 additions & 8 deletions bin/gen/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Utc>::from_utc(
NaiveDateTime::from_timestamp(commit.time().seconds(), 0),
Utc,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 39dcb5e

Please sign in to comment.