diff --git a/src/main.rs b/src/main.rs index 73d94a205..c3c0ae7ba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -248,13 +248,14 @@ impl CommitInfo { impl fmt::Display for CommitInfo { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let short_commit = self.commit.to_string().chars().take(7).collect::(); if self.refs.len() > 0 { let refs_str = self.refs.iter().map(|ref_name| { ref_name.as_str() }).collect::>().join(", "); - write!(f, "{} ({})", self.commit, refs_str) + write!(f, "{} ({})", short_commit, refs_str) } else { - write!(f, "{}", self.commit) + write!(f, "{}", short_commit) } } }