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

Re: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches

From
EWEric Wong <normalperson@yhbt.net>
Date
Jul 14, 2007, 11:34 UTC
Message-ID
<20070714113435.GC14842@muzzle>
In-Reply-To
<20070714110431.GA3854@piper.oerlikon.madduck.net>
martin f krafft <madduck@madduck.net> wrote:
Show 15 quoted lines
> also sprach Eric Wong <normalperson@yhbt.net> [2007.07.14.1250 +0200]:
> > This looks good and useful, but can I also have a  shorthand "-s" for
> > this, too?  I'm lazy, thanks :)
> 
> Of course.
> 
> > Also, nitpicking, there's been some whitespace damage:
> > 
> > I use tab characters for indentation, and (should be using) spaces for
> > alignment.
> 
> What's the difference? Or is it simply:
> 
>   no. of tabs:   int(column / 8)
>   no. of spaces: column % 8

It's also easier/faster to navigate code with tabs since there are fewer characters to iterate over, less granular points for indentation, making it easier to to get to a desired indentation level.

The less granularity with tabs means I can avoid situations where where I wonder if I'm correctly aligned with other pieces of code. I even have auto-indent set, but occasionally with spaces (when I work on Ruby code) I still have problems with being off-by-one after editing something.

There's absolutely no way I can misalign a block of code when alignment granularity is 8 characters no matter how sleepy I get :)

I use tabs for indentation where they denote logically different code paths / nesting.

Spaces (for alignment, not indentation) are mainly aesthetic. I use them in spaces when I need finer control (usually long conditionals in if-statements that are wrapped).

Tabs can also be easily reconfigured in editors to change the amount of screen real estate they consume. Not really useful in git-svn since I keep it <80 columns anyways.

> I am sorry, I tried to do it right, even paid attention to the
> tabs/spaces thing, but I guess I failed.

No worries. The maintainers here are also very picky about trailing whitespace and spaces that appear before tab characters, too and I became much more disciplined about that myself the past year.

I have highlighting search set in my editor (vim :set hls) and usually just search for spaces vs tabs to make sure I'm clean.

Of course, maintaining a consistent whitespace style helps a *lot* with the git/Linux patch exchange development style because it avoids needless patch application conflicts that arise from whitespace differences.

-- 
Eric Wong
Previous: martin f krafftNext: martin f krafft
Message 4 of 7 in “git-svn init/clone --stdlayout option to default-init trunk/tags/branches”
  1. git-svn init/clone --stdlayout option to default-init trunk/tags/branchesmartin f. krafft, Jul 14, 2007
  2. Eric WongJul 14, 2007
  3. martin f krafftJul 14, 2007
  4. Eric WongJul 14, 2007
  5. martin f krafftJul 14, 2007
  6. Eric WongJul 14, 2007
  7. Eric WongAug 23, 2007

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.