code: def log_dates(repo, revs=None):
      """Get log timestamps.
  
      Parameters
      ----------
      repo : GitRepo
      revs : list, optional
          Extract timestamps from commit objects that are reachable from these
          revisions.
  
      Returns
      -------
      A generator object that returns a tuple with the commit hexsha, author
      timestamp, and committer timestamp.
      """
      opts = [] if revs else ["--branches"]
      try:
          for line in repo.get_revisions(
              revs, fmt="%H %at %ct", options=opts
          ):
              (
                  hexsha,
                  author_timestamp,
                  committer_timestamp,
              ) = line.split()
              yield hexsha, int(author_timestamp), int(
                  committer_timestamp
              )
      except CommandError as e:
          # With some Git versions, calling `git log --{all,branches,remotes}` in
          # a repo with no commits may signal an error.
          if "does not have any commits yet" not in e.stderr:
              raise e
  
file_path: datalad/datalad/support/repodates.py
imports: import logging
  import operator
  import re
  import time
  from datalad.log import log_progress
  from datalad.support.exceptions import CommandError
  from datalad.support.gitrepo import GitRepo
label_desc: Use image node_id 7 for calling a global function with example usage: log_dates(repo, revs) without return types