New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lightweight tags #141
Comments
STATIC int git_tag_foreach_cbb(const char *name, git_oid *oid, void *payload) {
dSP;
int rv = 0;
git_object *tag;
SV *cb_arg = NULL;
git_foreach_payload *pl = payload;
int rc = git_object_lookup(&tag, pl -> repo_ptr -> repository, oid, GIT_OBJ_ANY);
git_check_error(rc);
if (git_object_type(tag) != GIT_OBJ_TAG) {
git_object_free(tag);
return 0;
} The correct thing to do here is for a |
Thanks! PS The urgency for Gitpan is considerably reduced, I used |
I'm actually looking right at this at the moment. Looks like the best I can do would be to improve the interface. A little bit weary of adding too much magic on top of libgit2, as it will just come back to bite in future (don't want to unnecessarily break compatibility in future). |
What I would suggest is to leave Git::Raw as a thin wrapper around This offers a solution for lightweight tags. git_tag_foreach() and I see two ways forward...
I would suggest Git::Raw::Tag->foreach() is left as close to
|
Agree on 1. I'm busy with the changes so 2 is really user specific, not something I would like to add to |
This should be better now :) |
I've created a new release (https://metacpan.org/release/JACQUESG/Git-Raw-0.45), see if it works better for you. |
Thanks for your input, let me know if you have more suggestions/problems. |
I would like to make use of Git::Raw in Gitpan, but it's missing support for lightweight tags. Gitpan needs to make a lot of tags and full, cryptographically secure, annotated tags are overkill. I realize they can be created with
Git::Repository::Reference->create
, but lightweight tags are not well integrated into the rest of Git::Raw.I began to implement it, but ran into a problem. Git::Raw::Tag represents an annotated tag object. Lightweight tags do not appear to have a tag object, they're references to a commit.
Where I'm stuck in implementing lightweight tags is where they fit relative to annotated tags. Should they be left as references so
Git::Raw::Reference->create_lightweight_tag()
is a wrapper aroundGit::Raw::Reference->create("refs/tags/$name", $repo, $commit)
?Or should Git::Tag attempt to integrate them? I noticed there's a test in t/03-tag.t which appears to deliberately check that
Git::Raw::Repository->tags
does not see lightweight tags which is a bit confusing to command line users. I wonder if this is an undocumented quirk of git_tag_foreach, because git_tag_list does appear to return both annotated and lightweight tags, as evidenced in the libgit2 tag example.What are your thoughts?
The text was updated successfully, but these errors were encountered: