diff: teach tree-diff a max-depth parameter
When you are doing a tree-diff, there are basically two options: do not recurse into subtrees at all, or recurse indefinitely. While most callers would want to always recurse and see full pathnames, some may want the efficiency of looking only at a particular level of the tree. This is currently easy to do for the top-level (just turn off recursion), but you cannot say "show me what changed in subdir/, but do not recurse".
This patch adds a max-depth parameter which is measured from the closest pathspec match, so that you can do:
git log --raw --max-depth=1 a/b/c
and see the contents of a/b/c/, but not those of a/b/c/d/ (you would see the --raw entry for a/b/c/d in such a case).
Edited by Toon Claes