static int diff_setup_opt = 0;
static int diff_score_opt = 0;
static const char *pickaxe = NULL;
static int pickaxe_opts = 0;
static int diff_break_opt = -1;
static const char *orderfile = NULL;
static int diff_setup_opt = 0;
static int diff_score_opt = 0;
static const char *pickaxe = NULL;
static int pickaxe_opts = 0;
static int diff_break_opt = -1;
static const char *orderfile = NULL;
/* A file entry went away or appeared */
static void show_file(const char *prefix, struct cache_entry *ce, unsigned char *sha1, unsigned int mode)
/* A file entry went away or appeared */
static void show_file(const char *prefix, struct cache_entry *ce, unsigned char *sha1, unsigned int mode)
{
while (entries) {
struct cache_entry *ce = *ac;
int same = (entries > 1) && ce_same_name(ce, ac[1]);
{
while (entries) {
struct cache_entry *ce = *ac;
int same = (entries > 1) && ce_same_name(ce, ac[1]);
/*
* Ignore all the different stages for this file,
* we've handled the relevant cases now.
/*
* Ignore all the different stages for this file,
* we've handled the relevant cases now.
-"git-diff-cache [-p] [-r] [-z] [-m] [-M] [-C] [-R] [-S<string>] [-O<orderfile>] [--cached] <tree-ish> [<path>...]";
+"git-diff-cache [-m] [--cached] "
+"[<common diff options>] <tree-ish> [<path>...]"
+COMMON_DIFF_OPTIONS_HELP;
if (!strcmp(arg, "-r")) {
/* We accept the -r flag just to look like git-diff-tree */
continue;
}
if (!strcmp(arg, "-r")) {
/* We accept the -r flag just to look like git-diff-tree */
continue;
}
- if (!strcmp(arg, "-p")) {
+ /* We accept the -u flag as a synonym for "-p" */
+ if (!strcmp(arg, "-p") || !strcmp(arg, "-u")) {
- diff_output_format = DIFF_FORMAT_MACHINE;
+ diff_line_termination = 0;
+ continue;
+ }
+ if (!strcmp(arg, "--name-only")) {
+ diff_output_format = DIFF_FORMAT_NAME;
tree = read_object_with_reference(sha1, "tree", &size, NULL);
if (!tree)
die("bad tree object %s", tree_name);
tree = read_object_with_reference(sha1, "tree", &size, NULL);
if (!tree)
die("bad tree object %s", tree_name);
- orderfile);
- diff_flush(diff_output_format, 1);
+ orderfile, diff_filter);
+ diff_flush(diff_output_format, diff_line_termination);