summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e922989)
raw | patch | inline | side by side (parent: e922989)
author | Jeff King <peff@peff.net> | |
Thu, 10 Jun 2010 01:27:27 +0000 (21:27 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 10 Jun 2010 02:19:18 +0000 (22:19 -0400) |
... by using git diff to compare directly the current and parent blob.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
tig.c | patch | blob | history |
index c2417bfee168eb4b52c6287ee01bcc524a9bc635..dd155e35e23a6b11fd3aedc9e5883085372ebdb7 100644 (file)
--- a/tig.c
+++ b/tig.c
static void
setup_blame_parent_line(struct view *view, struct blame *blame)
{
+ char from[SIZEOF_REF + SIZEOF_STR];
+ char to[SIZEOF_REF + SIZEOF_STR];
const char *diff_tree_argv[] = {
- "git", "diff-tree", "-U0", blame->commit->id,
- "--", blame->commit->filename, NULL
+ "git", "diff", "--no-textconv", "--no-extdiff", "--no-color",
+ "-U0", from, to, "--", NULL
};
struct io io;
int parent_lineno = -1;
int blamed_lineno = -1;
char *line;
- if (!io_run(&io, IO_RD, NULL, diff_tree_argv))
+ if (!string_format(from, "%s:%s", opt_ref, opt_file) ||
+ !string_format(to, "%s:%s", blame->commit->id, blame->commit->filename) ||
+ !io_run(&io, IO_RD, NULL, diff_tree_argv))
return;
while ((line = io_get(&io, '\n', TRUE))) {