[Bug] `tig blame --reverse` get the wrong revision of file
liming01 opened this issue · 2 comments
liming01 commented
When I use tig blame --reverse
to find which commit deleted a line?, I found that tig gets the wrong file revision. e.g.
git blame --reverse START_SHA..HEAD file.ext
can get file.ext @ START_SHA, while
tig blame --reverse START_SHA..HEAD file.ext
can get file.ext @ HEAD
koutcher commented
--reverse
is swallowed by command line parsing, we need to add it back in blame arguments. Would this work for you ?
diff --git a/src/blame.c b/src/blame.c
index b9e15314..43af804f 100644
--- a/src/blame.c
+++ b/src/blame.c
@@ -90,6 +90,9 @@ blame_open(struct view *view, enum open_flags flags)
opt_cmdline_args = NULL;
}
+ if (opt_commit_order == COMMIT_ORDER_REVERSE)
+ argv_append(&opt_blame_options, "--reverse");
+
/*
* flags (like "--max-age=123") and bottom limits (like "^foo")
* will be passed as-is, and retained even if we re-blame from