code: def tag(self, name=None):
          
  
          command = ["git", "tag"]
  
          if not name:
              command.extend(
                  [
                      "-l",
                      "--sort=creatordate",
                      "--format=%(creatordate:short)%09%(refname:strip=2)",
                  ]
              )
  
              command_output = _run_command(command).strip()
  
              if command_output == "":
                  return []
  
              tag_text_list = command_output.split("\n")
              tag_list = [Tag(text) for text in tag_text_list]
  
              return list(reversed(tag_list))
  
          command.extend(["-a", name, "-m", '""'])
          return _run_command(command)
docs: Create and list tag objects running git-tag command