jonas / tig

Text-mode interface for git
https://jonas.github.io/tig/
GNU General Public License v2.0
12.27k stars 605 forks source link

default view does not honour diff.orderFile for Staged/Unstaged changes #1311

Open pkitszel opened 6 months ago

pkitszel commented 6 months ago

When one invokes tig with something in Staged changes or Unstaged changes, the diff.orderFile from config is not honoured.

Order is maintained when one uses tig to navigate to any recent commit (so for changes already commited), and it works well with plain git diff on the very same changes made.

tig version 2.5.5

To reproduce in empty test repo:

echo '*.h' > test-order
echo '*.c' >> test-order
git config diff.orderFile test-order
echo h > h.h
echo c > c.c
git add c.c h.h
git commit -m c1
echo x > h.h 
echo x > c.c 
git diff
tig

image image image

koutcher commented 5 months ago

A long time ago, the choice was made to use git diff-files rather than git diff in the stage view (f99c60950a00d72ca0fc7626de6034c704ea3883). It seems that git diff-files does not care about diff.orderFile.