-
-
Notifications
You must be signed in to change notification settings - Fork 954
Get annotated tags #1937
Get annotated tags
#1937
-
I need to use GItPython API to get annotated tags. If I do next:
repo = git.Repo(repo_path) tags = repo.tags annotated_tags = [tag for tag in tags]
I get list of lightweight tags. How do I get a list of annotated tags?
I need for annotated tags info: tag, tagger, tagged_date
Thanks for any help
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
Byron
Jul 4, 2024
Maybe this helps: https://chatgpt.com/share/b1010a46-8079-414e-89ab-da43b2af90b9 .
Here is a copy of the code it produced:
import git # Path to your repository repo_path = '/path/to/your/repo' # Initialize the Repo object repo = git.Repo(repo_path) # Get all tags all_tags = repo.tags # Filter annotated tags annotated_tags = [tag for tag in all_tags if tag.tag is not None] # Print the annotated tags for tag in annotated_tags: print(f"Annotated Tag: {tag.name}") print(f"Tag Message: {tag.tag.message}") print(f"Tag Object: {tag.tag.object}")
Replies: 1 comment
-
Maybe this helps: https://chatgpt.com/share/b1010a46-8079-414e-89ab-da43b2af90b9 .
Here is a copy of the code it produced:
import git # Path to your repository repo_path = '/path/to/your/repo' # Initialize the Repo object repo = git.Repo(repo_path) # Get all tags all_tags = repo.tags # Filter annotated tags annotated_tags = [tag for tag in all_tags if tag.tag is not None] # Print the annotated tags for tag in annotated_tags: print(f"Annotated Tag: {tag.name}") print(f"Tag Message: {tag.tag.message}") print(f"Tag Object: {tag.tag.object}")
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Answer selected by
AlesyaSeliazniova30032012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment