开发者

Git client on the iPhone, possible? How?

开发者 https://www.devze.com 2022-12-15 07:54 出处:网络
Is it possible to embed git in the iPhone app? Only in a passive mode, i.e. to be able to read commit messages (with date and user) and diffs given some online git repository in order to present it in

Is it possible to embed git in the iPhone app? Only in a passive mode, i.e. to be able to read commit messages (with date and user) and diffs given some online git repository in order to present it in some开发者_Python百科 readable table views?


I'm one of the co-authors of cocoagit, which is currently an unfinished implementation of the core git functionality in Objective-C. There has not been much activity in the last 6 months. Unfortunately, it is not far quite far enough along to do everything you need. We can read commits, and have preliminary support for cloning repos, but we can't do diffs yet. Geoff and I would both like to have more time to work on it again, but in the meantime, we would gladly welcome any contributions.

Alternatively, I second the recommendations of previous posters to consider using github, or building your own web service to provide the necessary data.


Git (the command-line client) has been ported to jailbroken iPhones.


It would be easier to write a webapp that generated iPhone specific formatted output. Anything is possible on the iPhone, but to get an App on it you have to pay the $99 to join the club and then run the gauntlet of the Approval Process. A web app doesn't have to be approved by anyone.


It would be possible if you could statically compile the required git functions into your executable. It would require cloning the repository to the device’s disk though.

I’m not sure what your use-case is, but using a hosted website such as GitHub, or making your own web service if that is not possible, would likely be more sensible.


Not sure if this github client for iphone would offer any pointers

http://github.com/schacon/igithub/


It is definitely possible. The BugBranch app does this. According to the about section of the app, it uses libgit2 and objective-git.


You've got a couple options:

1) Get git(1) cross compiling for ARM and the iPhone and then embed them. 2) Use Dulwich and write a small tool you can drive with NSTask that does what you need (don't link your code directly to this or copy their implementation -- it's GPL). This is likely easier than option 1. 3) Write a web server which does what you need and then have your iPhone client access this.

It really depends on what you're doing, why you're doing it, and what infrastructure you've already got set up which option will be the best. For instance, if you already have any sort of server component already (e.g. for push notifications) I would recommend option 3.

0

精彩评论

暂无评论...
验证码 换一张
取 消