Download revision history from cloud9 - cloud9-ide

How do I download the revision history of a file from cloud9? I can view it in cloud9, but for documentation purposes, I need to be able to review it offline. An alternate solution would be instructions on how to copy a file from one workspace to another while keeping the file revision history.

Unfortunately it's not possible to copy a file from one workspace to another while also keeping the history as the history is stored in the database, not in the file itself. There is no way to download the revision history for a file.

Related

Version control of a digital image and the file that produced it

I'm mostly working on my own with Blender. I create a blend file and use it to render and save an image. Then I fiddle some more, render another image hopefully save the Blender file and then repeat. I try to keep the same version and file names for images and blend files but I often get out of sync. What I need to be able to do is browse all the image versions and reliably find the blend file that produced it.
This seems like I could use a version control system such as git, making a commit after each render.
Is there an image browser that can view images in different commits or a git viewer that can show images?
Or is there a better way to do this?
While git keeps the information of all versions around, it doesn't keep all versions in the working tree simultantously.
And its interface is meant to show differences between revisions.
The problem is that unlike text files, there is no good and common definition about what a "diff" between two images should mean. You could try and devise a textconv option for jpg files. But I wonder if that would be useful.
If you want to be able to see different version side-by-side, you should probably use some kind of numbering scheme and a script to help you with that.
Suppose you have a blender file named foo.blend that you are working on. This is your working copy. You should write a script that does two things;
Copy foo.blend to e.g. foo-027.blend, if the last existing version in the same directory is foo-026.blend, unless there is no difference between foo.blend and foo-026.blend.
Render foo-027.blend to e.g. foo-027.jpg using blender in batch rendering mode.
Call this script whenever you want to save a certain version. You also might want to make previous revisions read-only.
Python would be a good candidate to write this script in, since blender supports Python scripting. You might even be able to call it from a menu or shortcut.
With enough storage space Git is okay with binary files. But Git doesn't store files in their native form; instead they are packed in "blobs" of unreadable format. So you will have to checkout older versions to have them in your disposal.
You can have a separate directory to "retrieve" files from older revisions. Say, you've got a repo in your workspace directory.
cd path/to/my/workspace/directory
git --work-tree=/path/to/another/directory checkout <revision> <filenames separated by spaces>
Or from the another/directory:
cd path/to/another/directory
git --git-dir=/path/to/my/workspace/directory checkout <revision>
Now your workspace directory stays untouched, while another/directory has the older version. You can now compare and do whatever you want.
Of course, you can just checkout to older revision in the same directory:
git checkout <revision>
# and come back then:
git checkout master
This answer is inspired with:
git pull while not in a git directory
How do I reconnect my project to my existing GitHub repository

Retrieve source files from git

I've been saving all my source files using the xcode git repository. I saw some articles online about speeding up the Mac performance and I used a tool called 'Monolingual' to cleanup unwanted language files on the hard drive. Unfortunately this also deleted my entire user directory along with all my source code.
Is there any way to retrieve the files from the local git? When i try to view them from xcode organizer, it doesn't show the previous saved repositories
The question is: did it remove also the .git directory which contains your code history?
If yes, then you need to restore (from a time machine backup for instance) at least that directory, in order to be able to checkout again your working tree from that git repo.

What are the xcuserstate files used for?

When committing changes to GIT repo, i see constant updates coming from the xcuserstate files.
What are those?
xcuserstate files are generated from within Xcode and saved in your project bundle to remember your last opened file, the open state of any group folders, open tabs, and any other user setting your project might need to remember. For purposes of revision control, you should ignore them or leave them out if at all possible.

Archive Mercurial Changeset Files

I'm using Mercurial 1.7.2. on Windows and I want to extract all files within a specified change set (in my case tip). This is so I can upload only the files that I have changed to my web server.
If I want to take an un-versioned copy of the entire repo then I use hg arhive however I can't find a way to get just the files in a changeset.
And all the examples I can find use Unix tools.
With hg status --change <revno> --no-status you get a list of the files that's changed.
You should be able to feed that list into robocopy or xcopy or something else.
If you're using TortoiseHg you can do this from the Repository Explorer - in fact I do exactly what you're trying to do for a Wordpress install.
thg log will bring up the log of the repository in TortoiseHg. You can then right-click on a changeset and select (from memory, sorry) Archive. There are a few options, but you should see an option on the resulting dialog something like "Archive only changed files". Make sure that is checked, and away you go.
The command that's executed is shown to you, but to automate it on the command-line you need to get the list of files changed (see Macke's reply). With a little batch-magic you can feed that into the Archive command.
Have a look at this StackOverflow question for details of how to do it on the command-line, providing you have a SED interpreter installed, which you can easily find for Windows.

Best approaches to versioning Mac "bundle" files

So you know a lot of Mac apps use "bundles": It looks like a single file to your application, but it's actually a folder with many files inside.
For a version control system to handle this, it needs to:
check out all the files in a directory, so the app can modify them as necessary
at checkin,
commit files which have been modified
add new files which the application has created
mark as deleted files which are no longer there (since the app deleted them)
manage this as one atomic change
Any ideas on the best way to handle this with existing version control systems? Are any of the versioning systems more adept in this area?
Mercurial in particular versions based on file, not directory structure. Therefore, your working tree, which is a fully-fledged repository, doesn't spit out .svn folders at each level.
It also means that a directory that is replaced, like an Application or other Bundle, will still find it's contents with particular file names under revision control. File names are monitored, not inodes or anything fancy like that!
Obviously, if a new file is added to the Bundle, you'll need to explicitly add this to your repository. Similarly, removing a file from a Bundle should be done with an 'hg rm'.
There aren't any decent Mercurial GUIs for OS X yet, but if all you do is add/commit/merge, it isn't that hard to use a command line.
For distributed SCM systems like git and mercurial shouldn't be a problem as Matthew mentioned.
If you need to use a centralized SCM like Subversion or CVS, then you can zip up (archive) your bundles before checking them into source control. This can be painful and takes an extra step. There is a good blog post about this at Tapestry Central:
Mac OS X bundles vs. Subversion
This article demonstrates a ruby script that manages the archiving for you.
An update from the future:
If I recall, the problem with managing bundles in SVN was all the .svn folders getting cleared each time you made a bundle. This shouldn't be a problem any more, now that SVN stores everything in a single .svn folder at the root.
Bringing this thread back to daylight, since the October 2013 iWork (Pages 5.0 etc.) no longer allows storing in 'flat file' (zipped), but only as bundles.
The problem is not the creation of version control hidden folders inside such structures (well, for svn it is), but as Mark says in the question: getting automatic, atomic update of files added or removed (by the application, in this case iWork) so I wouldn't need to do that manually.
Clearly, iWork and Apple are only bothered by iCloud usability. Yet I have a genuine case for storing .pages, .numbers and .keynote in a Mercurial repo. After the update, it blows everything apart. What to do?
Addendum:
Found 'hg addremove' that does the trick for me.
$ hg help addremove
hg addremove [OPTION]... [FILE]...
add all new files, delete all missing files

Resources