[PATCH] git-diff-*: --name-only and --name-only-z.
Porcelain layers often want to find only names of changed files, and even with diff-raw output format they end up having to pick out only the filename. Support --name-only (and --name-only-z for xargs -0 and cpio -0 users that want to treat filenames with embedded newlines sanely) flag to help them. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
8a62a3097c
commit
52f28529f4
@ -480,6 +480,14 @@ int main(int argc, const char **argv)
|
||||
find_copies_harder = 1;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--name-only")) {
|
||||
diff_output_format = DIFF_FORMAT_NAME;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--name-only-z")) {
|
||||
diff_output_format = DIFF_FORMAT_NAME_Z;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "-z")) {
|
||||
diff_output_format = DIFF_FORMAT_MACHINE;
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user