use thiserror::Error;
type Source = Box<dyn std::error::Error + Send + Sync + 'static>;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("could not open a git repository")]
OpenRepository(#[source] Source),
#[error("could not resolve revision {revision:?}")]
ResolveRevision {
revision: String,
#[source]
source: Source,
},
#[error("could not walk revision range {range:?}")]
WalkRange {
range: String,
#[source]
source: Source,
},
#[error("could not read commit data")]
ReadCommit(#[source] Source),
#[error("could not compute diff stats")]
DiffStats(#[source] Source),
#[error("invalid author pattern")]
AuthorPattern(#[from] regex::Error),
#[error("invalid date {input:?}: {message}")]
InvalidDate { input: String, message: String },
}