Permalink
Browse files

Fix diff display when using --follow by marking it as a rev flag

  • Loading branch information...
1 parent 3acf9cf commit 40868f705ff8b4a1c4dc44ae07c64a47e0f090dc @jonas committed Oct 14, 2012
Showing with 8 additions and 1 deletion.
  1. +7 −0 NEWS
  2. +1 −1 git.h
View
7 NEWS
@@ -1,6 +1,13 @@
Release notes
=============
+master
+------
+
+Bug fixes:
+
+ - Fix diff broken display when using --follow <filename>.
+
tig-1.1
-------
View
2 git.h
@@ -54,6 +54,6 @@
/* FIXME(jfonseca): This is incomplete, but enough to support:
* git rev-list --author=vivien HEAD | tig --stdin --no-walk */
#define GIT_REV_FLAGS \
- "--stdin", "--no-walk"
+ "--stdin", "--no-walk", "--follow"
#endif

2 comments on commit 40868f7

Contributor

tsibley replied Oct 15, 2012

This change breaks usages like tig blame --follow tig.c and tig -Sfoo --follow. I took a quick look at the code, but I'm not up to date anymore with tig's option parsing/backend git commands. I don't think --follow is actually a git rev-list flag, but a git diff flag (looking at the man pages and git source).

The trace makes the cause of the symptom obvious, at least:

git rev-parse --no-revs --no-flags --follow tig.c 
git rev-parse --flags --no-revs --follow tig.c 
git rev-parse --symbolic --revs-only --follow tig.c 
git rev-parse --git-dir --is-inside-work-tree --show-cdup --show-prefix 
git config --list 
git symbolic-ref HEAD 
git ls-remote .git 
git cat-file blob --follow:tig.c 
error: unknown option `follow:tig.c'
Owner

jonas replied Oct 17, 2012

Thanks, noted.

Please sign in to comment.