summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d327b89)
Normally, diff-tree does not feed unchanged filepair to diffcore
for performance reasons, so copies are detected only when the
source file of the copy happens to be modified in the same
changeset. This adds --find-copies-harder flag to tell
diff-tree to sacrifice the performance in order to find copies
the same way as other commands in diff-* family.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
static int read_stdin = 0;
static int diff_output_format = DIFF_FORMAT_HUMAN;
static int detect_rename = 0;
static int read_stdin = 0;
static int diff_output_format = DIFF_FORMAT_HUMAN;
static int detect_rename = 0;
+static int find_copies_harder = 0;
static int diff_setup_opt = 0;
static int diff_score_opt = 0;
static const char *pickaxe = NULL;
static int diff_setup_opt = 0;
static int diff_score_opt = 0;
static const char *pickaxe = NULL;
show_file("+", tree2, size2, base);
return 1;
}
show_file("+", tree2, size2, base);
return 1;
}
- if (!memcmp(sha1, sha2, 20) && mode1 == mode2)
+ if (!find_copies_harder && !memcmp(sha1, sha2, 20) && mode1 == mode2)
static void show_tree(const char *prefix, void *tree, unsigned long size, const char *base)
{
while (size) {
static void show_tree(const char *prefix, void *tree, unsigned long size, const char *base)
{
while (size) {
- if (interesting(tree, size, base))
+ if (find_copies_harder || interesting(tree, size, base))
show_file(prefix, tree, size, base);
update_tree_entry(&tree, &size);
}
show_file(prefix, tree, size, base);
update_tree_entry(&tree, &size);
}
static int call_diff_flush(void)
{
static int call_diff_flush(void)
{
+ diffcore_std(find_copies_harder ? paths : 0,
detect_rename, diff_score_opt,
pickaxe, pickaxe_opts,
diff_break_opt,
detect_rename, diff_score_opt,
pickaxe, pickaxe_opts,
diff_break_opt,
usage(diff_tree_usage);
continue;
}
usage(diff_tree_usage);
continue;
}
+ if (!strcmp(arg, "--find-copies-harder")) {
+ find_copies_harder = 1;
+ continue;
+ }
if (!strcmp(arg, "-z")) {
diff_output_format = DIFF_FORMAT_MACHINE;
continue;
if (!strcmp(arg, "-z")) {
diff_output_format = DIFF_FORMAT_MACHINE;
continue;
}
usage(diff_tree_usage);
}
}
usage(diff_tree_usage);
}
+ if (find_copies_harder && detect_rename != DIFF_DETECT_COPY)
+ usage(diff_tree_usage);