Git client on the iPhone, possible? How? - iphone

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 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.

Related

How can use Github for my developer to work on my backend without having to share to much credentials and code?

I have a Node.js backend running on an EC2 Instance with a Mongo DB.
I need to make some changes to my iOS App along with the Backend. I have already shared the Frontend Source Code with the developer, but I don't want to share the backend (if I don't have to directly..)
I have come across Github but I am totally new to it - also I am not a developer myself.
How can I use it for my purpose? Also, can 2 developers - say iOS developer and android developer then work on the code at the same time, without causing any mess?
What would you suggest me to do?
Appreciate any help! Thank you
Android and iOS developer can work together it will not cause any issue.
Now coming to your question first of all why a frontend developer needs to look at the backend code?..
If it's necessary ask them particularly what they wants to know may be backend code documentation can help or if the guy just need a look at some specific thing you can use some remote softwares like TeamViewer or else you don't have any options he have to look at code you can use last option to ask him sign the NDA (Non Disclosure Agreement)

Version Control from a different age

At my work I'm on a separate network to my colleague due to clearance reasons, and we both need to share code. I am wondering what the best versioning system would be? There's got to be something better than having project1.zip, project2.zip , etc - but something not as expansive as git or hg.
I would still recommend Git, as it allows to:
make a bundle (only one file, and it can be an incremental bundle)
mail that bundle to your colleague (meaning it will work even if your separate networks have no other way to communicate)
The idea is to exchange one file (from which you can pull any new history bundled in it).
And Git is very cheap for creating and adding a repo when an existing code base is already there.
That being said, any communication procedure will have to be approved by your employer: don't bypass any security measure ;)

Data syncing with DropBox API and iOS

I have an iOS app which stores data in the local directory. I'd like to be able to sync this data between multiple devices running my app. Currently this is using core data, but I'd expect to have to change to some text-based file storage system to make syncing easier.
I was expecting the DropBox API would make this nice and easy, and that I could tell the API to simply sync the contents of my data folder on startup/save. However it seems the DropBox API is nothing more than a glorified way of uploading and downloading files.
Am I wrong on this assumption? Can the DropBox API actually make it easy to keep a folder full of text files in sync? If not, is there some other service or even advice you can give? Syncing is hard - I was hoping DropBox would make it easier.
Using /metadata, getting information about the contents of a folder couldn't be easier. All you need to do is check the modified date, and if it's different than yours locally, perform the appropriate action. It will also give you the metadata for any file contents, so you can pick out which files need to be uploaded / downloaded / added / removed as necessary.
Any more functionality than this would be very application-dependent; you can decide for yourself when and how you want to deal with differing files.
Dropbox API Documentation
Won't repeat since Andy has answered your question, thought you may also find this tutorial helpful:
http://www.nanaimostudio.com/blog/2011/1/20/how-to-synchronize-your-app-data-using-dropbox-api.html
Check out the new DropBox Sync API.
As ohho mentioned, there's the DropBox Sync API available now which I think will do what you mentioned (I haven't tried it personally, as I integrated support for Dropbox in my app using the earlier SDK, before this came along). This will probably suffice if you're just working with dropbox.
In my case I've been starting to add support for additional online storage ("Cloud") services to my app, and am finding that it's somewhat challenging to deal with the differences between them in how they handle various concepts like authentication, version, naming etc. For example Dropbox's API references files according to their path, whereas Box's API references files according to their file id (which has an associated path, but I believe remains the same if the file is moved). Then there's also all the issues of conflict resolution (aka merging) which come about when multiple clients try and sync conflicting changes to the server.
I've actually been recently considering starting an open source project to develop a library which can connect to all the major services, and provide an abstraction layer that papers over their differences, and also handles the syncing process for you. I've actually got some code already (which I haven't publicly released to date) but could use that to get the project started.
Would this be of use to you? Would you (or any others) be willing to participate in such an effort?
(note to mods: I realise this may be deviating somewhat off-topic - sorry about that. If you can recommend a more suitable forum to discuss this I'd be happy to take the conversation there).
There is a RSS feed that can be limited to one of the shared folders but it kind of filters events to keep volumes low.

Ideas on setting up a version control system

I've been tasked with setting up a version control for our web developers. The software, which was chosen for me because we already have other non-web developers using it, is Serena PVCS.
I'm having a hard time trying to decide how to set it up so I'm going to describe how development happens in our system, and hopefully it will generate some discussion on how best to do it.
We have 3 servers, Development, UAT/Staging, and Production. The web developers only have access to write and test their code on the Development server. Once they write the code, they must go through a certification process to get the code moved to UAT/Staging, then after the code is tested thoroughly there, it gets moved to Production.
It seems like making the Developers use version control for their code on Development which they are constantly changing and testing would be an annoyance. Normally only one developer works on a module at a time so there isn't much, if any, risk of over-writing other people's work.
My thought was to have them only use version control when they are ready to go to UAT/Staging. This allows them to develop and test without constantly checking in their code.
The certification group could then use the version control to help see what changes had been made to the module and to make sure they were always getting the latest revision from the developer to put up on UAT/Staging (now we rely on the developer zip'ing up their changed files and uploading them via a web request system).
This would take care of the file side of development, but leaves the whole database side out of version control. That's something else that I need to consider...
Any thoughts or ideas would be greatly appreciated. Thanks.
I would not treat source control as annoyance. See Nicks answer for the reasons.
If I were You, I would not decide this on my own, because it is not a
matter of setting up a version control software on some server but
a matter of changing and improving development procedures.
In Your case, it might be worth explaining and discussing release branches
with Your developers and with quality assurance.
This means that Your developers decide which feature to include into a release
and while the staging crew is busy on testing the "staging" branch of the source,
Your developers can already work on the next release without interfering with the staging team.
You can also think about feature branches, which means that there is a new branch for every specific new feature of the web site. Those branches are merged back, if the feature is implemented.
But again: Make sure, that Your teams agreed to the new development process. Otherwise, You waste Your time by setting up a version control system.
The process should at least include:
When to commit.
When to branch/merge.
What/When to tag.
The overall work flow.
I have used Serena, and it is indeed an annoyance. In addition to the unpleasantness of the workflow overhead Serena puts on top of the check in-check out process, it is a real pain with regard to doing anything besides the simplest of tasks.
In Serena ChangeMan, all code on local machines is managed through a central server. This is a really bad design. This means a lot of day-to-day branch maintenance work that would ordinarily be done by developers has to go through whomever has administrator privileges, making that person 1) a bottleneck and 2) embittered because they have a soul-sucking job.
The centralized management also strictly limits what developers are able to do with the code on their own machine. For example, if you want to create a second copy of the code locally on your box, just to do a quick test or whatever, you have to get the administrator to set up a second repository on your box. When you limit developers like this, you limit the productivity and creativity of your team.
Also, the tools are bad and the user interface is horrendous. And you will never be able to find developers who are already trained to use it, because its too obscure.
So, if another team says you have to use Serena, push back. That product is terrible.
Using source control isn't any annoyance, it's a tool. Having the benefits of branching and tagging is invaluable when working with new APIs and libraries.
And just a side note, a couple of months back one of the dev's machine's failed and lost all his newest source, we asked when the last time he committed code to the source control and it was 2 months. Sometimes just having it to back up stuff when you reach milestones is nice.
I usually commit to source control a couple of times a week, depending if I've hit a good stopping point and I'm about to move on to something different or bigger.
Following on from the last two good points I would also ask your other non-web developers what developmet process they are using so you won't have to create a new one. They would also have encountered many of he problems that occur in your environment, both technical using the same OS and setup and managerial.

Programming for the iPhone with a partner far away?

How can I program for the iPhone with my friend who lives very far away? After I fix something, do I have to send the whole thing over to him and again and again and again? Any ideas?
Thank you! :)
You some kind of version control system (Subversion, GIT or whatever) that will help you easily merge your changes.
If you change something your friend will just update his sources and will see your changes and vice versa. Using version control is also a good idea if you are the only programmer in the project as you can always easily revert your changes, always have the full history etc.
Use a SCM(Source Code Management) system. XCode has support for CVS and/or SubVersion, so you could set that up.
The minimum requirement is to make your code available from both sides and find a way to prevent conflicts. This is achieved with a SCM server. I have already successfully tried code.google.com and www.beanstalkapp.com with Xcode, but many others exist.
Moreover, you may need an issue tracking server. My personal choice is www.lighthouseapp.com which integrates with www.beanstalkapp.com. Also here many alternatives are available.
Finally, don't forget basic communication with phone and e-mail.
Use GitHub. They have excellent documentation and git is nice to work with for distributed work.
As others have mentioned, a Version Control System, I prefer git, but subversion will also work, and some form of communication. I'm sure you already have e-mail, and instant messaging might work, but I've found that communicating through some form of VOIP software increases productivity, such as Skype.
+1 for http://www.beanstalkapp.com, with http://www.versionsapp.com for posting and getting updates.