jonas / tig

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

Support delta along with ANSI support (continuation) #1298

Open pablospe opened 1 year ago

pablospe commented 1 year ago

The original pull request was closed due to the author deleting their account.

Original PR description

https://github.com/jonas/tig/issues/542#issuecomment-899094741

image

image

how to use delta in tig?

It requires ncurse 6.1 or higher.

# if you don't have ncurses
curl -O ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.2.tar.gz
tar -xzvf ncurses-6.2.tar.gz
cd ncurses-6.2
./configure --prefix=${where you like} --enable-pc-files --with-pkg-config-libdir=/usr/local/bin/pkgconfig --enable-sigwinch --enable-symlinks --enable-widec --with-shared --with-gpm=no --without-ada --enable-ext-colors # i set the path as /usr/local which is default
sudo make
sudo make install

cd ${path to tig of the branch of above PR}
make configure
./configure LDFLAGS=-L${where you download ncurses}/lib CPPFLAGS=-I{where you installed ncurses}/include  # i set the path as /usr/local/opt/ncurses which is installed by ncurses
make

echo "set diff-highlight = \"delta\"" >> ~/.tigrc

./src/tig

Note: a more detailed installation instructions can be found in this comment from @adamency.

rmacklin commented 3 months ago

Note for anyone landing on this PR that might want to try building and running it locally - this PR does not integrate delta's git blame support into tig blame. If you only want delta's git diff support in tig, this may work for you, but tig blame will still lack syntax highlighting.

JelteF commented 3 weeks ago

Something is not really working correctly with this PR. It's still showing the regular diff view combined with the delta function header in many cases. This happens when I browse the branch of this PR with tig compiled from this branch. image

To be clear, it doesn't always happen. Sometimes it will show the syntax highlighted diff of delta. But when scrolling through the commits with up and down arrows, most will show the old style diffs.