Skip to content

Commit

Permalink
feat(log): print more debug information when -vv is used (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Apr 6, 2022
1 parent 84507dd commit a8efffc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn run(mut args: Opt) -> Result<()> {
}

// Set the working directory.
if let Some(workdir) = args.workdir {
if let Some(ref workdir) = args.workdir {
args.config = workdir.join(args.config);
args.repository = match args.repository {
Some(repository) => Some(workdir.join(repository)),
Expand Down Expand Up @@ -124,7 +124,7 @@ pub fn run(mut args: Opt) -> Result<()> {
}
}
if args.body.is_some() {
config.changelog.body = args.body;
config.changelog.body = args.body.clone();
}
if args.sort == Sort::Oldest {
if let Some(ref sort_commits) = config.git.sort_commits {
Expand All @@ -140,7 +140,7 @@ pub fn run(mut args: Opt) -> Result<()> {

// Initialize the git repository.
let repository =
Repository::init(args.repository.unwrap_or(env::current_dir()?))?;
Repository::init(args.repository.clone().unwrap_or(env::current_dir()?))?;

// Parse tags.
let mut tags = repository.tags(&config.git.tag_pattern, args.date_order)?;
Expand Down Expand Up @@ -173,6 +173,10 @@ pub fn run(mut args: Opt) -> Result<()> {
})
.collect();

// Print debug information about configuration and arguments.
log::trace!("{:#?}", args);
log::trace!("{:#?}", config);

// Parse commits.
let mut commit_range = args.range;
if args.unreleased {
Expand Down

0 comments on commit a8efffc

Please sign in to comment.