Skip to content

Commit 971bd2e

Browse files
committed
Display the date a tag is translated to.
1 parent 4ec0356 commit 971bd2e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/main.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -505,18 +505,21 @@ fn fixup_bounds(
505505
// even try to convert the other bound to a date.
506506
return Ok(());
507507
}
508-
let fixup = |bound: &mut Option<Bound>| -> anyhow::Result<()> {
508+
let fixup = |which: &str, bound: &mut Option<Bound>| -> anyhow::Result<()> {
509509
if is_tag(bound) {
510-
if let Some(b) = bound.clone() {
511-
if is_tag(bound) {
512-
*bound = Some(Bound::Date(access.repo().bound_to_date(b)?));
513-
}
510+
if let Some(Bound::Commit(tag)) = bound {
511+
let date = access.repo().bound_to_date(Bound::Commit(tag.clone()))?;
512+
eprintln!(
513+
"translating --{which}={tag} to {date}",
514+
date = date.format(YYYY_MM_DD)
515+
);
516+
*bound = Some(Bound::Date(date));
514517
}
515518
}
516519
Ok(())
517520
};
518-
fixup(start)?;
519-
fixup(end)?;
521+
fixup("start", start)?;
522+
fixup("end", end)?;
520523
Ok(())
521524
}
522525

0 commit comments

Comments
 (0)