Re: On Tabs and Spaces
- From
- david@lang.hm <david@lang.hm>
- Date
- Oct 18, 2007, 03:03 UTC
- Message-ID
- <Pine.LNX.4.64.0710172002020.10276@asgard.lang.hm>
- In-Reply-To
- <20071018024553.GA5186@coredump.intra.peff.net>
On Wed, 17 Oct 2007, Jeff King wrote:
Show 15 quoted lines
> On Wed, Oct 17, 2007 at 05:59:27PM -0700, Linus Torvalds wrote: > >> It happens. We do de-spacification in the kernel occasionally when it is >> an annoyance. Usually it shows up in patches, though - exactly because >> code which adds spaces instead of tabs won't line up correctly in the >> diff. > > You have made this claim several times, and I really don't understand > it. If I have 8 spaces, then a diff line will have either " ", "+", or > "-" followed by 8 spaces. If I use a hard tab, then the tab will end up > only taking up 7 spaces because of the nature of tabs. > > This might matter if I'm comparing non-diff code to diff code. But in a > diff, _everything_ is indented by exactly one space, so it all lines up. > Is there something I'm missing?
if the code uses a tab and the patch uses 8 spaces the two will not line up in the diff becouse in the diff output the tab is 'only 7 spaces;
useing one or the other isn't the problem, it's the mixing of the two.
David Lang