When looking at changes in a code base containing tabs for indentation with git diff the tab characters are replaced by a number of spaces. The same happens when looking at patches with git show. When I use git format-patch and look at the resulting file with cat everything seems fine.
As these commands display machine-readable patches that are broken by replacing characters, I wonder what is going on and how to stop this from happening.