login
Header Space

 
 

Re: On Tabs and Spaces

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Michael Witten <mfwitten@...>
Cc: <git@...>
Date: Tuesday, October 16, 2007 - 11:29 pm

On Tue, 16 Oct 2007, Michael Witten wrote:

Heh.

I was sure we had a "CodingStyle", but it turns out that no, we don't, and 
yes, the 8-tab assumption is implicit in (a) the kernel rules (which git 
started out following for obvious reasons, and which *does* have 
documentation making this very explicit indeed) and (b) those few places 
where you can actually see it in the result.

So maybe it should be made explicit. You can see the effect right now by 
doing

	git grep -1 '	 ' *.c

(again, that regex is a "tab+space", although it's not obvious) and then 
looking for places where we line up things in ways that simply wouldn't 
have worked if it wasn't a 8-wide tab, ie things like

	...
	check_all_attr = xrealloc(check_all_attr,
				  sizeof(*check_all_attr) * attr_nr);
	..
	read_tree_recursive(args->tree, args->base, plen, 0,
			    args->pathspec, write_zip_entry);
	..

where the arguments wouldn't line up for anything but 8-char-wide tabs.

(But the code is certainly *readable* with other tab sizes, so it's not 
like this makes it impossible to work if somebody has a 4-space tab, it 
just means that such people can get odd effects - but they may not even 
realize that others see things line up!)

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: On Tabs and Spaces, Jari Aalto, (Tue Oct 16, 1:06 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 3:20 pm)
Re: On Tabs and Spaces, Dmitry Potapov, (Thu Oct 18, 12:36 am)
Re: On Tabs and Spaces, Sam Ravnborg, (Tue Oct 16, 4:56 pm)
Re: On Tabs and Spaces, Mike Hommey, (Tue Oct 16, 3:36 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 3:47 pm)
Re: On Tabs and Spaces, Matthieu Moy, (Tue Oct 16, 4:32 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 3:51 pm)
Re: On Tabs and Spaces, Tom Tobin, (Tue Oct 16, 4:18 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 7:05 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Tue Oct 16, 7:51 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 8:45 pm)
Re: On Tabs and Spaces, Michael Witten, (Tue Oct 16, 11:08 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 11:29 pm)
Re: On Tabs and Spaces, Luke Lu, (Wed Oct 17, 3:17 am)
Re: On Tabs and Spaces, Michael Witten, (Wed Oct 17, 5:09 am)
Re: On Tabs and Spaces, Nikolai Weibull, (Wed Oct 17, 6:21 am)
Re: On Tabs and Spaces, Michael Witten, (Wed Oct 17, 7:23 am)
Re: On Tabs and Spaces, Luke Lu, (Wed Oct 17, 6:03 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 11:53 am)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 2:05 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 8:32 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 8:59 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 10:45 pm)
Re: On Tabs and Spaces, , (Wed Oct 17, 11:03 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 11:00 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 11:32 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Thu Oct 18, 12:17 am)
Re: On Tabs and Spaces, Nicolas Pitre, (Thu Oct 18, 12:52 am)
Re: On Tabs and Spaces, Jeff King, (Thu Oct 18, 12:54 am)
Re: On Tabs and Spaces, Jeff King, (Thu Oct 18, 12:55 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 11:13 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 11:23 pm)
Re: [PATCH] git-gc: improve wording of --auto notification, Shawn O. Pearce, (Thu Oct 18, 9:24 pm)
Re: On Tabs and Spaces, Tom Tobin, (Wed Oct 17, 2:25 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 2:54 pm)
Re: On Tabs and Spaces, Jan Wielemaker, (Wed Oct 17, 3:47 pm)
Re: On Tabs and Spaces, Tom Tobin, (Wed Oct 17, 3:33 pm)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 5:08 pm)
Re: On Tabs and Spaces, Nicolas Pitre, (Wed Oct 17, 3:48 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 3:53 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Wed Oct 17, 5:21 pm)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 6:11 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Wed Oct 17, 7:17 pm)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 7:44 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Wed Oct 17, 8:31 pm)
Re: On Tabs and Spaces, Andreas Ericsson, (Thu Oct 18, 2:02 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 7:53 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 6:03 pm)
Re: On Tabs and Spaces, David Kastrup, (Thu Oct 18, 2:25 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 3:44 pm)
Re: On Tabs and Spaces, David Kastrup, (Wed Oct 17, 4:31 pm)
Re: On Tabs and Spaces, Josh England, (Wed Oct 17, 3:52 pm)
speck-geostationary