{"action":"created","issue":{"url":"https://api.github.com/repos/ropensci/git2r/issues/219","labels_url":"https://api.github.com/repos/ropensci/git2r/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/ropensci/git2r/issues/219/comments","events_url":"https://api.github.com/repos/ropensci/git2r/issues/219/events","html_url":"https://github.com/ropensci/git2r/issues/219","id":128575391,"number":219,"title":"No commits if git check --depth is used","user":{"login":"nparley","id":6215361,"avatar_url":"https://avatars.githubusercontent.com/u/6215361?v=3","gravatar_id":"","url":"https://api.github.com/users/nparley","html_url":"https://github.com/nparley","followers_url":"https://api.github.com/users/nparley/followers","following_url":"https://api.github.com/users/nparley/following{/other_user}","gists_url":"https://api.github.com/users/nparley/gists{/gist_id}","starred_url":"https://api.github.com/users/nparley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nparley/subscriptions","organizations_url":"https://api.github.com/users/nparley/orgs","repos_url":"https://api.github.com/users/nparley/repos","events_url":"https://api.github.com/users/nparley/events{/privacy}","received_events_url":"https://api.github.com/users/nparley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-25T16:25:12Z","updated_at":"2016-01-26T06:39:05Z","closed_at":null,"body":"No commits are given if the repo is cloned using the --depth argument. E.g. \r\n\r\n```\r\ngit clone --depth=50 https://github.com/hadley/devtools.git /tmp/devtools/\r\n```\r\n\r\nleads to:\r\n\r\n```R\r\n> repo <- repository('/tmp/devtools')\r\n> commits(repo)\r\nlist()\r\n> repo\r\nLocal:    master /tmp/devtools/\r\nRemote:   master @ origin (https://github.com/hadley/devtools.git)\r\nHead:     [2c08890] 2016-01-25: Version bump\r\n```\r\n\r\nthe latest commits are still there of course:\r\n\r\n```\r\n$ git log\r\ncommit 2c0889068655e6a8774363de8b413e6be8f9e84e\r\nAuthor: hadley <h.wickham@gmail.com>\r\nDate:   Mon Jan 25 08:23:05 2016 -0600\r\n\r\n    Version bump\r\n\r\ncommit acae7cb43bc9618d5be8a7932e37bdc7728f8782\r\nAuthor: hadley <h.wickham@gmail.com>\r\nDate:   Fri Jan 22 09:17:41 2016 -0600\r\n\r\n    Final release prep\r\n\r\n```\r\n\r\nGetting the whole history works:\r\n\r\n```\r\ngit clone https://github.com/hadley/devtools.git /tmp/devtools_all/\r\n```\r\n\r\ngives\r\n\r\n```R\r\n> library('git2r')\r\n> repo <- repository('/tmp/devtools_all')\r\n> commits(repo, n=2)\r\n[[1]]\r\n[2c08890] 2016-01-25: Version bump\r\n\r\n[[2]]\r\n[acae7cb] 2016-01-22: Final release prep\r\n\r\n> repo\r\nLocal:    master /tmp/devtools_all/\r\nRemote:   master @ origin (https://github.com/hadley/devtools.git)\r\nHead:     [2c08890] 2016-01-25: Version bump\r\n\r\n```\r\n\r\nIs there a way to get commits() to show the latest commits even when the whole history is not downloaded?"},"comment":{"url":"https://api.github.com/repos/ropensci/git2r/issues/comments/174858294","html_url":"https://github.com/ropensci/git2r/issues/219#issuecomment-174858294","issue_url":"https://api.github.com/repos/ropensci/git2r/issues/219","id":174858294,"user":{"login":"stewid","id":1815965,"avatar_url":"https://avatars.githubusercontent.com/u/1815965?v=3","gravatar_id":"","url":"https://api.github.com/users/stewid","html_url":"https://github.com/stewid","followers_url":"https://api.github.com/users/stewid/followers","following_url":"https://api.github.com/users/stewid/following{/other_user}","gists_url":"https://api.github.com/users/stewid/gists{/gist_id}","starred_url":"https://api.github.com/users/stewid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewid/subscriptions","organizations_url":"https://api.github.com/users/stewid/orgs","repos_url":"https://api.github.com/users/stewid/repos","events_url":"https://api.github.com/users/stewid/events{/privacy}","received_events_url":"https://api.github.com/users/stewid/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T06:39:05Z","updated_at":"2016-01-26T06:39:05Z","body":"I can add the workaround to `git2r::commits` and use it if `is_shallow(repo)` is `TRUE`"}}