Skip to content

Commit

Permalink
Add option to hide the timestamp from the changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaodan committed May 27, 2022
1 parent 5f39a0e commit 8c171d0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions plugins/repodiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def set_argparser(parser):
parser.add_argument("--hide-author", action="store_true",
help=_("Hide the authors name and email address"
"in the changelog."))
parser.add_argument("--hide-timestamp", action="store_true",
help=_("Hide the timestamp in the changelog."))
parser.add_argument("--summary", action="store_true",
help=_("Sum up changes after all changes have been listed."))

Expand Down Expand Up @@ -183,12 +185,16 @@ def report_modified(pkg_old, pkg_new=None, sub_pkgs=[]):
chlog['author'] == old_chlog['author'] and
chlog['text'] == old_chlog['text']):
break
msgs.append('### %s %s\n%s' % (
chlog['timestamp'].strftime("%a %b %d %Y"),
dnf.i18n.ucd(chlog['author'])
if not self.opts.hide_author else
"- %s" % (re.search(".+ - (.+?)$", chlog['author']).group(1)),
dnf.i18n.ucd(chlog['text'])))
if not self.opts.hide_timestamp:
msgs.append('### %s %s\n%s' % (
chlog['timestamp'].strftime("%a %b %d %Y"),
dnf.i18n.ucd(chlog['author'])
if not self.opts.hide_author else
"- %s" % (re.search(".+ - (.+?)$", chlog['author']).group(1)),
dnf.i18n.ucd(chlog['text'])))
else:
msgs.append(dnf.i18n.ucd(chlog['text']))

if not self.opts.size:
msgs.append("")
if self.opts.size:
Expand Down

0 comments on commit 8c171d0

Please sign in to comment.