Skip to content

Augment getTagByName to include getReferenceCommit #403

Closed

Description

@tbranyen
No description provided.

Activity

  1. maxkorp commented on Feb 19, 2015

    @maxkorp
    Collaborator

    is it just me, or are all of the getTagByName/getTag/GetBranch/getReference/getBranchCommit methods a bit inconsistant. Seems like they should be normalized a bit, so they all have a getType/getTypeByName/getTypeCommit/getTypeCommitByName variant.

    as it stands, getTagByName doesn't need to include getReferenceCommit, since the things returning commits are named get{type}Commit, not get{type}.

    I'll set about normalizing them all a bit, if nobody has any complaints.

  2. johnhaley81 commented on Feb 19, 2015

    @johnhaley81
    Collaborator

    Yeah that's a great idea.

    On Thu, Feb 19, 2015, 9:58 AM Max Korp [email protected] wrote:

    is it just me, or are all of the
    getTagByName/getTag/GetBranch/getReference/getBranchCommit methods a bit
    inconsistant. Seems like they should be normalized a bit, so they all have
    a getType/getTypeByName/getTypeCommit/getTypeCommitByName variant.

    —
    Reply to this email directly or view it on GitHub
    #403 (comment).

  3. maxkorp commented on Feb 19, 2015

    @maxkorp
    Collaborator

    So a bit of an oddity here, we have to remember that "tags" are annotated tags, which are different from lightweight tags, which are what you usually think of when saying tag. Lightweight tags, references in general, branches etc don't have "oids" per se, just the targets and names. Only annotated tags have oids, because they exist inside of the object db. Annotated tags can also point to like, pretty much whatever you want. Do we want to rename tags (in the sense of annotated tags) to annotatedTag to make things clear?
    That way tag can just be for normal tags, like one would expect.

  4. johnhaley81 commented on Feb 19, 2015

    @johnhaley81
    Collaborator

    I don't know about this. That would be a pretty serious deviation from how we have historically done things with libgit2 (i.e. don't rename groups/classes). I like your previous method more.

  5. maxkorp commented on Feb 19, 2015

    @maxkorp
    Collaborator

    Yeah, just the previous method doesn't exactly make sense, TBH, since only annotated tags have an oid of their own. I suppose we could do getBranch/getBranchCommit/getReference/getReferenceCommit/getTag/getTagCommit, and for any of those if the ref doesnt point at a commit, just return undefined? or try grabbing it and let the chain error out?

  6. johnhaley81 commented on Feb 23, 2015

    @johnhaley81
    Collaborator

    All of those will point at a commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions