I've taken all of the comments I received from my previous attempt see: http://marc.info/?l=git&m=119181975419521&w=2 With these new changes in place my new git-clean passes all of the original tests as well as the new tests I've added. While looking at how git-ls-files walks the tree there were some things that didn't quite understand, or thought might be unnecessary so there may be some things I missed. For example I'm still not quite sure what verify_pathspec() does. I did however notice what I would call a bug in the behavior of git-ls-files and therefore the current git-clean.sh. With the current git-clean if you have two directories that contain only untracked files, for example docs/ and examples/ running: git clean docs/ examples/ will not remove either directory. Instead you must use the -d parameter. To me this makes sense, however if you run: git clean docs/ it will remove the docs directory without using the -d parameter. My patch is at least consistent in that it requires the -d in both cases. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html