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

inconsistency in tags() ? #274

Open
kforner opened this issue Mar 28, 2017 · 4 comments
Open

inconsistency in tags() ? #274

kforner opened this issue Mar 28, 2017 · 4 comments

Comments

@kforner
Copy link

kforner commented Mar 28, 2017

If I tag a repo using git2r::tag(), git2r::tags() output is a (list of) git_tabobject.

but if I add the tag using the git command: git tag toto_1, the output is a (list of) git_commitobject.

Is this expected ? (This is not documented)
My use case is to sort the tags by time (cf next issue).

Thanks.

@stewid
Copy link
Member

stewid commented Apr 3, 2017

The goal was not to make git2r identical to command line git, but being able to work with the git data structures from R and run some basic git commands. I think that the documentation says that tag returns a git_tag object and that tags return a list of git_tag objects.

@kforner
Copy link
Author

kforner commented Apr 3, 2017

Sorry I was not clear enough.
Suppose I create two tags, one using command-line git, and one using git2r::tag, then
git2r::tags output a list of two objects, one is git_tag, the other a git_commit

> str(tgs)
List of 2
 $ COUCOU2:Formal class 'git_tag' [package "git2r"] with 6 slots
  .. ..@ sha    : chr "4270dcf162eec9b36196c9d7884958616c94353a"
  .. ..@ message: chr "tag"
  .. ..@ name   : chr "COUCOU2"
  .. ..@ tagger :Formal class 'git_signature' [package "git2r"] with 3 slots
  .. .. .. ..@ name : chr "karl"
  .. .. .. ..@ email: chr "karl.forner@quartz.bio"
  .. .. .. ..@ when :Formal class 'git_time' [package "git2r"] with 2 slots
  .. .. .. .. .. ..@ time  : num 1.49e+09
  .. .. .. .. .. ..@ offset: num 120
  .. ..@ target : chr "ab0ed9c25701bf132d6d3d39559067081b0e252b"
  .. ..@ repo   :Formal class 'git_repository' [package "git2r"] with 1 slot
  .. .. .. ..@ path: chr "/home/docker/workspace/standard_proj/.git/"
 $ toto   :Formal class 'git_commit' [package "git2r"] with 6 slots
  .. ..@ sha      : chr "ab0ed9c25701bf132d6d3d39559067081b0e252b"
  .. ..@ author   :Formal class 'git_signature' [package "git2r"] with 3 slots
  .. .. .. ..@ name : chr "Quartz Bio"
  .. .. .. ..@ email: chr "log@quartz.bio"
  .. .. .. ..@ when :Formal class 'git_time' [package "git2r"] with 2 slots
  .. .. .. .. .. ..@ time  : num 1.49e+09
  .. .. .. .. .. ..@ offset: num 120
  .. ..@ committer:Formal class 'git_signature' [package "git2r"] with 3 slots
  .. .. .. ..@ name : chr "Quartz Bio"
  .. .. .. ..@ email: chr "log@quartz.bio"
  .. .. .. ..@ when :Formal class 'git_time' [package "git2r"] with 2 slots
  .. .. .. .. .. ..@ time  : num 1.49e+09
  .. .. .. .. .. ..@ offset: num 120
  .. ..@ summary  : chr "dev"
  .. ..@ message  : chr "dev\n"
  .. ..@ repo     :Formal class 'git_repository' [package "git2r"] with 1 slot
  .. .. .. ..@ path: chr "/home/docker/workspace/standard_proj/.git/"

@stewid
Copy link
Member

stewid commented Apr 3, 2017

Thanks, for the follow up. git2r creates an annotated tag. However, it seems that git2r reads a lightweight tag as a commit. I have to look into this and see if it can be improved.

@dgJacks0n
Copy link

Any updates on this? I see the same behavior in git2r version 0.25.2. I'm using git2r to retrieve information about tags and having to test for, handle and align the values from the different return values adds overhead - plus the 'git commit' object that git2r returns does not include the tag name for a lightweight tag.

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