Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 51 lines (44 sloc) 1.206 kb
e74f8f6a »
2005-04-19 Add "diff-cache" helper program to compare a tree (or commit) with
1 #include "cache.h"
f92a4465 »
2005-04-27 [PATCH] Add -p (patch) to diff-cache.
2 #include "diff.h"
e09ad6e1 »
2006-04-22 Libify diff-index.
3 #include "commit.h"
4 #include "revision.h"
e8cc9cd9 »
2006-05-23 Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff…
5 #include "builtin.h"
b5af9107 »
2005-04-22 New "diff-cache" implementation.
6
4d1f1190 »
2005-07-29 [PATCH] Unify usage strings declaration
7 static const char diff_cache_usage[] =
1b1dd23f »
2008-07-13 Make usage strings dash-less
8 "git diff-index [-m] [--cached] "
dda2d79a »
2005-07-13 [PATCH] Clean up diff option descriptions.
9 "[<common diff options>] <tree-ish> [<path>...]"
10 COMMON_DIFF_OPTIONS_HELP;
c5bac17a »
2005-04-20 [PATCH] Usage-string fixes.
11
a633fca0 »
2006-07-28 Call setup_git_directory() much earlier
12 int cmd_diff_index(int argc, const char **argv, const char *prefix)
e74f8f6a »
2005-04-19 Add "diff-cache" helper program to compare a tree (or commit) with
13 {
e09ad6e1 »
2006-04-22 Libify diff-index.
14 struct rev_info rev;
15 int cached = 0;
6c56c534 »
2005-05-24 git-diff-cache: fix argument parsing
16 int i;
41bbf9d5 »
2007-03-14 Allow git-diff exit with codes similar to diff(1)
17 int result;
e74f8f6a »
2005-04-19 Add "diff-cache" helper program to compare a tree (or commit) with
18
a633fca0 »
2006-07-28 Call setup_git_directory() much earlier
19 init_revisions(&rev, prefix);
ef90d6d4 »
2008-05-14 Provide git_config with a callback-data parameter
20 git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
e09ad6e1 »
2006-04-22 Libify diff-index.
21 rev.abbrev = 0;
22
23 argc = setup_revisions(argc, argv, &rev, NULL);
6c56c534 »
2005-05-24 git-diff-cache: fix argument parsing
24 for (i = 1; i < argc; i++) {
25 const char *arg = argv[i];
a6080a0a »
2007-06-07 War on whitespace
26
5c21ac0e »
2006-04-22 Libified diff-index: backward compatibility fix.
27 if (!strcmp(arg, "--cached"))
e09ad6e1 »
2006-04-22 Libify diff-index.
28 cached = 1;
29 else
6b5ee137 »
2005-09-21 Diff clean-up.
30 usage(diff_cache_usage);
e74f8f6a »
2005-04-19 Add "diff-cache" helper program to compare a tree (or commit) with
31 }
c9b5ef99 »
2006-06-24 Set default diff output format after parsing command line
32 if (!rev.diffopt.output_format)
33 rev.diffopt.output_format = DIFF_FORMAT_RAW;
34
e09ad6e1 »
2006-04-22 Libify diff-index.
35 /*
36 * Make sure there is one revision (i.e. pending object),
37 * and there is no revision filtering parameters.
38 */
1f1e895f »
2006-06-19 Add "named object array" concept
39 if (rev.pending.nr != 1 ||
e09ad6e1 »
2006-04-22 Libify diff-index.
40 rev.max_count != -1 || rev.min_age != -1 || rev.max_age != -1)
c5bac17a »
2005-04-20 [PATCH] Usage-string fixes.
41 usage(diff_cache_usage);
4f38f6b5 »
2008-08-28 diff*: fix worktree setup
42 if (!cached)
43 setup_work_tree();
b4e1e4a7 »
2007-02-09 run_diff_{files,index}(): update calling convention.
44 if (read_cache() < 0) {
45 perror("read_cache");
46 return -1;
47 }
41bbf9d5 »
2007-03-14 Allow git-diff exit with codes similar to diff(1)
48 result = run_diff_index(&rev, cached);
da31b358 »
2007-12-13 diff --check: minor fixups
49 return diff_result_code(&rev.diffopt, result);
e74f8f6a »
2005-04-19 Add "diff-cache" helper program to compare a tree (or commit) with
50 }
Something went wrong with that request. Please try again.