summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--diff-tree.c11
-rwxr-xr-x[-rw-r--r--]t/t0110-environment-names-old.sh0
-rwxr-xr-x[-rw-r--r--]t/t1000-read-tree-m-3way.sh0
-rwxr-xr-x[-rw-r--r--]t/t2002-checkout-cache-u.sh0
-rwxr-xr-x[-rw-r--r--]t/t4000-diff-format.sh0
-rwxr-xr-x[-rw-r--r--]t/t4001-diff-rename.sh0
6 files changed, 8 insertions, 3 deletions
diff --git a/diff-tree.c b/diff-tree.c
index b43df18..5559dd3 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -11,6 +11,7 @@ static int read_stdin = 0;
static int line_termination = '\n';
static int generate_patch = 0;
static int detect_rename = 0;
+static int reverse_diff = 0;
static int diff_score_opt = 0;
static const char *header = NULL;
static const char *header_prefix = "";
@@ -270,7 +271,7 @@ static int diff_tree_sha1_top(const unsigned char *old,
{
int ret;
- diff_setup(detect_rename, diff_score_opt, 0,
+ diff_setup(detect_rename, diff_score_opt, reverse_diff,
(generate_patch ? -1 : line_termination),
0, 0);
ret = diff_tree_sha1(old, new, base);
@@ -284,7 +285,7 @@ static int diff_root_tree(const unsigned char *new, const char *base)
void *tree;
unsigned long size;
- diff_setup(detect_rename, diff_score_opt, 0,
+ diff_setup(detect_rename, diff_score_opt, reverse_diff,
(generate_patch ? -1 : line_termination),
0, 0);
tree = read_object_with_reference(new, "tree", &size, 0);
@@ -429,7 +430,7 @@ static int diff_tree_stdin(char *line)
}
static char *diff_tree_usage =
-"git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-m] [-s] [-v] <tree-ish> <tree-ish>";
+"git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-R] [-m] [-s] [-v] <tree-ish> <tree-ish>";
int main(int argc, char **argv)
{
@@ -464,6 +465,10 @@ int main(int argc, char **argv)
recursive = 1;
continue;
}
+ if (!strcmp(arg, "-R")) {
+ reverse_diff = 1;
+ continue;
+ }
if (!strcmp(arg, "-p")) {
recursive = generate_patch = 1;
continue;
diff --git a/t/t0110-environment-names-old.sh b/t/t0110-environment-names-old.sh
index 9389796..9389796 100644..100755
--- a/t/t0110-environment-names-old.sh
+++ b/t/t0110-environment-names-old.sh
diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
index d7f9009..d7f9009 100644..100755
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
diff --git a/t/t2002-checkout-cache-u.sh b/t/t2002-checkout-cache-u.sh
index 69146ac..69146ac 100644..100755
--- a/t/t2002-checkout-cache-u.sh
+++ b/t/t2002-checkout-cache-u.sh
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index 3accb14..3accb14 100644..100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index 065ddb7..065ddb7 100644..100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh