The index being so visible by default (as opposed to being a behind the scenes thing in most other VCS system) definitely adds some complexity. I need to sit down someday and figure out exactly how the git index fits into everything, because that is the sticking point on the one thing I used to do automatically in Mercurial that I have not figured out how to do in git other than manually.<p>I had this hook in Mercurial on OS X:<p>pre-commit = mdfind -0 -onlyin . &quot;kMDItemContentTypeTree = &#x27;com.apple.package&#x27;&quot; | xargs -0 hg addremove<p>For those not familiar with Mercurial, &quot;hg addremove dir ...&quot; adds any files from the specified directory that are not already in the repository, and removes from the repository any files that were from the repository that have been deleted from the specified directory.<p>For those not familiar with OS X, that mdfind command is finding directories in or under the current directory that have the kMDItemContentTypeTree list in the metadata includes com.apple.package. These are directories that are logically treated as if they are single files.<p>Suppose I am keeping a TODO list named &quot;TODO&quot; with my project, and I&#x27;m using OmniOutliner to organize it. The TODO list will be in a directory named &quot;TODO.oo3&quot;. OmniOutliner will keep an XML file in that directory that has most of my TODO list. If all my TODO list consists of is formatted text, that will be all that is in there, and everything is simple. As far as any DVCS goes, I can just treat that XML file as my entire TODO list. It will be no different than a code file, except that I edit it with OmniOutliner instead of vim or TextMate.<p>Now suppose I add more than just simple formatted text to my TODO. OmniOutliner allows adding files as attachments. They get copied into the TODO.oo3 tree. It also allows recording audio notes, which get stored as files in TODO.oo3. Deleting an attachment in OmniOutliner will delete the file from TODO.oo3.<p>So what my Mercurial pre-commit hook is doing is finding any files that have been added or removed in directories like my TODO.oo3, and adds any newly added files and removes any deleted files. Files that have just had contents changed will be taken care of by the normal operation of Mercurial.<p>With git, I&#x27;m not sure how to handle this. There are two main issues.<p>1. Where to handle this. I think the adding and removing of files from the magic directories need to occur on commands that modify the index. In particular, on &quot;add -u&quot;. However, I don&#x27;t see any hook for this. Git&#x27;s pre-commit hook is, unsurprisingly, for commits, which is too late.<p>2. Dealing with fancy things like stashes. In general going over ever git command that affect the index and making sure that magic directories are being handled right.<p>It would be ugly, but I&#x27;m starting to suspect it might require putting a wrapper around the git command itself, which is kind of ugly.<p>Another possibility is a pre-commit hook that just checks to see if any magic directories have added or removed files, and if so aborts the commit and alerts the user that they need to &quot;git add&quot; or &quot;git rm&quot; those files or add --no-verify if they want to commit anyway. It wouldn&#x27;t be as clean as it was in Mercurial, but it would at least be an improvement over relying on noticing in the &quot;git status&quot; I almost always do before committing that I&#x27;ve got some add&#x2F;removes in a magic directory that need to be taken care of first.