Anonymous committed 50b8e35

Documentation changes to recursive option for git-diff-tree

Update docs and usages regarding '-r' recursive option for git-diff-tree.
Remove '-r' from common diff options, mention it only for git-diff-tree.
Remove one extraneous use of '-r' with git-diff-files in
Sync the synopsis and usage string for git-diff-tree.

Signed-off-by: Chris Shoemaker <c.shoemaker at>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits f07a524

Comments (0)

Files changed (4)


-'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
+'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [-r] [--root] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
 	Note that this parameter does not provide any wildcard or regexp
+        recurse into sub-trees
 	show tree entry itself as well as subtrees.  Implies -r.
 static const char diff_tree_usage[] =
-"git-diff-tree [--stdin] [-m] [-s] [-v] [--pretty] [-t] "
-"[<common diff options>] <tree-ish> <tree-ish>"
+"git-diff-tree [--stdin] [-m] [-s] [-v] [--pretty] [-t] [-r] [--root] "
+"[<common diff options>] <tree-ish> [<tree-ish>] [<path>...]\n"
+"  -r            diff recursively\n"
+"  --root        include the initial commit as diff against /dev/null\n"
 int main(int argc, const char **argv)
 "\ncommon diff options:\n" \
-"  -r            diff recursively (only meaningful in diff-tree)\n" \
 "  -z            output diff-raw with lines terminated with NUL.\n" \
 "  -p            output patch format.\n" \
 "  -u            synonym for -p.\n" \
 savestate() {
 	# Stash away any local modifications.
-	git-diff-index -r -z --name-only $head |
+	git-diff-index -z --name-only $head |
 	cpio -0 -o >"$GIT_DIR/MERGE_SAVE"