first - hide a provate token while posting to internet ) second - check that you see all commits in activity block, maybe its not indexed. third - while you ask for master, you get commit that point to master only. strange characters - troubles with encoding, check you locale language. also check that - https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/README.md#pagination
понедельник, 9 ноября 2015 г., 10:37:37 UTC+3 пользователь Ezio Zhang написал: > > I used api with curl and encounter two question. > > 1. I tried this: > curl -H "PRIVATE-TOKEN: Gb3kM2CtpxokUBNXGw2e" " > http://192.168.0.111:8080/api/v3/projects/63/repository/commits" |json_pp > but it only returns 4 commits, and it's not the newest or oldest. How Can > I get all? > > 2. Then I tried to get the comments of one comiit like this: > curl -H "PRIVATE-TOKEN: Gb3kM2CtpxokUBNXGw2e" " > http://192.168.0.111:8080/api/v3/projects/63/repository/commits/master/comments" > > |json_pp > this command return that: > [ > { > "path" : "README", > "line_type" : "new", > "author" : { > "state" : "active", > "id" : 1, > "web_url" : "http://192.168.0.111/u/root", > "name" : "Administrator", > "avatar_url" : " > http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40&d=identicon > ", > "username" : "root" > }, > * "note" : "0xc0000?", my comments has chinese **character* > "line" : 89 > } > ] > I cannot know which comments does this represent, and how to show > non-english characters? > > > thanks a lot. > > On Fri, Nov 6, 2015 at 5:50 PM Ezio Zhang <leil...@gmail.com <javascript:>> > wrote: > >> thanks a lot. I will have a try. >> >> On Fri, Nov 6, 2015 at 2:47 PM Achilleas Pipinellis <mark...@gmail.com >> <javascript:>> wrote: >> >>> On 11/06/2015 08:05 AM, Ezio Zhang wrote: >>> > thanks. but I have a question that : >>> > >>> > |GET /projects/:id/repository/commits| >>> > >>> > how can I use GET in shell? I tried install GET with apt,but I don't >>> > know where to use it. >>> > Or these API are via web? >>> > >>> >>> These are API method calls and you can use curl. For example: >>> >>> curl -H "PRIVATE-TOKEN: t0k3n" >>> https://gitlab.com/api/v3/projects/403626/repository/commits | json_pp >>> >>> 403626 is the id of the project. A list of your projects can be found >>> with: >>> >>> curl -H "PRIVATE-TOKEN: t0k3n" https://gitlab.com/api/v3/projects | >>> json_pp >>> >>> Then look for the id you are interested in. Of course, change gitlab.com >>> with the url of your instance if you are using your own. >>> >>> Your private token can be found under /profile/account. >>> >>> json_pp is a tool provided by perl and has a nicer JSON output combined >>> with curl. It is optional. >>> >>> Actually I'm working on improving the API docs with curl examples for >>> every call. This is a work in progress, see >>> https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/681 >>> >>> In your case >>> >>> https://gitlab.com/gitlab-org/gitlab-ce/blob/fedfa53599ceb184bc9d26284b3cf589cff73dae/doc/api/commits.md >>> >>> >>> -- >>> Blog: http://axilleas.me >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "GitLab" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/gitlabhq/lJwwdibQqjs/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> gitlabhq+u...@googlegroups.com <javascript:>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/gitlabhq/563C4CD8.8060209%40gmail.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> God is in his heaven, all rights with the world. >> > -- > God is in his heaven, all rights with the world. > -- You received this message because you are subscribed to the Google Groups "GitLab" group. To unsubscribe from this group and stop receiving emails from it, send an email to gitlabhq+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/gitlabhq/143079ed-7c81-4b84-ad7a-c4368209567e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.