Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (31 sloc) 0.933 kB
8bc9a0c Add copyright notices.
Linus Torvalds authored
1 /*
2 * GIT - The information manager from hell
3 *
4 * Copyright (C) Linus Torvalds, 2005
5 */
e83c516 Initial revision of "git", the information manager from hell
Linus Torvalds authored
6 #include "cache.h"
4a6bf9e [PATCH] Reactivate show-diff patch generation
Junio C Hamano authored
7 #include "diff.h"
9153983 Log message printout cleanups
Linus Torvalds authored
8 #include "commit.h"
9 #include "revision.h"
e8cc9cd Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff…
Peter Eriksen authored
10 #include "builtin.h"
c0fb976 [PATCH] show-diff show deleted files as diff as well.
Christopher Li authored
11
4d1f119 [PATCH] Unify usage strings declaration
Petr Baudis authored
12 static const char diff_files_usage[] =
4551d05 @aeruder Removing -n option from git-diff-files documentation
aeruder authored
13 "git-diff-files [-q] [-0/-1/2/3 |-c|--cc|--no-index] [<common diff options>] [<path>...]"
dda2d79 [PATCH] Clean up diff option descriptions.
Junio C Hamano authored
14 COMMON_DIFF_OPTIONS_HELP;
b8f8092 [PATCH] Optionally tell show-diff to show only named files
Junio C Hamano authored
15
a633fca Call setup_git_directory() much earlier
Linus Torvalds authored
16 int cmd_diff_files(int argc, const char **argv, const char *prefix)
e83c516 Initial revision of "git", the information manager from hell
Linus Torvalds authored
17 {
6973dca Libify diff-files.
Junio C Hamano authored
18 struct rev_info rev;
af05d67 @szeder Always set *nongit_ok in setup_git_directory_gently()
szeder authored
19 int nongit;
41bbf9d @raalkml Allow git-diff exit with codes similar to diff(1)
raalkml authored
20 int result;
e83c516 Initial revision of "git", the information manager from hell
Linus Torvalds authored
21
d516c2d @dscho Teach git-diff-files the new option `--no-index`
dscho authored
22 prefix = setup_git_directory_gently(&nongit);
a633fca Call setup_git_directory() much earlier
Linus Torvalds authored
23 init_revisions(&rev, prefix);
9a1805a @peff add a "basic" diff config callback
peff authored
24 git_config(git_diff_basic_config); /* no "diff" UI options */
6973dca Libify diff-files.
Junio C Hamano authored
25 rev.abbrev = 0;
26
fcfa33e @dscho diff: make more cases implicit --no-index
dscho authored
27 if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
28 argc = 0;
29 else
30 argc = setup_revisions(argc, argv, &rev, NULL);
c9b5ef9 @tihirvon Set default diff output format after parsing command line
tihirvon authored
31 if (!rev.diffopt.output_format)
32 rev.diffopt.output_format = DIFF_FORMAT_RAW;
41bbf9d @raalkml Allow git-diff exit with codes similar to diff(1)
raalkml authored
33 result = run_diff_files_cmd(&rev, argc, argv);
da31b35 @gitster diff --check: minor fixups
gitster authored
34 return diff_result_code(&rev.diffopt, result);
e83c516 Initial revision of "git", the information manager from hell
Linus Torvalds authored
35 }
Something went wrong with that request. Please try again.