Skip to content
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

Augment getTagByName to include getReferenceCommit #403

Closed
tbranyen opened this issue Feb 13, 2015 · 6 comments
Closed

Augment getTagByName to include getReferenceCommit #403

tbranyen opened this issue Feb 13, 2015 · 6 comments

Comments

@tbranyen
Copy link
Member

No description provided.

@maxkorp
Copy link
Collaborator

maxkorp commented Feb 19, 2015

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.

@johnhaley81
Copy link
Collaborator

Yeah that's a great idea.

On Thu, Feb 19, 2015, 9:58 AM Max Korp notifications@github.com 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).

@maxkorp
Copy link
Collaborator

maxkorp commented Feb 19, 2015

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.

@johnhaley81
Copy link
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.

@maxkorp
Copy link
Collaborator

maxkorp commented Feb 19, 2015

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?

@johnhaley81
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants