diff options
author | Junio C Hamano <junkio@cox.net> | 2005-07-13 12:45:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-13 12:55:07 -0700 |
commit | 52f28529f4f90cebdca47f8eacbff5cb20004bed (patch) | |
tree | 5582a75c2121fca35a99eb35d9e22f97cd2ed5b3 /diff-tree.c | |
parent | 8a62a3097c55b22ee4543edef10322775ef62c92 (diff) | |
download | git-52f28529f4f90cebdca47f8eacbff5cb20004bed.tar.gz |
[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-tree.c')
-rw-r--r-- | diff-tree.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/diff-tree.c b/diff-tree.c index ea237051ee..f499d2ead5 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -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; |