Skip to content

Commit 8c171d0

Browse files
committed
Add option to hide the timestamp from the changelog
1 parent 5f39a0e commit 8c171d0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

plugins/repodiff.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def set_argparser(parser):
7878
parser.add_argument("--hide-author", action="store_true",
7979
help=_("Hide the authors name and email address"
8080
"in the changelog."))
81+
parser.add_argument("--hide-timestamp", action="store_true",
82+
help=_("Hide the timestamp in the changelog."))
8183
parser.add_argument("--summary", action="store_true",
8284
help=_("Sum up changes after all changes have been listed."))
8385

@@ -183,12 +185,16 @@ def report_modified(pkg_old, pkg_new=None, sub_pkgs=[]):
183185
chlog['author'] == old_chlog['author'] and
184186
chlog['text'] == old_chlog['text']):
185187
break
186-
msgs.append('### %s %s\n%s' % (
187-
chlog['timestamp'].strftime("%a %b %d %Y"),
188-
dnf.i18n.ucd(chlog['author'])
189-
if not self.opts.hide_author else
190-
"- %s" % (re.search(".+ - (.+?)$", chlog['author']).group(1)),
191-
dnf.i18n.ucd(chlog['text'])))
188+
if not self.opts.hide_timestamp:
189+
msgs.append('### %s %s\n%s' % (
190+
chlog['timestamp'].strftime("%a %b %d %Y"),
191+
dnf.i18n.ucd(chlog['author'])
192+
if not self.opts.hide_author else
193+
"- %s" % (re.search(".+ - (.+?)$", chlog['author']).group(1)),
194+
dnf.i18n.ucd(chlog['text'])))
195+
else:
196+
msgs.append(dnf.i18n.ucd(chlog['text']))
197+
192198
if not self.opts.size:
193199
msgs.append("")
194200
if self.opts.size:

0 commit comments

Comments
 (0)