git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Get rid of .git/branches/ and .git/remotes/?

From
Llinux@horizon.com <linux@horizon.com>
Date
Nov 22, 2005, 03:20 UTC
Message-ID
<20051122032014.32539.qmail@science.horizon.com>
Show 8 quoted lines
> The main reason I don't like indentation is that it tends to have strange 
> rules for "tab". Some people (incorrectly, of course) think that tabs are 
> not at fixed 8-byte things, so deciding the indentation of a tab often 
> ends up either disallowing tabs altogether (bad) or having other strange 
> rules (disallowing spaces).
> 
> So I'm not religiously opposed to it, but I find it to be less than 
> optimal.

Actually, most indentation-sensitive languages have a simpler solution: they don't try to convert whitespace strings to a number like "horizontal position"; they just compare strings.

Each line must either have the same indentation string as some active scope, or its indentation must have the current innermost scope as a prefix, in which case it introduces a new scope.

This allows anything except for
foo		# No prefix
    bar		# 4 spaces prefix
	baz	# tab prefix: illegal!

The "baz" line would have to begin with 4 spaces to be legal. They could be followed by 4 more spaces, or a tab, or any other whitespace pattern.

It's also possible to combine the two, as Haskell does. Haskell inserts open braces automatically if there is no such punctuation between two lines with differing indentation, but if you supply a brace explicitly, you can do whatever indentation you like. (And the close brace must be explicit if the open brace is, of course.)

Next: Linus Torvalds
Message 1 of 9 in “Re: Get rid of .git/branches/ and .git/remotes/?”
  1. linux@horizon.comNov 22, 2005
  2. Linus TorvaldsNov 22, 2005
  3. linux@horizon.comNov 22, 2005
  4. Andreas EricssonNov 22, 2005
  5. Nikolai WeibullNov 22, 2005
  6. Adrien BeauNov 22, 2005
  7. Andreas EricssonNov 22, 2005
  8. linux@horizon.comNov 22, 2005
  9. Andreas EricssonNov 22, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.