libgit2 / libgit2/pygit2

tag objects from references

Open
#856 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

It looks like it is currently impossible to access the Tag object from a Reference that is a tag.

The C API provides git_reference_is_tag and git_tag_lookup, but there doesn't seem to be an equivalent functionality in pygit2. Searching for git_tag_* functions in src/ suggests that there are no hooks for the git_tag_* functions.

Currently Tag is a subclass of Object. This doesn't really make sense. Unlike Blob, Tree, and Commit a Tag is a reference to a Commit. Also, the docs for git_tag_tagger leans toward Tag.Tagger object to just be of type Signature instead.

It makes sense to make Tag a subclass of Reference similar to Branch, remove Tag.Tagger (and replace with the already existing Signature, changing Repository.create_tag to match), and have Repository.References.get() return a Tag object where appropriate.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the existing hooks in src/ and the Repository.References.get() and Repository.create_tag entry points, then compare them with git_reference_is_tag, git_tag_lookup, and the other git_tag_* functions. Done means tag references expose a Tag object, Tag follows the proposed Reference model, and tagger handling uses Signature consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.