summaryrefslogtreecommitdiff
path: root/diff-stages.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-07-13 19:45:51 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-13 19:55:07 (GMT)
commit52f28529f4f90cebdca47f8eacbff5cb20004bed (patch)
tree5582a75c2121fca35a99eb35d9e22f97cd2ed5b3 /diff-stages.c
parent8a62a3097c55b22ee4543edef10322775ef62c92 (diff)
downloadgit-52f28529f4f90cebdca47f8eacbff5cb20004bed.zip
git-52f28529f4f90cebdca47f8eacbff5cb20004bed.tar.gz
git-52f28529f4f90cebdca47f8eacbff5cb20004bed.tar.bz2
[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>
Diffstat (limited to 'diff-stages.c')
-rw-r--r--diff-stages.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/diff-stages.c b/diff-stages.c
index 738fe5d..9d33535 100644
--- a/diff-stages.c
+++ b/diff-stages.c
@@ -87,6 +87,10 @@ int main(int ac, const char **av)
find_copies_harder = 1;
else if (!strcmp(arg, "-z"))
diff_output_format = DIFF_FORMAT_MACHINE;
+ else if (!strcmp(arg, "--name-only"))
+ diff_output_format = DIFF_FORMAT_NAME;
+ else if (!strcmp(arg, "--name-only-z"))
+ diff_output_format = DIFF_FORMAT_NAME_Z;
else if (!strcmp(arg, "-R"))
diff_setup_opt |= DIFF_SETUP_REVERSE;
else if (!strncmp(arg, "-S", 2))