How to write in file the output from "tig show commit-1 commit-2 patch"?

321 Views Asked by At

I'd like to write into a file the output from tig show commit-97b061ff commit-59466662 patch

I tried tig show commit-97b061ff commit-59466662 patch >file.txt, but the file was empty. I expected that it would contain the patch actual.

How can I solve it?

1

There are 1 best solutions below

0
Sasha Davydenko On BEST ANSWER

If I'd want to save a patch I'd just do

git show $commit > file.diff

You can save the current view in tig with :save-view file.txt but it's for testing purposes - it adds a lot of additional internal information to diff lines, so if you were to use it you'd have to strip those off.