#1 Use full timestamps (with timezone) for changelog entries
Opened 4 years ago by ngompa. Modified 4 years ago
fedora-infra/ ngompa/generate_changelog use-full-timestamps  into  main

file modified
+1 -1
@@ -29,7 +29,7 @@ 

  

    git log --after=2018-01-28 --pretty=oneline \

      --format='%w(1000)**%h**%n* %cd %an <%ae>%n%w(60,0,2)- %s%n' \

-     --date="format:%a %b %d %Y"

+     --date="format:%a %b %d %T %Z %Y"

  

  

  

file modified
+2 -2
@@ -99,9 +99,9 @@ 

              message = wrapper.fill(commit.message.split('\n')[0].strip('- '))

  

              if last_commit:

-                 print(f"* {commit_dt.strftime('%a %b %d %Y')} {commit.author.name} <{commit.author.email}> - {nvr[1]}-{nvr[2]}")

+                 print(f"* {commit_dt.strftime('%a %b %d %T %Z %Y')} {commit.author.name} <{commit.author.email}> - {nvr[1]}-{nvr[2]}")

              else:

-                 print(f"* {commit_dt.strftime('%a %b %d %Y')} {commit.author.name} <{commit.author.email}>")

+                 print(f"* {commit_dt.strftime('%a %b %d %T %Z %Y')} {commit.author.name} <{commit.author.email}>")

              print("- %s" % message)

              print()

  

RPM has supported using full timestamps with timezone information since
RPM 4.14 (Fedora 28, RHEL/CentOS 8). Let's actually include that
information since it provides total fidelity from a Git commit to a
changelog entry.

Signed-off-by: Neal Gompa ngompa13@gmail.com

rebased onto 474f64a

4 years ago

I'm torned a bit on this considering el7 is still around :(

In principle, we could produce one or the other format depending on if the target is EL7 or not. However:

  • It doesn't look as if this works as intended, because running either the script or the git command line doesn't actually put time zone information into the generated changelog header, in the first case because the datetime objects don't have any time zone information associated with them.
  • It wouldn't help us with mapping changelog entries to commits because a) multiple commits can have the same timestamp (rare, but still) and b) the same timestamp can be presented differently depending on the time zone (or lack thereof) associated with it.
Metadata