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

<p>For a version control system to handle this, it needs to:</p>

<ul>
<li>check out all the files in a directory, so the app can modify them as necessary</li>
<li>at checkin,

<ul>
<li>commit files which have been modified</li>
<li>add new files which the application has created</li>
<li>mark as deleted files which are no longer there (since the app deleted them)</li>
<li>manage this as one atomic change</li>
</ul></li>
</ul>

<p>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? </p>

[{'answer_id': 27111, 'author': 'Matthew Schinckel', 'author_id': 188, 'author_profile': 'https://Stackoverflow.com/users/188', 'pm_score': 2, 'selected': False, 'text': "<p>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.</p>\n\n<p>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!</p>\n\n<p>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'.</p>\n\n<p>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.</p>\n"}, {'answer_id': 32441, 'author': 'Nick Haddad', 'author_id': 2813, 'author_profile': 'https://Stackoverflow.com/users/2813', 'pm_score': 2, 'selected': True, 'text': '<p>For distributed SCM systems like git and mercurial shouldn\'t be a problem as Matthew mentioned.</p>\n\n<p>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:</p>\n\n<p><a href="http://tapestryjava.blogspot.com/2007/09/mac-os-x-bundles-vs-subversion.html" rel="nofollow noreferrer">Mac OS X bundles vs. Subversion</a></p>\n\n<p>This article demonstrates a ruby script that manages the archiving for you.</p>\n'}, {'answer_id': 14903821, 'author': 'Rick Yorgason', 'author_id': 754093, 'author_profile': 'https://Stackoverflow.com/users/754093', 'pm_score': 1, 'selected': False, 'text': "<p>An update from the future:</p>\n\n<p>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.</p>\n"}, {'answer_id': 19727594, 'author': 'akauppi', 'author_id': 14455, 'author_profile': 'https://Stackoverflow.com/users/14455', 'pm_score': 1, 'selected': False, 'text': '<p>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.</p>\n\n<p>The problem is not the creation of version control hidden folders inside such structures (well, for svn it is), but as <a href="https://stackoverflow.com/users/116/mark-harrison">Mark</a> 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.</p>\n\n<p>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?</p>\n\n<p><strong>Addendum:</strong></p>\n\n<p>Found \'<code>hg addremove</code>\' that does the trick for me. </p>\n\n<pre><code>$ hg help addremove\nhg addremove [OPTION]... [FILE]...\n\nadd all new files, delete all missing files\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/27027', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/116/']